Project

General

Profile

foreman-vcenter67-network.patch

Zachary Bedell, 06/12/2018 03:33 PM

View differences:

app/models/concerns/fog_extensions/vsphere/server.rb 2018-06-07 16:48:16.890547789 -0400
38 38
      def select_nic(fog_nics, nic)
39 39
        nic_attrs = nic.compute_attributes
40 40
        all_networks = service.raw_networks(datacenter)
41
        vm_network = all_networks.detect { |network| network._ref == nic_attrs['network'] }
42
        vm_network ||= all_networks.detect { |network| nic_attrs['network'] && [network.name, network.try(:key)].include?(nic_attrs['network']) }
41
        vm_network = all_networks.detect { |network| nic_attrs['network'] && [network.name, network.try(:key)].include?(nic_attrs['network']) }
42
        vm_network ||= all_networks.detect { |network| network._ref == nic_attrs['network'] }
43 43
        unless vm_network
44 44
          Rails.logger.info "Could not find Vsphere network for #{nic_attrs.inspect}"
45 45
          return