diff options
author | Paul Berry <paul@puppetlabs.com> | 2011-03-08 11:35:58 -0800 |
---|---|---|
committer | Paul Berry <paul@puppetlabs.com> | 2011-03-08 13:04:39 -0800 |
commit | 5ef10315705b8e4d69d13b8df86b9585f2bcc29a (patch) | |
tree | 049e9d8343d023c7eea67103ce60d9bef9879960 /spec/integration | |
parent | bd5517dd9cd8e10f488713d9654957746e687378 (diff) | |
download | puppet-5ef10315705b8e4d69d13b8df86b9585f2bcc29a.tar.gz puppet-5ef10315705b8e4d69d13b8df86b9585f2bcc29a.tar.xz puppet-5ef10315705b8e4d69d13b8df86b9585f2bcc29a.zip |
(#6632) Adding a new mount no longer causes error with umount
There were two problems:
* In lib/puppet/type/mount.rb, we were calling provider.mounted? to
determine whether we needed to execute "mount" after updating the
in-memory fstab record. This wasn't working properly because
provider.mounted? makes its decision based on the data stored in the
in-memory fstab record. Since the fstab record had just been
updated, provider.mounted? was incorrectly returning true even
though the device wasn't actually mounted. Fixed this by checking
provider.mounted? before updating the in-memory fstab record.
* Calling mount from this point in lib/puppet/type/mount.rb is
actually too early, because even though the in-memory fstab record
has been created, its contents have not been written to `/etc/fstab`
yet. Fixed this by storing a :needs_mount entry in the
property_hash and checking it at the end of the flush() method.
Reviewed-by: Jacob Helwig <jacob@puppetlabs.com>
Diffstat (limited to 'spec/integration')
-rw-r--r-- | spec/integration/provider/mount_spec.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/spec/integration/provider/mount_spec.rb b/spec/integration/provider/mount_spec.rb index c28707dd9..518b2956f 100644 --- a/spec/integration/provider/mount_spec.rb +++ b/spec/integration/provider/mount_spec.rb @@ -35,6 +35,7 @@ describe "mount provider (integration)" do fail "unexpected umount" unless @umount_permitted command.length.should == 2 command[1].should == '/Volumes/foo_disk' + @mounted.should == true # "umount" doesn't work when device not mounted (see #6632) @mounted = false '' else @@ -77,7 +78,7 @@ describe "mount provider (integration)" do it "should be able to create and mount a brand new mount point" do @mounted = false - @umount_permitted = true # Work around bug #6632 + @umount_permitted = true # Work around bug #6633 run_in_catalog(:mounted) @mounted.should == true check_fstab |