Document the current behaviour of Util::Firewall.host_to_ip before it is
modified to handle addresses with zero prefix lengths.
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