[Pkg-puppet-devel] [SCM] Puppet packaging for Debian branch, experimental, updated. debian/2.6.8-1-844-g7ec39d5
Jesse Wolfe
jes5199 at gmail.com
Tue May 10 08:01:02 UTC 2011
The following commit has been merged in the experimental branch:
commit 6f1416d7a4cec92ccff64d904d5fe799b8ff9a85
Author: Jesse Wolfe <jes5199 at gmail.com>
Date: Thu Nov 11 11:14:02 2010 -0800
Fix #4904 Mounts shouldn't remount unless they are ensure=>mounted
After we fixed issue #2730, it is now possible to manage an fstab entry
without asking puppet to try to call mount or unmount on that device.
That fix failed to address the "refresh" behavior of mounts.
We have changed "refresh" to only remount devices that are set to
"mounted", so users can truly manage fstab entries without having
puppet try to remount them.
Paired-With: Paul Berry <paul at puppetlabs.com>
diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb
index d048c90..e8c6b32 100755
--- a/lib/puppet/type/mount.rb
+++ b/lib/puppet/type/mount.rb
@@ -210,7 +210,7 @@ module Puppet
def refresh
# Only remount if we're supposed to be mounted.
- provider.remount if self.should(:fstype) != "swap" and provider.mounted?
+ provider.remount if self.should(:fstype) != "swap" and self.should(:ensure) == :mounted
end
def value(name)
diff --git a/spec/unit/type/mount_spec.rb b/spec/unit/type/mount_spec.rb
index ce82cb5..4aa9baf 100755
--- a/spec/unit/type/mount_spec.rb
+++ b/spec/unit/type/mount_spec.rb
@@ -203,23 +203,45 @@ describe Puppet::Type.type(:mount)::Ensure do
end
end
- describe Puppet::Type.type(:mount), "when responding to events" do
+ describe Puppet::Type.type(:mount), "when responding to refresh" do
- it "should remount if it is currently mounted" do
- @provider.expects(:mounted?).returns(true)
+ it "should remount if it is supposed to be mounted" do
+ @mount[:ensure] = "mounted"
@provider.expects(:remount)
@mount.refresh
end
- it "should not remount if it is not currently mounted" do
- @provider.expects(:mounted?).returns(false)
+ it "should not remount if it is supposed to be present" do
+ @mount[:ensure] = "present"
+ @provider.expects(:remount).never
+
+ @mount.refresh
+ end
+
+ it "should not remount if it is supposed to be absent" do
+ @mount[:ensure] = "absent"
+ @provider.expects(:remount).never
+
+ @mount.refresh
+ end
+
+ it "should not remount if it is supposed to be defined" do
+ @mount[:ensure] = "defined"
+ @provider.expects(:remount).never
+
+ @mount.refresh
+ end
+
+ it "should not remount if it is supposed to be unmounted" do
+ @mount[:ensure] = "unmounted"
@provider.expects(:remount).never
@mount.refresh
end
it "should not remount swap filesystems" do
+ @mount[:ensure] = "mounted"
@mount[:fstype] = "swap"
@provider.expects(:remount).never
--
Puppet packaging for Debian
More information about the Pkg-puppet-devel
mailing list