vm_shepherd 3.0.2 → 3.0.3

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: bc45b859c5013f1189f753df5c6d1f80ac7ff6ec
4
- data.tar.gz: 1b6ac77a2d6efe4a663ec4bf05bd58c4201dc1b3
3
+ metadata.gz: 2bda04a445240a1429183e7c51822cc950c901cd
4
+ data.tar.gz: 38c5e5d7a8876bc3e2178cd65d1dfaaacb7c53e6
5
5
  SHA512:
6
- metadata.gz: 9b40e5b95782928f7523393a1f705773e79e3a7d2489164c72bd341604f9d36d517fbda9e0a30c657f55fbdb45c6f4afb24e411e3a8db80f515596878f6df6ef
7
- data.tar.gz: 2938ba590b8f1b89eb48d8a239ac765454fac6624ae2cc15c08bf11930c617808d94a944a88ee4956bdce13a16e2cad9b5e652ae117e60dee0c37017a357c912
6
+ metadata.gz: 08ace1e2afab360a8267253f487e3624f0bd7aed49a69d9040638e0181ebbf86138587918fe08f29ca08c813413a4d0676b4051541b59475fcca37a0571ddb53
7
+ data.tar.gz: d1be716a990bdfc2e76b3177d7b952e89f180fa3bd5bb025c074bb7e759ed9b4442e345b306d5630e7462cc5026e74bc12a5e92e6573f72812e27e3996ad0dcd
@@ -1,6 +1,10 @@
1
+ require 'vm_shepherd/retry_helper'
2
+
1
3
  module VmShepherd
2
4
  module Vcloud
3
5
  class Deployer
6
+ extend RetryHelper
7
+
4
8
  def self.deploy_and_power_on_vapp(client:, ovf_dir:, vapp_config:, vdc_name:)
5
9
  catalog = client.create_catalog(vapp_config.catalog)
6
10
 
@@ -12,7 +16,10 @@ module VmShepherd
12
16
  vapp = catalog.instantiate_vapp_template(vapp_config.name, vdc_name, vapp_config.name, nil, nil, network_config)
13
17
 
14
18
  # reconfigure vm
15
- vm = vapp.find_vm_by_name(vapp_config.name)
19
+ vm = retry_until(retry_limit: 10, retry_interval: 10) do
20
+ vapp.vms.first
21
+ end
22
+
16
23
  vm.product_section_properties = vapp_config.build_properties
17
24
 
18
25
  # power on vapp
@@ -1,3 +1,3 @@
1
1
  module VmShepherd
2
- VERSION = '3.0.2'.freeze
2
+ VERSION = '3.0.3'.freeze
3
3
  end
@@ -30,7 +30,7 @@ module VmShepherd
30
30
  allow(client).to receive(:create_catalog).and_return(catalog)
31
31
  allow(catalog).to receive(:upload_vapp_template)
32
32
  allow(catalog).to receive(:instantiate_vapp_template).and_return(vapp)
33
- allow(vapp).to receive(:find_vm_by_name).and_return(vm)
33
+ allow(vapp).to receive_message_chain(:vms, :first).and_return(vm)
34
34
  allow(vm).to receive(:product_section_properties=)
35
35
  allow(vapp).to receive(:power_on)
36
36
 
@@ -140,7 +140,7 @@ module VmShepherd
140
140
 
141
141
  allow(VCloudSdk::NetworkConfig).to receive(:new).and_return(network_config)
142
142
 
143
- allow(vapp).to receive(:find_vm_by_name).and_return(vm)
143
+ allow(vapp).to receive_message_chain(:vms, :first).and_return(vm)
144
144
  allow(vm).to receive(:product_section_properties=)
145
145
  allow(vapp).to receive(:power_on)
146
146
  end
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.2
4
+ version: 3.0.3
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-02-08 00:00:00.000000000 Z
11
+ date: 2016-02-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: aws-sdk-v1