beaker-aws 0.8.0 → 0.8.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
  SHA1:
3
- metadata.gz: 5b26a191837d6178ca381188d630580e7164fb81
4
- data.tar.gz: 8f99f771202aac99eca8c1398d0b8c6c9c72df81
3
+ metadata.gz: 25ed7d4088360b6932af6030241fbec171819c1f
4
+ data.tar.gz: 5a087caf648e84fc6886f7cb77aea9c430569fa5
5
5
  SHA512:
6
- metadata.gz: d8097804f569ec2a6ff9138de95df973af467b2f49d7c03c34b1062313af88a20ae3dc69a1c6f9aafc1d7aaf453574c5e0bf164566b675ab1f5f48669336d297
7
- data.tar.gz: 41146639bd25556a5e0a3853c7ad96adaf4b7ae3a20984efb26dd6a0bfd65f22ad1dad3710701c966f24837b98ff5d0a2380e5e313066a456565405b1355ea98
6
+ metadata.gz: 0e8141e8939e84487128d04be5315dd7e3ac747076d6a01201aa75d16ede330650c06eed48d8d6ef1b052ef8c32abe80a3993db562866492f3d33212ae838263
7
+ data.tar.gz: bc3a0e59c45667e3a38939a7f8896f404a4997facf5dc7942f826385af689dbf915d6a1424add235ee2c6a32de41212aba0a53a32250e1e410b168974190da71
data/CHANGELOG.md CHANGED
@@ -1,6 +1,13 @@
1
1
  # Change Log
2
2
 
3
- [Unreleased](https://github.com/puppetlabs/beaker-aws/compare/0.8.0...master)
3
+ [Unreleased](https://github.com/puppetlabs/beaker-aws/compare/0.8.1...master)
4
+
5
+ ## [0.8.1](https://github.com/puppetlabs/beaker-aws/tree/0.8.0) (2018-12-21)
6
+ [Full Changelog](https://github.com/puppetlabs/beaker-aws/compare/0.8.0...0.8.1)
7
+
8
+ **Merged pull requests:**
9
+
10
+ - \(maint\) Fix BKR-1546 for the case where subnet is nil
4
11
 
5
12
  ## [0.8.0](https://github.com/puppetlabs/beaker-aws/tree/0.8.0) (2018-12-12)
6
13
  [Full Changelog](https://github.com/puppetlabs/beaker-aws/compare/0.7.0...0.8.0)
@@ -1,3 +1,3 @@
1
1
  module BeakerAws
2
- VERSION = '0.8.0'
2
+ VERSION = '0.8.1'
3
3
  end
@@ -267,10 +267,15 @@ module Beaker
267
267
  vpc_id = host['vpc_id'] || @options['vpc_id'] || nil
268
268
  host['sg_cidr_ips'] = host['sg_cidr_ips'] || '0.0.0.0/0';
269
269
  sg_cidr_ips = host['sg_cidr_ips'].split(',')
270
+ assoc_pub_ip_addr = host['associate_public_ip_address']
270
271
 
271
272
  if vpc_id && !subnet_id
272
273
  raise RuntimeError, "A subnet_id must be provided with a vpc_id"
273
274
  end
275
+
276
+ if assoc_pub_ip_addr && !subnet_id
277
+ raise RuntimeError, "A subnet_id must be provided when configuring assoc_pub_ip_addr"
278
+ end
274
279
 
275
280
  # Use snapshot provided for this host
276
281
  image_type = host['snapshot']
@@ -345,14 +350,17 @@ module Beaker
345
350
  :instance_type => amisize,
346
351
  :disable_api_termination => false,
347
352
  :instance_initiated_shutdown_behavior => "terminate",
348
- :network_interfaces => [{
353
+ }
354
+ if assoc_pub_ip_addr
355
+ config[:network_interfaces] = [{
349
356
  :subnet_id => subnet_id,
350
357
  :groups => [security_group.group_id, ping_security_group.group_id],
351
358
  :device_index => 0,
352
- }],
353
- }
354
- assoc_pub_ip_addr = host['associate_public_ip_address']
355
- config[:network_interfaces][0][:associate_public_ip_address] = assoc_pub_ip_addr unless assoc_pub_ip_addr.nil?
359
+ :associate_public_ip_address => assoc_pub_ip_addr,
360
+ }]
361
+ else
362
+ config[:subnet_id] = subnet_id
363
+ end
356
364
  config[:block_device_mappings] = block_device_mappings if image.root_device_type == :ebs
357
365
  reservation = client(region).run_instances(config)
358
366
  reservation.instances.first
@@ -1234,6 +1234,12 @@ module Beaker
1234
1234
  allow(aws).to receive(:ensure_key_pair).and_return(key_pair_result)
1235
1235
  end
1236
1236
 
1237
+ it 'raises an error when associate_public_ip_address is included without subnet_id' do
1238
+ host = @hosts[0]
1239
+ host['associate_public_ip_address'] = true
1240
+ expect{ aws.create_instance(host, amispec, nil) }.to raise_error("A subnet_id must be provided when configuring assoc_pub_ip_addr")
1241
+ end
1242
+
1237
1243
  it 'sets associate_public_ip_address when included' do
1238
1244
  host = @hosts[0]
1239
1245
  host['associate_public_ip_address'] = true
@@ -1241,13 +1247,13 @@ module Beaker
1241
1247
  :network_interfaces => [hash_including(:associate_public_ip_address => true)])
1242
1248
  reservation = instance_double(Aws::EC2::Types::Reservation, :instances => [instance_double(Aws::EC2::Types::Instance)])
1243
1249
  expect(mock_client).to receive(:run_instances).with(variable_path).and_return(reservation)
1244
- aws.create_instance(host, amispec, nil)
1250
+ aws.create_instance(host, amispec, "subnetfoo")
1245
1251
  end
1246
1252
 
1247
- it 'omits associate_public_ip_address when not included' do
1253
+ it 'omits network_interfaces and associate_public_ip_address when not included, instead using subnet_id' do
1248
1254
  host = @hosts[0]
1249
1255
  variable_path = hash_including(
1250
- :network_interfaces => [hash_excluding(:associate_public_ip_address => anything)])
1256
+ :subnet_id => nil)
1251
1257
  reservation = instance_double(Aws::EC2::Types::Reservation, :instances => [instance_double(Aws::EC2::Types::Instance)])
1252
1258
  expect(mock_client).to receive(:run_instances).with(variable_path).and_return(reservation)
1253
1259
  aws.create_instance(host, amispec, nil)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: beaker-aws
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rishi Javia, Kevin Imber, Tony Vu
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-13 00:00:00.000000000 Z
11
+ date: 2018-12-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rspec