fog-vsphere 1.11.2 → 1.11.3

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: 8f7885912d59e38376666aabf47b11855a457e99
4
- data.tar.gz: 1a84d71a6d17751e49a1ccb64fcbe5b6564efae6
3
+ metadata.gz: 259e868ec79a58fd97457645401a8771432781d2
4
+ data.tar.gz: 5e4890489b7f412b31af88069c3fae0f2b32bf68
5
5
  SHA512:
6
- metadata.gz: 466b2ca1d744fac648e5abe6183ca89583e3398abe78d1c99669452025d38a2d52e6229abcddf4843099d45519020edf82549ecba0345c32d6e64b9dde479076
7
- data.tar.gz: f0b2c3e5a7cf517b8a95bcd12537b381e83bed40626185c04c393276e4ac771d195bbb87a1a6025d43a2b1d2526f8c2a4b59df937e012d23edd0304876c5cb24
6
+ metadata.gz: cf035226cec5df7395df07c46707af0369ed277dddc60ef41bf2bb8c737a01092db58b614b22ffd9285f5158b713711b078f37fa7858341243792b940c416734
7
+ data.tar.gz: 91398f19bfd736f7e14a1f91c5178a49b18a888baf4f6d225b440a9b3ac56865f4de54ef0fa450fb0acff76357f852fc5c553cc0622bb2a9eec860db0dbc80f8
@@ -1,3 +1,8 @@
1
+ ## v1.11.3
2
+
3
+ * Fix issue when cloning and interface is in boot order
4
+ * Add connected attribute to interface
5
+
1
6
  ## v1.11.2
2
7
 
3
8
  * Prevent failing when cloning from template to different cluster
@@ -61,6 +61,7 @@
61
61
  * Shlomi Zadok <shlomi@ben-hanna.com>
62
62
  * Simon Josi <me@yokto.net>
63
63
  * Tejas Ravindra Mandke <tejas@identified.com>
64
+ * Timo Goebel <mail@timogoebel.name>
64
65
  * Timo Goebel <timo.goebel@dm.de>
65
66
  * Timur Alperovich <timur@maginatics.com>
66
67
  * Tyler Gregory <01100010011001010110010101110000@users.noreply.github.com>
@@ -10,6 +10,7 @@ module Fog
10
10
  attribute :network
11
11
  attribute :name
12
12
  attribute :status
13
+ attribute :connected
13
14
  attribute :summary
14
15
  attribute :type
15
16
  attribute :key
@@ -67,6 +67,7 @@ module Fog
67
67
  :mac => nic.macAddress,
68
68
  :network => nic.backing.respond_to?("network") ? nic.backing.network.name : nic.backing.port.portgroupKey,
69
69
  :status => nic.connectable.status,
70
+ :connected => nic.connectable.connected,
70
71
  :summary => nic.deviceInfo.summary,
71
72
  :type => nic.class,
72
73
  :key => nic.key,
@@ -155,7 +155,7 @@ module Fog
155
155
  if options.key?('network_label')
156
156
  raise ArgumentError, "interfaces option can't be specified together with network_label"
157
157
  end
158
- device_change.concat(modify_template_nics_specs(template_path, options['interfaces'], options['datacenter']))
158
+ device_change.concat(modify_template_nics_specs(vm_mob_ref, options['interfaces'], options['datacenter']))
159
159
  elsif options.key?('network_label')
160
160
  device_change << modify_template_nics_simple_spec(options['network_label'], options['nic_type'], options['network_adapter_device_key'], options['datacenter'])
161
161
  end
@@ -711,21 +711,36 @@ module Fog
711
711
  end
712
712
 
713
713
 
714
- def modify_template_nics_specs(template_path, new_nics, datacenter)
715
- template_nics = list_vm_interfaces(template_path, datacenter).map do |old_attributes|
716
- Fog::Compute::Vsphere::Interface.new(old_attributes)
717
- end
714
+ def modify_template_nics_specs(vm_mob_ref, nics, datacenter)
718
715
  specs = []
716
+ template_nics = vm_mob_ref.config.hardware.device.grep(RbVmomi::VIM::VirtualEthernetCard)
717
+ modified_nics = nics.take(template_nics.size)
718
+ new_nics = nics.drop(template_nics.size)
719
719
 
720
- template_nics.each do |interface|
721
- specs << create_interface(interface, interface.key, :remove, :datacenter => datacenter)
720
+ template_nics.zip(modified_nics).each do |template_nic, new_nic|
721
+ if new_nic
722
+ backing = create_nic_backing(new_nic, {})
723
+ template_nic.backing = backing
724
+ connectable = RbVmomi::VIM::VirtualDeviceConnectInfo(
725
+ :allowGuestControl => true,
726
+ :connected => true,
727
+ :startConnected => true
728
+ )
729
+ template_nic.connectable = connectable
730
+ specs << {
731
+ operation: :edit,
732
+ device: template_nic
733
+ }
734
+ else
735
+ specs << create_interface(interface, interface.key, :remove, :datacenter => datacenter)
736
+ end
722
737
  end
723
738
 
724
739
  new_nics.each do |interface|
725
740
  specs << create_interface(interface, 0, :add, :datacenter => datacenter)
726
741
  end
727
742
 
728
- return specs
743
+ specs
729
744
  end
730
745
 
731
746
  def modify_template_volumes_specs(vm_mob_ref, volumes)
@@ -1,5 +1,5 @@
1
1
  module Fog
2
2
  module Vsphere
3
- VERSION = '1.11.2'.freeze
3
+ VERSION = '1.11.3'.freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fog-vsphere
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.11.2
4
+ version: 1.11.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - J.R. Garcia
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-07-10 00:00:00.000000000 Z
11
+ date: 2017-07-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fog-core