kitchen-ec2 3.7.1 → 3.7.2

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: effb6d0cc14377657291cd970e2a6d50680d91df937b6799f0a942a2fba59994
4
- data.tar.gz: a2a0b678c22cf3da32be2ee90cb542cc2c2dff015fb3563ea7783b85ddd57649
3
+ metadata.gz: 0f0f97881aef017104ee3af2f9577a1303495d3f29dd46a8cf22c491e179022b
4
+ data.tar.gz: caf442b23b9b8ed51149f9ca5af1aaa41112d47b21ac6e2b00e3167d21506ad2
5
5
  SHA512:
6
- metadata.gz: 2761f62c4647000ee4b12ac11a0080f49bb5492c296e08a22c598d1bfb0a0ea993b7d0409c04003d7819d7f287dd9fd65b611f2135c8edf69a5e36421549ea2c
7
- data.tar.gz: 96b9d6c0062d85baafa9febca4fe0567f2659dc505c3e89da85caa3b6f82590f5a981d8df2907ee1f15709374e1e31f833f4cbb940a87b83283086e11084adab
6
+ metadata.gz: 9e017c01b5a5a9ef3c811c92016bd72c83d108dd08836ed55fc4ee689f63813768f9b9c9a70131be64d29e89c0f1eb1c88951c7ff0c3ae01177f9cd56fb30029
7
+ data.tar.gz: f020ac63fb41ee6b51b1829ec2a8b5122876ebfb8c0bca669b1872fc9e5a5108f332b02d3de2b008d079c7833bb6fee68957249fbbebfa7b30ab062c6ce50b12
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  #
3
2
  # Author:: Tyler Ball (<tball@chef.io>)
4
3
  #
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  #
3
2
  # Author:: Tyler Ball (<tball@chef.io>)
4
3
  #
@@ -17,7 +16,7 @@
17
16
  # See the License for the specific language governing permissions and
18
17
  # limitations under the License.
19
18
 
20
- require "base64"
19
+ require "base64" unless defined?(Base64)
21
20
  require "aws-sdk-ec2"
22
21
 
23
22
  module Kitchen
@@ -59,7 +58,7 @@ module Kitchen
59
58
  raise "The subnet tagged '#{config[:subnet_filter][:tag]}:#{config[:subnet_filter][:value]}' does not exist!" unless subnets.any?
60
59
 
61
60
  # => Select the least-populated subnet if we have multiple matches
62
- subnet = subnets.sort_by { |s| s[:available_ip_address_count] }.last
61
+ subnet = subnets.max_by { |s| s[:available_ip_address_count] }
63
62
  vpc_id = subnet.vpc_id
64
63
  config[:subnet_id] = subnet.subnet_id
65
64
  end
@@ -133,7 +132,7 @@ module Kitchen
133
132
 
134
133
  availability_zone = config[:availability_zone]
135
134
  if availability_zone
136
- if availability_zone =~ /^[a-z]$/i
135
+ if /^[a-z]$/i.match?(availability_zone)
137
136
  availability_zone = "#{config[:region]}#{availability_zone}"
138
137
  end
139
138
  i[:placement] = { availability_zone: availability_zone.downcase }
@@ -176,7 +175,7 @@ module Kitchen
176
175
  end
177
176
  availability_zone = config[:availability_zone]
178
177
  if availability_zone
179
- if availability_zone =~ /^[a-z]$/i
178
+ if /^[a-z]$/i.match?(availability_zone)
180
179
  availability_zone = "#{config[:region]}#{availability_zone}"
181
180
  end
182
181
  i[:placement] = { availability_zone: availability_zone.downcase }
@@ -39,7 +39,7 @@ module Kitchen
39
39
  end
40
40
 
41
41
  def self.from_image(driver, image)
42
- if image.name =~ /amzn-ami/i
42
+ if /amzn-ami/i.match?(image.name)
43
43
  image.name =~ /\b(\d+(\.\d+[\.\d])?)/i
44
44
  new(driver, "amazon", (Regexp.last_match || [])[1], image.architecture)
45
45
  end
@@ -39,7 +39,7 @@ module Kitchen
39
39
  end
40
40
 
41
41
  def self.from_image(driver, image)
42
- if image.name =~ /amzn2-ami/i
42
+ if /amzn2-ami/i.match?(image.name)
43
43
  image.name =~ /\b(\d+(\.\d+[\.\d])?)/i
44
44
  new(driver, "amazon2", (Regexp.last_match || [])[1], image.architecture)
45
45
  end
@@ -75,7 +75,7 @@ module Kitchen
75
75
  end
76
76
 
77
77
  def self.from_image(driver, image)
78
- if image.name =~ /centos/i
78
+ if /centos/i.match?(image.name)
79
79
  image.name =~ /\b(\d+(\.\d+)?)\b/i
80
80
  new(driver, "centos", (Regexp.last_match || [])[1], image.architecture)
81
81
  end
@@ -60,7 +60,7 @@ module Kitchen
60
60
  end
61
61
 
62
62
  def self.from_image(driver, image)
63
- if image.name =~ /debian/i
63
+ if /debian/i.match?(image.name)
64
64
  image.name =~ /\b(\d+|#{DEBIAN_CODENAMES.values.join("|")})\b/i
65
65
  version = (Regexp.last_match || [])[1]
66
66
  if version && version.to_i == 0
@@ -39,7 +39,7 @@ module Kitchen
39
39
  end
40
40
 
41
41
  def self.from_image(driver, image)
42
- if image.name =~ /fedora/i
42
+ if /fedora/i.match?(image.name)
43
43
  image.name =~ /\b(\d+(\.\d+)?)\b/i
44
44
  new(driver, "fedora", (Regexp.last_match || [])[1], image.architecture)
45
45
  end
@@ -41,7 +41,7 @@ module Kitchen
41
41
  end
42
42
 
43
43
  def self.from_image(driver, image)
44
- if image.name =~ /freebsd/i
44
+ if /freebsd/i.match?(image.name)
45
45
  image.name =~ /\b(\d+(\.\d+)?)\b/i
46
46
  new(driver, "freebsd", (Regexp.last_match || [])[1], image.architecture)
47
47
  end
@@ -45,11 +45,18 @@ module Kitchen
45
45
  end
46
46
 
47
47
  def self.from_image(driver, image)
48
- if image.name =~ /rhel/i
48
+ if /rhel/i.match?(image.name)
49
49
  image.name =~ /\b(\d+(\.\d+)?)/i
50
50
  new(driver, "rhel", (Regexp.last_match || [])[1], image.architecture)
51
51
  end
52
52
  end
53
+
54
+ def sort_by_version(images)
55
+ # First do a normal version sort
56
+ super(images)
57
+ # Now sort again, shunning Beta releases.
58
+ prefer(images) { |image| !image.name.match(/_Beta-/i) }
59
+ end
53
60
  end
54
61
  end
55
62
  end
@@ -39,7 +39,7 @@ module Kitchen
39
39
  end
40
40
 
41
41
  def self.from_image(driver, image)
42
- if image.name =~ /ubuntu/i
42
+ if /ubuntu/i.match?(image.name)
43
43
  image.name =~ /\b(\d+(\.\d+)?)\b/i
44
44
  new(driver, "ubuntu", (Regexp.last_match || [])[1], image.architecture)
45
45
  end
@@ -70,7 +70,7 @@ module Kitchen
70
70
  end
71
71
 
72
72
  def self.from_image(driver, image)
73
- if image.name =~ /Windows/i
73
+ if /Windows/i.match?(image.name)
74
74
  # 2008 R2 SP2
75
75
  if image.name =~ /(\b\d+)\W*(r\d+)?/i
76
76
  major, revision = (Regexp.last_match || [])[1], (Regexp.last_match || [])[2]
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  #
3
2
  # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
3
  #
@@ -17,8 +16,8 @@
17
16
  # See the License for the specific language governing permissions and
18
17
  # limitations under the License.
19
18
 
20
- require "benchmark"
21
- require "json"
19
+ require "benchmark" unless defined?(Benchmark)
20
+ require "json" unless defined?(JSON)
22
21
  require "kitchen"
23
22
  require_relative "ec2_version"
24
23
  require_relative "aws/client"
@@ -35,10 +34,10 @@ require_relative "aws/standard_platform/ubuntu"
35
34
  require_relative "aws/standard_platform/windows"
36
35
  require "aws-sdk-ec2"
37
36
  require "aws-sdk-core/waiters/errors"
38
- require "retryable"
39
- require "time"
40
- require "etc"
41
- require "socket"
37
+ require "retryable" unless defined?(Retryable)
38
+ require "time" unless defined?(Time)
39
+ require "etc" unless defined?(Etc)
40
+ require "socket" unless defined?(Socket)
42
41
 
43
42
  module Kitchen
44
43
 
@@ -261,7 +260,7 @@ module Kitchen
261
260
 
262
261
  info("EC2 instance <#{state[:server_id]}> ready (hostname: #{state[:hostname]}).")
263
262
  instance.transport.connection(state).wait_until_ready
264
- create_ec2_json(state) if instance.provisioner.name =~ /chef/i
263
+ create_ec2_json(state) if /chef/i.match?(instance.provisioner.name)
265
264
  debug("ec2:create '#{state[:hostname]}'")
266
265
  rescue Exception
267
266
  # Clean up any auto-created security groups or keys on the way out.
@@ -1,4 +1,3 @@
1
- # -*- encoding: utf-8 -*-
2
1
  #
3
2
  # Author:: Fletcher Nichol (<fnichol@nichol.ca>)
4
3
  #
@@ -22,6 +21,6 @@ module Kitchen
22
21
  module Driver
23
22
 
24
23
  # Version string for EC2 Test Kitchen driver
25
- EC2_VERSION = "3.7.1".freeze
24
+ EC2_VERSION = "3.7.2".freeze
26
25
  end
27
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.7.1
4
+ version: 3.7.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fletcher Nichol
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-07-13 00:00:00.000000000 Z
11
+ date: 2020-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: test-kitchen
@@ -126,14 +126,14 @@ dependencies:
126
126
  requirements:
127
127
  - - '='
128
128
  - !ruby/object:Gem::Version
129
- version: 1.1.2
129
+ version: 1.4.0
130
130
  type: :development
131
131
  prerelease: false
132
132
  version_requirements: !ruby/object:Gem::Requirement
133
133
  requirements:
134
134
  - - '='
135
135
  - !ruby/object:Gem::Version
136
- version: 1.1.2
136
+ version: 1.4.0
137
137
  - !ruby/object:Gem::Dependency
138
138
  name: climate_control
139
139
  requirement: !ruby/object:Gem::Requirement
@@ -174,7 +174,7 @@ homepage: https://github.com/test-kitchen/kitchen-ec2
174
174
  licenses:
175
175
  - Apache-2.0
176
176
  metadata: {}
177
- post_install_message:
177
+ post_install_message:
178
178
  rdoc_options: []
179
179
  require_paths:
180
180
  - lib
@@ -190,7 +190,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
190
190
  version: '0'
191
191
  requirements: []
192
192
  rubygems_version: 3.1.2
193
- signing_key:
193
+ signing_key:
194
194
  specification_version: 4
195
195
  summary: A Test Kitchen Driver for Amazon EC2
196
196
  test_files: []