From 43ba6814e8fa35d040768561ce91e105cd64268f Mon Sep 17 00:00:00 2001 From: Dan Carley Date: Fri, 25 May 2012 10:24:39 +0100 Subject: [PATCH] (#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. --- lib/puppet/util/firewall.rb | 15 +++++++++++++++ 1 file changed, 15 insertions(+) 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 -- 2.45.2