From 48755b1e2f939d8c5f04310fa1eb8f7d2a595d36 Mon Sep 17 00:00:00 2001 From: luke Date: Wed, 18 Jul 2007 20:40:11 +0000 Subject: Fixing #702, hopefully. As suggested, I switched to "mount" instead of "df" to determine whether an fs is mounted. git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2707 980ebf18-57e1-0310-9a29-db15c13687c0 --- lib/puppet/provider/mount.rb | 14 ++++---------- lib/puppet/provider/mount/parsed.rb | 2 +- 2 files changed, 5 insertions(+), 11 deletions(-) (limited to 'lib/puppet') diff --git a/lib/puppet/provider/mount.rb b/lib/puppet/provider/mount.rb index d270261ec..89b769726 100644 --- a/lib/puppet/provider/mount.rb +++ b/lib/puppet/provider/mount.rb @@ -37,18 +37,12 @@ module Puppet::Provider::Mount # Is the mount currently mounted? def mounted? platform = Facter["operatingsystem"].value - df = [command(:df)] - case Facter["operatingsystem"].value - # Solaris's df prints in a very weird format - when "Solaris": df << "-k" - end - execute(df).split("\n").find do |line| - fs = line.split(/\s+/)[-1] + name = @resource[:name] + mounts = mountcmd.split("\n").find do |line| if platform == "Darwin" - fs == "/private/var/automount" + @resource[:name] or - fs == @resource[:name] + line =~ / on #{name} / or line =~ %r{ on /private/var/automount#{name}} else - fs == @resource[:name] + line =~ / on #{name} / end end end diff --git a/lib/puppet/provider/mount/parsed.rb b/lib/puppet/provider/mount/parsed.rb index 9f272bc40..fa4383eb2 100755 --- a/lib/puppet/provider/mount/parsed.rb +++ b/lib/puppet/provider/mount/parsed.rb @@ -16,7 +16,7 @@ Puppet::Type.type(:mount).provide(:parsed, include Puppet::Provider::Mount confine :exists => fstab - commands :mountcmd => "mount", :umount => "umount", :df => "df" + commands :mountcmd => "mount", :umount => "umount" @platform = Facter["operatingsystem"].value case @platform -- cgit