Skip to content

Commit 933a2b8

Browse files
committed
fix gwcm
1 parent d97af03 commit 933a2b8

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

lib/puppet/provider/ipconfig/ipconfig.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,7 +125,7 @@ def defaultgateway= newvalue
125125

126126
def gwcostmetric
127127
enum_netconn do |netconnectionid|
128-
gwcm=netconnectionid.gatewaycostmetric.to_s
128+
gwcm=(netconnectionid.gatewaycostmetric).join(',')
129129
return gwcm
130130
end
131131
end
@@ -232,4 +232,4 @@ def destroy
232232
netconnectionid.enabledhcp()
233233
end
234234
end
235-
end
235+
end

lib/puppet/provider/winnetwork.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,9 @@ def setgateways(adapter,gateways_hash={})
4646
oMethod = adapter.Methods_("SetGateways")
4747
oInParam = oMethod.InParameters.SpawnInstance_()
4848
oInParam.DefaultIPGateway = gateways_hash[:defaultgateway]
49-
oInParam.GatewayCostMetric = gateways_hash[:gwcostmetric].to_a
49+
gwcms ||= Array.new
50+
gwcms << gateways_hash[:gwcostmetric]
51+
oInParam.GatewayCostMetric = gwcms
5052
oOutParam = adapter.ExecMethod_("SetGateways", oInParam)
5153
end
5254

@@ -94,4 +96,4 @@ def settcpipnetbios(adapter,netbios_hash={})
9496
oInParam.TcpipNetbiosOptions = netbiosflag.to_s
9597
oOutParam = adapter.ExecMethod_("SetTCPIPNetBIOS", oInParam)
9698
end
97-
end
99+
end

lib/puppet/type/ipconfig.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ def valid_v4?(addr)
2929

3030
newproperty(:gwcostmetric) do
3131
desc 'Gateways cost metric'
32-
defaultto 256
3332
end
3433

3534
newproperty(:dnsdomainsuffixsearchorder, :array_matching => :all) do
@@ -59,4 +58,4 @@ def valid_v4?(addr)
5958
desc 'DNS Server List'
6059
end
6160

62-
end
61+
end

0 commit comments

Comments
 (0)