kitchen-rax 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/kitchen/driver/rax.rb +15 -18
- data/lib/kitchen/driver/rax_version.rb +1 -1
- metadata +1 -2
- data/lib/kitchen/driver/helper.rb +0 -16
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bfc94f8c28140b203dd41eada48141caa8807d70
|
4
|
+
data.tar.gz: 4c1bd141b46c01a319e0010c65b7e95a0315f34c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 1be5b082c84c9a791e3c423a94b88540a83db79ad2c27d5a74cc471a2e023a06b0344e8f028b61e06b21bcb0345c1898646b272580aae12798c2e41d26c925f6
|
7
|
+
data.tar.gz: 64dfe4131f17ff582bd7143a6726cfea74100aff8ea59f02c229ee19161a573d67dc204c6e1d3565771e7dee1de3325188f02ed57d2ad23069eea0d840ec4f14
|
data/lib/kitchen/driver/rax.rb
CHANGED
@@ -14,7 +14,7 @@ module Kitchen
|
|
14
14
|
default_config :port, '22'
|
15
15
|
default_config :rackspace_region, 'lon'
|
16
16
|
default_config :wait_for, 600
|
17
|
-
default_config
|
17
|
+
default_config :image_id
|
18
18
|
default_config(:server_name, &:default_name)
|
19
19
|
default_config :networks, nil
|
20
20
|
|
@@ -42,7 +42,8 @@ module Kitchen
|
|
42
42
|
server.wait_for { ready? }
|
43
43
|
puts '(server ready)'
|
44
44
|
rackconnect_check(server)
|
45
|
-
state[:hostname] =
|
45
|
+
state[:hostname] = server.public_ip_address
|
46
|
+
state[:password] = server.password
|
46
47
|
tcp_check(state)
|
47
48
|
rescue Fog::Errors::Error, Excon::Errors::Error => ex
|
48
49
|
raise ActionFailed, ex.message
|
@@ -69,14 +70,22 @@ module Kitchen
|
|
69
70
|
end
|
70
71
|
|
71
72
|
def create_server
|
72
|
-
server_def = { name:
|
73
|
+
server_def = { name: default_name }
|
73
74
|
[:image_id, :flavor_id].each do |opt|
|
74
75
|
server_def[opt] = config[opt]
|
75
76
|
end
|
76
77
|
server_def[:no_passwd_lock] = true
|
77
|
-
server = compute.servers.new(server_def)
|
78
|
-
|
79
|
-
|
78
|
+
server = compute.servers.new(server_def)
|
79
|
+
server.save
|
80
|
+
end
|
81
|
+
|
82
|
+
def self.default_name
|
83
|
+
[
|
84
|
+
instance.name.gsub(/\W/, '')[0..14],
|
85
|
+
(Etc.getlogin || 'nologin').gsub(/\W/, '')[0..14],
|
86
|
+
Socket.gethostname.gsub(/\W/, '')[0..22],
|
87
|
+
Array.new(7) { rand(36).to_s(36) }.join
|
88
|
+
].join('-')
|
80
89
|
end
|
81
90
|
|
82
91
|
def rackconnect_check(server)
|
@@ -85,18 +94,6 @@ module Kitchen
|
|
85
94
|
server.update
|
86
95
|
end
|
87
96
|
|
88
|
-
def winrm_transport?
|
89
|
-
instance.transport.name.casecmp("winrm") == 0
|
90
|
-
end
|
91
|
-
|
92
|
-
def hostname(server)
|
93
|
-
server.public_ip_address
|
94
|
-
end
|
95
|
-
|
96
|
-
def networks
|
97
|
-
nil
|
98
|
-
end
|
99
|
-
|
100
97
|
end
|
101
98
|
end
|
102
99
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: kitchen-rax
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.6.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Olivier Kouame
|
@@ -127,7 +127,6 @@ files:
|
|
127
127
|
- bin/console
|
128
128
|
- bin/setup
|
129
129
|
- kitchen-rax.gemspec
|
130
|
-
- lib/kitchen/driver/helper.rb
|
131
130
|
- lib/kitchen/driver/rax.rb
|
132
131
|
- lib/kitchen/driver/rax_version.rb
|
133
132
|
- spec/kitchen/rax_spec.rb
|
@@ -1,16 +0,0 @@
|
|
1
|
-
module Kitchen
|
2
|
-
|
3
|
-
module Driver
|
4
|
-
|
5
|
-
def self.default_name
|
6
|
-
[
|
7
|
-
instance.name.gsub(/\W/, '')[0..14],
|
8
|
-
(Etc.getlogin || 'nologin').gsub(/\W/, '')[0..14],
|
9
|
-
Socket.gethostname.gsub(/\W/, '')[0..22],
|
10
|
-
Array.new(7) { rand(36).to_s(36) }.join
|
11
|
-
].join('-')
|
12
|
-
end
|
13
|
-
|
14
|
-
end
|
15
|
-
|
16
|
-
end
|