]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commit
(#10723) Munge hostnames and IPs to IPs with CIDR
authorJonathan Boyett <jonathan@failingservers.com>
Thu, 17 Nov 2011 17:43:19 +0000 (09:43 -0800)
committerKen Barber <ken@bob.sh>
Sat, 3 Dec 2011 20:51:09 +0000 (20:51 +0000)
commit4526c1eb19a7e436c1aa5de17be3ab8f195050d3
treeb802a0a694f0bf6855c8c199e2c4566d05be899e
parentde8ebf9364e1f720e4221f13fd3c2a860244a054
(#10723) Munge hostnames and IPs to IPs with CIDR

Previously when hostnames were used in the source and destination properties
they were being converted to IP address by iptables. This meant that later
comparisons were failing because the property in code (a hostname) and the
'real' property returned by introspection (an ip address) were not matching.

This code using the munge facility will automatically detect and convert
hostnames to IP addresses in the type so the comparison works as expected.

The side-effect is that puppet does the hostname to IP conversion, not
iptables.
lib/puppet/type/firewall.rb
lib/puppet/util/firewall.rb
spec/fixtures/iptables/conversion_hash.rb
spec/unit/puppet/type/firewall_spec.rb
spec/unit/puppet/util/firewall_spec.rb [new file with mode: 0644]
spec/unit/puppet/util/ipcidr_spec.rb [new file with mode: 0644]