From: Daniel Black Date: Mon, 23 Jan 2012 05:55:44 +0000 (+1100) Subject: (#10165) Display multi-value: port, sport, dport and state command seperated X-Git-Tag: 0.1.0~42^2 X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=f49754d3ce4b8b8d96046573b07bb36aec13de71;p=puppet-modules%2Fpuppetlabs-firewall.git (#10165) Display multi-value: port, sport, dport and state command seperated Previously the output that changed was munged when puppet was being ran, this change provides a comma seperated output when the values change instead. --- diff --git a/lib/puppet/type/firewall.rb b/lib/puppet/type/firewall.rb index 726edd6..f8cc358 100644 --- a/lib/puppet/type/firewall.rb +++ b/lib/puppet/type/firewall.rb @@ -128,6 +128,10 @@ Puppet::Type.newtype(:firewall) do @resource.string_to_port(value) end + def is_to_s(value) + should_to_s(value) + end + def should_to_s(value) value = [value] unless value.is_a?(Array) value.join(',') @@ -154,6 +158,10 @@ Puppet::Type.newtype(:firewall) do @resource.string_to_port(value) end + def is_to_s(value) + should_to_s(value) + end + def should_to_s(value) value = [value] unless value.is_a?(Array) value.join(',') @@ -180,6 +188,10 @@ Puppet::Type.newtype(:firewall) do @resource.string_to_port(value) end + def is_to_s(value) + should_to_s(value) + end + def should_to_s(value) value = [value] unless value.is_a?(Array) value.join(',') @@ -387,6 +399,10 @@ Puppet::Type.newtype(:firewall) do @should = super(values).sort end + def is_to_s(value) + should_to_s(value) + end + def should_to_s(value) value = [value] unless value.is_a?(Array) value.join(',')