kitchen-softlayer 0.0.2 → 0.0.3

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: e44a5783e05b9286591d821314810a2a02ffb34b
4
- data.tar.gz: 1d363218e182ec5f95ce36abeb61479aecdbd73a
3
+ metadata.gz: 6d1661e12830eb0495414973d5d91ce6bc19fbdc
4
+ data.tar.gz: b5867f90480c3181208fca35f6e56a7c642bb4fe
5
5
  SHA512:
6
- metadata.gz: 2983c4cba5a69f4316a8d33378c019a81387fdd8e8f249ca4afd2fd158839bcd039da57759661f7365c5e980e40f60fca7a0fa36ef9bbd85876a48beca590f09
7
- data.tar.gz: 37801e1b1992e929b64203a8c5f062b620aa4e3968798cd262df55afadd944ee7ceba037f88361064d777b7b8bd2c24511e77cfdf52d392540cb4e580ae8a013
6
+ metadata.gz: 464904655b21d7914156abcb90b58a4b409607bdb65283bf24ffdba540290fd4222a871b14bbea2df6bd106e773e0b872dfdb39d1fd1628d4f9535d52aa02928
7
+ data.tar.gz: 02452ddd30ee043e0192942ba9bcd9ec6102553d59563eab0a5fbb86155f3c04eeebed2a14e417ee3cb84e2458f17fb57f75f7dfd89481a1ba27c6cf49c6f7aa
data/README.md CHANGED
@@ -115,6 +115,8 @@ image_id | nil | image id for server
115
115
  ephemeral_storage | nil | storage
116
116
  network_components | nil | network
117
117
  ssh_timeout | 300 | timeout to ssh when server starting
118
+ destroy_wait | true | wait for destroy to complete
119
+ destroy_timeout | 300 | timeout to wait until server destroyed
118
120
  account_id | nil | softlayer account id
119
121
  datacenter | ENV['softlayer_default_datacenter'] | datacenter code
120
122
  single_tenant | false | don't share server
@@ -17,7 +17,7 @@ Gem::Specification.new do |spec|
17
17
  candidates += ['CHANGELOG.md', 'kitchen-softlayer.gemspec']
18
18
  spec.files = candidates.sort
19
19
  spec.require_paths = ['lib']
20
- spec.required_ruby_version = '>= 1.9.3'
20
+ spec.required_ruby_version = '>= 2.0.0'
21
21
  spec.add_dependency 'test-kitchen', '~> 1.4'
22
22
  spec.add_dependency 'fog', '~> 1.18'
23
23
  spec.add_dependency 'fog-softlayer', '~> 0.4'
@@ -56,6 +56,8 @@ module Kitchen
56
56
  default_config :softlayer_default_datacenter, ENV['softlayer_default_datacenter']
57
57
  default_config :softlayer_default_domain, ENV['softlayer_default_domain']
58
58
  default_config :ssh_timeout, 300
59
+ default_config :destroy_wait, true
60
+ default_config :destroy_timeout, 300
59
61
  default_config :account_id, nil
60
62
  default_config :datacenter, ENV['softlayer_default_datacenter']
61
63
  default_config :single_tenant, false
@@ -96,7 +98,8 @@ module Kitchen
96
98
 
97
99
  config[:disable_ssl_validation] && disable_ssl_validation
98
100
  server = compute.servers.get(state[:server_id])
99
- server.destroy unless server.nil?
101
+ server.destroy unless server.nil? || server.id.nil?
102
+ wait_for_server_to_delete(state) if config[:destroy_wait]
100
103
  info "Softlayer instance <#{state[:server_id]}> destroyed."
101
104
  state.delete(:server_id)
102
105
  state.delete(:hostname)
@@ -104,6 +107,16 @@ module Kitchen
104
107
 
105
108
  private
106
109
 
110
+ def wait_for_server_to_delete(state)
111
+ ((config[:destroy_timeout].to_i / 15).floor).times do
112
+ info 'Deleting server in softlayer'
113
+ sleep 15
114
+ server = compute.servers.get(state[:server_id])
115
+ return if server.nil? || server.id.nil?
116
+ end
117
+ fail "#{config[:destroy_timeout]} seconds went by and server not deleted by softlayer"
118
+ end
119
+
107
120
  def wait_for_ssh_key_access(state)
108
121
  new_state = build_ssh_args(state)
109
122
  new_state[2][:number_of_password_prompts] = 0
@@ -15,6 +15,6 @@
15
15
  module Kitchen
16
16
  # Version string for Softlayer Kitchen driver
17
17
  module Driver
18
- SOFTLAYER_VERSION = '0.0.2'
18
+ SOFTLAYER_VERSION = '0.0.3'
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-softlayer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Neill Turner
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-09-17 00:00:00.000000000 Z
11
+ date: 2015-10-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -77,7 +77,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
77
77
  requirements:
78
78
  - - ">="
79
79
  - !ruby/object:Gem::Version
80
- version: 1.9.3
80
+ version: 2.0.0
81
81
  required_rubygems_version: !ruby/object:Gem::Requirement
82
82
  requirements:
83
83
  - - ">="