Skip to content

Commit c1b78a1

Browse files
author
John Noss
committed
add mtu property for onevnet type/provider
this allows to set MTU when creating a vnet
1 parent a23d248 commit c1b78a1

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

lib/puppet/provider/onevnet/cli.rb

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ def create
3737
xml.GATEWAY resource[:gateway] if resource[:gateway]
3838
xml.NETWORK_MASK resource[:netmask] if resource[:netmask]
3939
xml.NETWORK_ADDRESS resource[:network_address] if resource[:network_address]
40+
xml.MTU resource[:mtu] if resource[:mtu]
4041
xml.CONTEXT resource[:context].each { |k, v| xml.send(k.upcase, v) } if resource[:context]
4142
end
4243
end
@@ -75,6 +76,7 @@ def self.instances
7576
:gateway => (vnet.xpath('./TEMPLATE/GATEWAY').text unless vnet.xpath('./TEMPLATE/GATEWAY').nil?),
7677
:netmask => (vnet.xpath('./TEMPLATE/NETWORK_MASK').text unless vnet.xpath('./TEMPLATE/NETWORK_MASK').nil?),
7778
:network_address => (vnet.xpath('./TEMPLATE/NETWORK_ADDRESS').text unless vnet.xpath('./TEMPLATE/NETWORK_ADDRESS').nil?),
79+
:mtu => (vnet.xpath('./TEMPLATE/MTU').text unless vnet.xpath('./TEMPLATE/MTU').nil?),
7880
:model => (vnet.xpath('./TEMPLATE/MODEL').text unless vnet.xpath('./TEMPLATE/MODEL').nil?)
7981
)
8082
end

lib/puppet/type/onevnet.rb

+4
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@
5757
desc "Gateway for network"
5858
end
5959

60+
newproperty(:mtu) do
61+
desc "MTU for network"
62+
end
63+
6064
newproperty(:context) do
6165
desc "A hash of context information to also store in the template."
6266
end

0 commit comments

Comments
 (0)