[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:33 UTC 2009


The following commit has been merged in the master branch:
commit 4806c51d309e43d0adc45d743a0ea85c3dc2da0d
Author: Luke Kanies <luke at madstop.com>
Date:   Tue Oct 28 19:13:45 2008 -0500

    Fixing #1669 - The dump parameter can now be changed on mounts.
    
    Signed-off-by: Luke Kanies <luke at madstop.com>

diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb
index 1679b73..4eb1494 100755
--- a/lib/puppet/type/mount.rb
+++ b/lib/puppet/type/mount.rb
@@ -143,7 +143,7 @@ module Puppet
             desc "Whether to dump the mount.  Not all platforms
                 support this. Valid values are ``1`` or ``0``. Default is ``0``."
 
-             newvalue(%r{(0|1)}) { }
+             newvalue(%r{(0|1)})
 
             defaultto {
                 if @resource.managed?
diff --git a/spec/unit/type/mount.rb b/spec/unit/type/mount.rb
index a9b7867..0a1ccae 100755
--- a/spec/unit/type/mount.rb
+++ b/spec/unit/type/mount.rb
@@ -188,3 +188,32 @@ describe Puppet::Type.type(:mount)::Ensure do
         end
     end
 end
+
+describe Puppet::Type.type(:mount), "when modifying an existing mount entry" do
+    before do
+        @provider = stub 'provider', :class => Puppet::Type.type(:mount).defaultprovider, :clear => nil, :satisfies? => true, :name => :mock, :remount => nil
+        Puppet::Type.type(:mount).defaultprovider.stubs(:new).returns(@provider)
+        @mount = Puppet::Type.type(:mount).create(:name => "yay", :ensure => :mounted)
+
+        {:device => "/foo/bar", :blockdevice => "/other/bar", :target => "/what/ever", :fstype => 'eh', :options => "", :pass => 0, :dump => 0, :atboot => 0,
+            :ensure => :mounted}.each do
+            |param, value|
+            @mount.provider.stubs(param).returns value
+            @mount[param] = value
+        end
+
+        @mount.provider.stubs(:mounted?).returns true
+
+        @catalog = Puppet::Node::Catalog.new
+        @catalog.add_resource @mount
+    end
+
+    it "should use the provider to change the dump value" do
+        @mount.provider.expects(:dump).returns 0
+        @mount.provider.expects(:dump=).with(1)
+
+        @mount[:dump] = 1
+
+        @catalog.apply
+    end
+end

-- 
Puppet packaging for Debian



More information about the Pkg-puppet-devel mailing list