Skip to content

Commit

Permalink
fix gwcm
Browse files Browse the repository at this point in the history
  • Loading branch information
rismoney committed Aug 25, 2014
1 parent d97af03 commit 933a2b8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/puppet/provider/ipconfig/ipconfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -232,4 +232,4 @@ def destroy
netconnectionid.enabledhcp()
end
end
end
end
6 changes: 4 additions & 2 deletions lib/puppet/provider/winnetwork.rb
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down Expand Up @@ -94,4 +96,4 @@ def settcpipnetbios(adapter,netbios_hash={})
oInParam.TcpipNetbiosOptions = netbiosflag.to_s
oOutParam = adapter.ExecMethod_("SetTCPIPNetBIOS", oInParam)
end
end
end
3 changes: 1 addition & 2 deletions lib/puppet/type/ipconfig.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ def valid_v4?(addr)

newproperty(:gwcostmetric) do
desc 'Gateways cost metric'
defaultto 256
end

newproperty(:dnsdomainsuffixsearchorder, :array_matching => :all) do
Expand Down Expand Up @@ -59,4 +58,4 @@ def valid_v4?(addr)
desc 'DNS Server List'
end

end
end

0 comments on commit 933a2b8

Please sign in to comment.