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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9c4c22fb377b01cf730cd31dd72dc6de908e43b4
4
- data.tar.gz: 298de706ad57ef5759a6bf41472e3f4a982478f6
3
+ metadata.gz: bfc94f8c28140b203dd41eada48141caa8807d70
4
+ data.tar.gz: 4c1bd141b46c01a319e0010c65b7e95a0315f34c
5
5
  SHA512:
6
- metadata.gz: 3d33a6c0ab46b5b987b96095f4f2b65ea58c894a37c2f4b0a699fabf994fa9b68d7e09156a8a3a9cc9e2938bedeb2e570665949d74c60f956eaf186f1c98f80f
7
- data.tar.gz: 011270625672dbb21aea541d619610a01d532882b683e82d149e5241ab054007d17ac01240fbcc423ecd20c90c7b2c498bf79f48ac772634ce7eac9922d855ff
6
+ metadata.gz: 1be5b082c84c9a791e3c423a94b88540a83db79ad2c27d5a74cc471a2e023a06b0344e8f028b61e06b21bcb0345c1898646b272580aae12798c2e41d26c925f6
7
+ data.tar.gz: 64dfe4131f17ff582bd7143a6726cfea74100aff8ea59f02c229ee19161a573d67dc204c6e1d3565771e7dee1de3325188f02ed57d2ad23069eea0d840ec4f14
@@ -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(:image_id, &:default_image)
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] = hostname(server)
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: config[:server_name], networks: networks }
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).save
78
- username = instance.transport[:username]
79
- state[:password] = server.password
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
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for Rax Kitchen driver
24
- RAX_VERSION = "0.5.0"
24
+ RAX_VERSION = "0.6.0"
25
25
  end
26
26
  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.5.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