Initial Chef repository
This commit is contained in:
13
cookbooks/firewall/libraries/helpers.rb
Normal file
13
cookbooks/firewall/libraries/helpers.rb
Normal file
@@ -0,0 +1,13 @@
|
||||
module FirewallCookbook
|
||||
module Helpers
|
||||
def port_to_s(p)
|
||||
if p && p.is_a?(Integer)
|
||||
p.to_s
|
||||
elsif p && p.is_a?(Array)
|
||||
p.join(',')
|
||||
elsif p && p.is_a?(Range)
|
||||
"#{p.first}:#{p.last} "
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user