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 +4 -4
- data/lib/kitchen/driver/aws/client.rb +0 -1
- data/lib/kitchen/driver/aws/instance_generator.rb +4 -5
- data/lib/kitchen/driver/aws/standard_platform/amazon.rb +1 -1
- data/lib/kitchen/driver/aws/standard_platform/amazon2.rb +1 -1
- data/lib/kitchen/driver/aws/standard_platform/centos.rb +1 -1
- data/lib/kitchen/driver/aws/standard_platform/debian.rb +1 -1
- data/lib/kitchen/driver/aws/standard_platform/fedora.rb +1 -1
- data/lib/kitchen/driver/aws/standard_platform/freebsd.rb +1 -1
- data/lib/kitchen/driver/aws/standard_platform/rhel.rb +8 -1
- data/lib/kitchen/driver/aws/standard_platform/ubuntu.rb +1 -1
- data/lib/kitchen/driver/aws/standard_platform/windows.rb +1 -1
- data/lib/kitchen/driver/ec2.rb +7 -8
- data/lib/kitchen/driver/ec2_version.rb +1 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0f0f97881aef017104ee3af2f9577a1303495d3f29dd46a8cf22c491e179022b
|
4
|
+
data.tar.gz: caf442b23b9b8ed51149f9ca5af1aaa41112d47b21ac6e2b00e3167d21506ad2
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
#
|
@@ -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.
|
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
|
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
|
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 }
|
@@ -60,7 +60,7 @@ module Kitchen
|
|
60
60
|
end
|
61
61
|
|
62
62
|
def self.from_image(driver, image)
|
63
|
-
if
|
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
|
@@ -45,11 +45,18 @@ module Kitchen
|
|
45
45
|
end
|
46
46
|
|
47
47
|
def self.from_image(driver, image)
|
48
|
-
if
|
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
|
@@ -70,7 +70,7 @@ module Kitchen
|
|
70
70
|
end
|
71
71
|
|
72
72
|
def self.from_image(driver, image)
|
73
|
-
if
|
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]
|
data/lib/kitchen/driver/ec2.rb
CHANGED
@@ -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
|
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.
|
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.
|
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-
|
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.
|
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.
|
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: []
|