puppet-tripleo/lib/puppet/functions/add_brackets.rb
Janki Chhatbar 66292a5886 Add support for ODL-OVS IPv6 deployment
Make necessary changes for proper deployment
of ODL on IPv6 network.

Change-Id: Id7a0986f886a81b2041987b0d5a95edf2160e05e
Depends-On: Idd257cf4666b853eb4c52861f9f400b6dbdeeadb
Partial-Bug: #1783196
2018-08-24 09:30:37 +05:30

15 lines
277 B
Ruby

Puppet::Functions.create_function(:add_brackets) do
dispatch :add_brackets do
param 'String', :odl_ip
end
def add_brackets(odl_ip)
if odl_ip =~ /\[.*\]/
return odl_ip
else
bracketed_ip = "[#{odl_ip}]"
return bracketed_ip
end
end
end