vm_shepherd 3.0.7 → 3.0.8

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: 8f86d26b80dc99b056384dcc0aaeb0f4bd70578e
4
- data.tar.gz: 9da389b55c929e28cb629fc23a84c5c848aa9003
3
+ metadata.gz: 0a0849bb2535214c6f36d2587fba1b49539cc10d
4
+ data.tar.gz: 956cd94e7372420ade106411e5bee1a1b2de11bf
5
5
  SHA512:
6
- metadata.gz: 2401aa7f8af3e5a35de71fac452db992e263b2c071ea8a112f2c445a372ce07615bea54892feaa6a7f7f2deb625ca9da11def4475bd898c695703b1ba09162fc
7
- data.tar.gz: 3b310da5855b10284b4da2b1a3bf5f70315ac8e96b0248b0a03e0bcf0681d7ae0cd0eb189b3470dd9b9d8486bb4f0054257ed99fbdc3409ab030eba72e877bc7
6
+ metadata.gz: 96bca2b1fa4ee198c50802ea3b14ed10393bea9392ef5b7ad670516404420859c4bfad94ae2bc9c6ebe1dd010b82d3047eb57ceb67404bc49c7794a3791aba40
7
+ data.tar.gz: 00fd41ab55b1d82db8741245264bd2ccf9b31d1e234d24ad7a615d23f4e37e42574d9bb073076587ab4be70e6c5e7c5e0446a0fed45d987332bad70b07ce440a
@@ -15,7 +15,7 @@ module VmShepherd
15
15
  def deploy(raw_file_path, vm_options)
16
16
  say "Uploading the image #{raw_file_path}"
17
17
  image = image_service.images.create(
18
- name: vm_options[:name],
18
+ name: "#{vm_options[:name]} #{Time.now}",
19
19
  size: File.size(raw_file_path),
20
20
  disk_format: 'raw',
21
21
  container_format: 'bare',
@@ -61,9 +61,9 @@ module VmShepherd
61
61
  say('Ops Manager instance destroyed')
62
62
  end
63
63
 
64
- image = image_service.images.find { |img| img.name == vm_options[:name] }
65
- if image
66
- say("Found Ops Manager image #{image.id}")
64
+ image_service.images.each do |image|
65
+ next unless /#{vm_options[:name]} \d+/ =~ image.name && image.status != 'deleted'
66
+ say("Found an Ops Manager image for env [#{vm_options[:name]}]: [#{image.id}][#{image.name}]")
67
67
  image.destroy
68
68
  say('Ops Manager image destroyed')
69
69
  end
@@ -92,6 +92,7 @@ module VmShepherd
92
92
 
93
93
  say("Destroying #{private_images.size} images:")
94
94
  private_images.each do |image|
95
+ next if image.status == 'deleted'
95
96
  say(" Destroying image #{image.id}")
96
97
  image.destroy
97
98
  end
@@ -1,3 +1,3 @@
1
1
  module VmShepherd
2
- VERSION = '3.0.7'.freeze
2
+ VERSION = '3.0.8'.freeze
3
3
  end
@@ -117,7 +117,7 @@ module VmShepherd
117
117
 
118
118
  openstack_vm_manager.deploy(path, openstack_vm_options)
119
119
 
120
- uploaded_image = image_service.images.find { |image| image.name == openstack_vm_options[:name] }
120
+ uploaded_image = image_service.images.find { |image| /#{openstack_vm_options[:name]} \d+/ =~ image.name }
121
121
  expect(uploaded_image).to be
122
122
  expect(uploaded_image.size).to eq(file_size)
123
123
  expect(uploaded_image.disk_format).to eq('raw')
@@ -142,7 +142,7 @@ module VmShepherd
142
142
  openstack_vm_manager.deploy(path, openstack_vm_options)
143
143
 
144
144
  instance_image = image_service.images.get instance.image['id']
145
- expect(instance_image.name).to eq(openstack_vm_options[:name])
145
+ expect(instance_image.name).to match(openstack_vm_options[:name])
146
146
  end
147
147
 
148
148
  it 'assigns the correct key_name to the instance' do
@@ -216,7 +216,7 @@ module VmShepherd
216
216
  def destroy_correct_image
217
217
  change do
218
218
  images.reload
219
- images.select { |image| image.name == openstack_vm_options[:name] }.any?
219
+ images.select { |image| /#{openstack_vm_options[:name]} \d.+/ =~ image.name }.any?
220
220
  end.from(true).to(false)
221
221
  end
222
222
 
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: 3.0.7
4
+ version: 3.0.8
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: 2016-03-02 00:00:00.000000000 Z
11
+ date: 2016-03-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-v1
@@ -206,7 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
206
206
  version: '0'
207
207
  requirements: []
208
208
  rubyforge_project:
209
- rubygems_version: 2.5.1
209
+ rubygems_version: 2.4.5.1
210
210
  signing_key:
211
211
  specification_version: 4
212
212
  summary: A tool for booting and tearing down Ops Manager VMs on various Infrastructures.