[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, master, updated. debian/0.24.6-1-356-g5718585

James Turnbull james at lovedthanlost.net
Fri Jan 23 14:21:37 UTC 2009


The following commit has been merged in the master branch:
commit bf5be00f87a8df66964931939531399384142aff
Author: Brice Figureau <brice-puppet at daysofwonder.com>
Date:   Tue Nov 11 13:43:29 2008 +0100

    Fix #1737 - part2 - Fix display of "options"

diff --git a/lib/puppet/type/ssh_authorized_key.rb b/lib/puppet/type/ssh_authorized_key.rb
index 4afca1c..66cf3e7 100644
--- a/lib/puppet/type/ssh_authorized_key.rb
+++ b/lib/puppet/type/ssh_authorized_key.rb
@@ -38,6 +38,22 @@ module Puppet
                   should be specified as an array."
 
             defaultto do :absent end
+
+            def is_to_s(value)
+                if value == :absent or value.include?(:absent)
+                    super
+                else
+                    value.join(",")
+                end
+            end
+
+            def should_to_s(value)
+                if value == :absent or value.include?(:absent)
+                    super
+                else
+                    value.join(",")
+                end
+            end
         end
 
         autorequire(:user) do
diff --git a/spec/unit/type/ssh_authorized_key.rb b/spec/unit/type/ssh_authorized_key.rb
index e214784..2cd5171 100755
--- a/spec/unit/type/ssh_authorized_key.rb
+++ b/spec/unit/type/ssh_authorized_key.rb
@@ -73,6 +73,18 @@ describe ssh_authorized_key do
         @class.attrtype(:options).should == :property
     end
 
+    it "'s options property should return well formed string of arrays from is_to_s" do
+        resource = @class.create(:name => "whev", :type => :rsa, :user => "nobody", :options => ["a","b","c"])
+
+        resource.property(:options).is_to_s(["a","b","c"]).should == "a,b,c"
+    end
+
+    it "'s options property should return well formed string of arrays from is_to_s" do
+        resource = @class.create(:name => "whev", :type => :rsa, :user => "nobody", :options => ["a","b","c"])
+
+        resource.property(:options).should_to_s(["a","b","c"]).should == "a,b,c"
+    end
+
     it "should have a target property" do
         @class.attrtype(:target).should == :property
     end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list