]> review.fuel-infra Code Review - puppet-modules/puppetlabs-firewall.git/commitdiff
(#10165) Display multi-value: port, sport, dport and state command seperated
authorDaniel Black <daniel.black@openquery.com>
Mon, 23 Jan 2012 05:55:44 +0000 (16:55 +1100)
committerKen Barber <ken@bob.sh>
Mon, 23 Jan 2012 17:05:07 +0000 (17:05 +0000)
Previously the output that changed was munged when puppet was being ran, this
change provides a comma seperated output when the values change instead.

lib/puppet/type/firewall.rb

index 726edd655317f5f9fc9479f0f8be35836b4d08fb..f8cc35832fa841bdab20e1f93dd7deef5a788700 100644 (file)
@@ -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(',')