summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-04-30 15:28:37 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-04-30 15:28:37 +0000
commit63e907c0555499e6a695944c1c4fc5b9d6bd17f0 (patch)
tree2d7adfa9edd10bc5051afaa89ed0248ebf85936e /lib
parentdad93738dda74a1ba6f2fab09661eed7540a9417 (diff)
downloadpuppet-63e907c0555499e6a695944c1c4fc5b9d6bd17f0.tar.gz
puppet-63e907c0555499e6a695944c1c4fc5b9d6bd17f0.tar.xz
puppet-63e907c0555499e6a695944c1c4fc5b9d6bd17f0.zip
Switching the mount command to always add the mount options, so that the parsed provider can be used even in cases where /etc/fstab is ignored, like it is on OS X.
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2431 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/provider/mount.rb28
1 files changed, 20 insertions, 8 deletions
diff --git a/lib/puppet/provider/mount.rb b/lib/puppet/provider/mount.rb
index 103d1da0e..b5144e42e 100644
--- a/lib/puppet/provider/mount.rb
+++ b/lib/puppet/provider/mount.rb
@@ -7,19 +7,31 @@ require 'puppet'
# still need to add the mount commands manually.
module Puppet::Provider::Mount
# This only works when the mount point is synced to the fstab.
- def mount
- mountcmd @model[:name]
+ def mount(remount = false)
+ # Manually pass the mount options in, since some OSes *cough*OS X*cough* don't
+ # read from /etc/fstab but still want to use this type.
+ opts = nil
+ if self.options and self.options != :absent
+ opts = self.options
+ end
+
+ if remount and Facter.value(:operatingsystem) != "FreeBSD"
+ if opts
+ opts = [opts, "remount"].join(",")
+ else
+ opts = "remount"
+ end
+ end
+ args = []
+ args << "-o" << opts
+ args << @model[:name]
+ mountcmd(*args)
end
def remount
info "Remounting"
if @model[:remounts] == :true
- if Facter.value(:operatingsystem) == "FreeBSD"
- # Thanks FreeBSD
- mountcmd @model[:name]
- else
- mountcmd "-o", "remount", @model[:name]
- end
+ mount(true)
else
unmount()
mount()