Skip to content

Commit

Permalink
Fix nic_settings requiring duplicate values
Browse files Browse the repository at this point in the history
  • Loading branch information
agrare committed Nov 12, 2024
1 parent 0421166 commit 5754ea2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -110,8 +110,11 @@ def collect_nic_settings
nics = Array.wrap(options[:nic_settings])
nic = nics[0]
nic = {} if nic.blank?
[:dns_domain, :dns_servers, :sysprep_netbios_mode, :wins_servers, :addr_mode,
:gateway, :subnet_mask, :ip_addr].each { |key| nic[key] = options[key] }

%i[dns_domain dns_servers sysprep_netbios_mode wins_servers addr_mode gateway subnet_mask ip_addr].each do |key|
nic[key] ||= options[key] if options.key?(key)
end

nics[0] = nic

options[:nic_settings] = nics
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,6 @@
options[:sysprep_full_name] = 'sysprep_full_name_value'
options[:sysprep_organization] = 'sysprep_organization_value'
options[:requested_network_adapter_count] = 2
options[:ip_addr] = "192.168.1.10" # NOTE: Shouldn't have to set nic_settings and ip_addr
options[:nic_settings] = [{:ip_addr => "192.168.1.10"}, {:ip_addr => "192.168.2.10"}]

expect(prov_vm).not_to receive(:load_customization_spec)
Expand Down

0 comments on commit 5754ea2

Please sign in to comment.