Merge "Puppet4 support: l23network fixes"

This commit is contained in:
Jenkins 2016-09-01 11:40:55 +00:00 committed by Gerrit Code Review
commit 25b362b004
2 changed files with 5 additions and 4 deletions

View File

@ -14,7 +14,7 @@ Puppet::Type.newtype(:l3_clear_route) do
newproperty(:destination) do
desc "Destination network"
validate do |val|
val.strip!
val = val.strip
if val.to_s.downcase != 'default'
raise ArgumentError, "Invalid IP address: '#{val}'" if \
not val.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})(\/(\d{1,2}))?$/) \
@ -61,7 +61,7 @@ Puppet::Type.newtype(:l3_clear_route) do
newvalues(/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/)
validate do |val|
# gateway can't be "absent" by design
val.strip!
val = val.strip
raise ArgumentError, "Invalid gateway: '#{val}'" if \
not val.match(/^(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) \
or not ($1.to_i >= 0 and $1.to_i <= 255) \

View File

@ -9,7 +9,8 @@ EOS
return
end
nics = argv[0]
return nics.to_json
nic_whitelist = argv[0]
return nil unless nic_whitelist
nic_whitelist.to_json
end