kitchen-ec2 3.10.0 → 3.10.1

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
  SHA256:
3
- metadata.gz: b5acaa7d4d497244e97e35e4d8c44f1b0a8771100dfb0ef01cae937a7904a853
4
- data.tar.gz: 92a4bb2ffeb6c84295fc6432e0c0852e63e11f1a4cbea7ae4fad54888ad9869e
3
+ metadata.gz: 9bf47b3328885d0439de770cf9e683fb9bddbab66b0d0bf40f6ab17190c7cf15
4
+ data.tar.gz: 0e384572b5d252a367c9dd689f48d64764e4540a3ccba34399402eeca7a80226
5
5
  SHA512:
6
- metadata.gz: fb7fc3f4d93a893455e274f0744c510526a79c2bd997bf6ef712f9e7774ab13a077b2c038402d7c41eaf8610f7b0bff9abeddddc5633b36c2e1142bfe72c4779
7
- data.tar.gz: 44f07e5fb729c8fd106e3df0030a7d267322ebd80220f19f115e2f8addc6148a1ebd5c2da05bb4e5f84867c74b1889a4131881183f8f89ed5f67bde776e7ac7d
6
+ metadata.gz: 2dba5e5835f48d9505a967b7d1c64f76cfd70532a6956f8c8bada246814f5affa0ebfc09176354e7f719663347056f3332176489e64b8471f073cb2452f055f6
7
+ data.tar.gz: 787c72dc701db53331e399c0080d0bcce09d9657e8814bddf3d359186ed30d409391c068b545b09dbce9a527d0fcb793d3a79197058933f5f40d3d2dd21fcbeb
@@ -75,6 +75,13 @@ module Kitchen
75
75
  ).to_a[0]
76
76
  end
77
77
 
78
+ # check if instance exists, given an id
79
+ # @param id [String] aws instance id
80
+ # @return boolean
81
+ def instance_exists?(id)
82
+ resource.instance(id).exists?
83
+ end
84
+
78
85
  def client
79
86
  @client ||= ::Aws::EC2::Client.new
80
87
  end
@@ -285,7 +285,7 @@ module Kitchen
285
285
  # If we are going to clean up an automatic security group, we need
286
286
  # to wait for the instance to shut down. This slightly breaks the
287
287
  # subsystem encapsulation, sorry not sorry.
288
- if state[:auto_security_group_id] && server
288
+ if state[:auto_security_group_id] && server && ec2.instance_exists?(state[:server_id])
289
289
  server.wait_until_terminated do |waiter|
290
290
  waiter.max_attempts = config[:retryable_tries]
291
291
  waiter.delay = config[:retryable_sleep]
@@ -21,6 +21,6 @@ module Kitchen
21
21
  module Driver
22
22
 
23
23
  # Version string for EC2 Test Kitchen driver
24
- EC2_VERSION = "3.10.0".freeze
24
+ EC2_VERSION = "3.10.1".freeze
25
25
  end
26
26
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kitchen-ec2
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.10.0
4
+ version: 3.10.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-07-02 00:00:00.000000000 Z
11
+ date: 2021-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -105,7 +105,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
105
105
  - !ruby/object:Gem::Version
106
106
  version: '0'
107
107
  requirements: []
108
- rubygems_version: 3.2.15
108
+ rubygems_version: 3.2.22
109
109
  signing_key:
110
110
  specification_version: 4
111
111
  summary: A Test Kitchen Driver for Amazon EC2