From: Dan Carley Date: Fri, 25 May 2012 09:24:39 +0000 (+0100) Subject: (#10274) Document Util::Firewall.host_to_ip X-Git-Tag: 0.1.0~30^2~1 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=43ba6814e8fa35d040768561ce91e105cd64268f;p=puppet-modules%2Fpuppetlabs-firewall.git (#10274) Document Util::Firewall.host_to_ip Document the current behaviour of Util::Firewall.host_to_ip before it is modified to handle addresses with zero prefix lengths. --- diff --git a/lib/puppet/util/firewall.rb b/lib/puppet/util/firewall.rb index f376fc2..21e394d 100644 --- a/lib/puppet/util/firewall.rb +++ b/lib/puppet/util/firewall.rb @@ -69,6 +69,21 @@ module Puppet::Util::Firewall end end + # Takes an address and returns it in CIDR notation. + # + # If the address is: + # + # - A hostname: + # It will be resolved + # - An IPv4 address: + # It will be qualified with a /32 CIDR notation + # - An IPv6 address: + # It will be qualified with a /128 CIDR notation + # - An IP address with a CIDR notation: + # It will be normalised + # - An IP address with a dotted-quad netmask: + # It will be converted to CIDR notation + # def host_to_ip(value) begin Puppet::Util::IPCidr.new(value).cidr