vm_shepherd 1.4.0 → 1.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dbd68ca7cd87040a4ab49f591a0d2b16331051c9
4
- data.tar.gz: 5ceaa7fabf7637124880840b74e3bf27f3d9fb28
3
+ metadata.gz: d651eae0f4aec0ff18eda463eae1a48fc4db49fe
4
+ data.tar.gz: f89579c3c6107425c651715d3ed3bf96c2ad1aef
5
5
  SHA512:
6
- metadata.gz: ef7f38a5e4751e80910e01a4848f3ec49d536c47023bba2984696fdadc008e317dac2d8e5f7e8043e116aa6008a4fbd15e55b5c5dba3a909a2d49338d68209fc
7
- data.tar.gz: 7d240aa912d76813f3621b994c63fff6bae93336c17a4999156b5b4cfd018e11ecd5670b07490adc5efdd0a8865437858c765c50edd31bc5d46068995950558d
6
+ metadata.gz: 80b37120cdb02146ef61856c65b1cf2b0cbc7a1e2075559b4665bb65a142743b3ce557fe323d071cda901e34af93370d6e8b24e9d60bae7ae14eb462f9f836b7
7
+ data.tar.gz: 47d0e3cbb0ae21ae21ecf67ab4c9fb7cdb9a86c7a45040f52ee84ea87feb7d635a7e014b84a20454a1382a610083b5a257e61f38b00db4b3293a3f62a9425fb6
@@ -45,7 +45,7 @@ module VmShepherd
45
45
  end
46
46
 
47
47
  def deploy(ami_file_path:, vm_config:)
48
- image_id = File.read(ami_file_path).strip
48
+ image_id = read_ami_id(ami_file_path)
49
49
 
50
50
  instance =
51
51
  retry_until do
@@ -75,6 +75,10 @@ module VmShepherd
75
75
  instance.add_tag('Name', value: vm_config.fetch(:vm_name))
76
76
  end
77
77
 
78
+ def read_ami_id(ami_file_path)
79
+ YAML.load_file(ami_file_path)[env_config.fetch(:region)]
80
+ end
81
+
78
82
  def clean_environment
79
83
  [:public_subnet_id, :private_subnet_id].each do |subnet_id|
80
84
  subnet_id = env_config.fetch(:outputs).fetch(subnet_id)
@@ -1,3 +1,3 @@
1
1
  module VmShepherd
2
- VERSION = '1.4.0'.freeze
2
+ VERSION = '1.5.0'.freeze
3
3
  end
@@ -5,7 +5,12 @@ module VmShepherd
5
5
  let(:access_key) { 'access-key' }
6
6
  let(:secret_key) { 'secret-key' }
7
7
  let(:ami_id) { 'ami-deadbeef' }
8
- let(:ami_file_path) { Tempfile.new('ami-id-file').tap { |f| f.write("#{ami_id}\n"); f.close }.path }
8
+ let(:ami_file_path) do
9
+ Tempfile.new('ami-id-file').tap do |f|
10
+ f.write("#{{'us-east-1' => ami_id, 'not-the-right-region' => 'bad-id'}.to_yaml}")
11
+ f.close
12
+ end.path
13
+ end
9
14
  let(:elastic_ip_id) { 'elastic-ip-id' }
10
15
  let(:ec2) { double('AWS.ec2') }
11
16
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: vm_shepherd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ops Manager Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-06-03 00:00:00.000000000 Z
11
+ date: 2015-06-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-v1