diff --git a/lib/puppet/provider/ipconfig/ipconfig.rb b/lib/puppet/provider/ipconfig/ipconfig.rb index 1630893..01bb0ea 100644 --- a/lib/puppet/provider/ipconfig/ipconfig.rb +++ b/lib/puppet/provider/ipconfig/ipconfig.rb @@ -125,7 +125,7 @@ def defaultgateway= newvalue def gwcostmetric enum_netconn do |netconnectionid| - gwcm=netconnectionid.gatewaycostmetric.to_s + gwcm=(netconnectionid.gatewaycostmetric).join(',') return gwcm end end @@ -232,4 +232,4 @@ def destroy netconnectionid.enabledhcp() end end -end \ No newline at end of file +end diff --git a/lib/puppet/provider/winnetwork.rb b/lib/puppet/provider/winnetwork.rb index fec5ec7..ba81e0b 100644 --- a/lib/puppet/provider/winnetwork.rb +++ b/lib/puppet/provider/winnetwork.rb @@ -46,7 +46,9 @@ def setgateways(adapter,gateways_hash={}) oMethod = adapter.Methods_("SetGateways") oInParam = oMethod.InParameters.SpawnInstance_() oInParam.DefaultIPGateway = gateways_hash[:defaultgateway] - oInParam.GatewayCostMetric = gateways_hash[:gwcostmetric].to_a + gwcms ||= Array.new + gwcms << gateways_hash[:gwcostmetric] + oInParam.GatewayCostMetric = gwcms oOutParam = adapter.ExecMethod_("SetGateways", oInParam) end @@ -94,4 +96,4 @@ def settcpipnetbios(adapter,netbios_hash={}) oInParam.TcpipNetbiosOptions = netbiosflag.to_s oOutParam = adapter.ExecMethod_("SetTCPIPNetBIOS", oInParam) end -end \ No newline at end of file +end diff --git a/lib/puppet/type/ipconfig.rb b/lib/puppet/type/ipconfig.rb index 66e3c0d..a5ed50f 100644 --- a/lib/puppet/type/ipconfig.rb +++ b/lib/puppet/type/ipconfig.rb @@ -29,7 +29,6 @@ def valid_v4?(addr) newproperty(:gwcostmetric) do desc 'Gateways cost metric' - defaultto 256 end newproperty(:dnsdomainsuffixsearchorder, :array_matching => :all) do @@ -59,4 +58,4 @@ def valid_v4?(addr) desc 'DNS Server List' end -end \ No newline at end of file +end