summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-29 00:47:56 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2007-01-29 00:47:56 +0000
commit3aff4a0e9debfe22bd2a4b024b89410f481d09f7 (patch)
tree0ed07fa4b165118dd189cce04af4d0996c215f34 /lib
parent1cc8ecb0640420d6eb7a66fcb0d282337a263b84 (diff)
downloadpuppet-3aff4a0e9debfe22bd2a4b024b89410f481d09f7.tar.gz
puppet-3aff4a0e9debfe22bd2a4b024b89410f481d09f7.tar.xz
puppet-3aff4a0e9debfe22bd2a4b024b89410f481d09f7.zip
Doing more work on #113. Mostly, just making sure remounts do not happen spuriously very often. They will still have extra remounts when changing the value of "ensure", but that is not currently avoidable (similar to #199).
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@2109 980ebf18-57e1-0310-9a29-db15c13687c0
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/log.rb4
-rw-r--r--lib/puppet/parameter.rb9
-rw-r--r--lib/puppet/provider/mount.rb7
-rw-r--r--lib/puppet/transaction.rb10
-rwxr-xr-xlib/puppet/type/mount.rb12
5 files changed, 23 insertions, 19 deletions
diff --git a/lib/puppet/log.rb b/lib/puppet/log.rb
index 53535e90c..44b4352ce 100644
--- a/lib/puppet/log.rb
+++ b/lib/puppet/log.rb
@@ -517,7 +517,9 @@ module Puppet
# we retrieve any tags we can.
def source=(source)
# We can't store the actual source, we just store the path.
- if source.respond_to?(:path)
+ # We can't just check for whether it responds to :path, because
+ # plenty of providers respond to that in their normal function.
+ if source.is_a?(Puppet::Element) and source.respond_to?(:path)
@objectsource = true
@source = source.path
else
diff --git a/lib/puppet/parameter.rb b/lib/puppet/parameter.rb
index 78ee4ddf1..e480a06bd 100644
--- a/lib/puppet/parameter.rb
+++ b/lib/puppet/parameter.rb
@@ -287,15 +287,6 @@ module Puppet
# return the full path to us, for logging and rollback; not currently
# used
- def path
- unless defined? @path
- @path = pathbuilder
- end
- return @path.join("/")
- end
-
- # return the full path to us, for logging and rollback; not currently
- # used
def pathbuilder
if defined? @parent and @parent
return [@parent.pathbuilder, self.name]
diff --git a/lib/puppet/provider/mount.rb b/lib/puppet/provider/mount.rb
index bd8693e7d..103d1da0e 100644
--- a/lib/puppet/provider/mount.rb
+++ b/lib/puppet/provider/mount.rb
@@ -14,7 +14,12 @@ module Puppet::Provider::Mount
def remount
info "Remounting"
if @model[:remounts] == :true
- mountcmd "-o", "remount", @model[:name]
+ if Facter.value(:operatingsystem) == "FreeBSD"
+ # Thanks FreeBSD
+ mountcmd @model[:name]
+ else
+ mountcmd "-o", "remount", @model[:name]
+ end
else
unmount()
mount()
diff --git a/lib/puppet/transaction.rb b/lib/puppet/transaction.rb
index f3662ccfe..2240ca19f 100644
--- a/lib/puppet/transaction.rb
+++ b/lib/puppet/transaction.rb
@@ -84,10 +84,12 @@ class Transaction
resource.flush
end
- # And set a trigger for refreshing this resource if it's a self-refresher
- if resource.self_refresh?
- # Create an edge with this resource as both the source and target. The triggering
- # method treats these specially for logging.
+ # And set a trigger for refreshing this resource if it's a
+ # self-refresher
+ if resource.self_refresh? and ! resource.deleting?
+ # Create an edge with this resource as both the source and
+ # target. The triggering method treats these specially for
+ # logging.
set_trigger(Puppet::Relationship.new(resource, resource, :callback => :refresh, :event => :ALL_EVENTS))
end
end
diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb
index 4961e689a..df0beca6f 100755
--- a/lib/puppet/type/mount.rb
+++ b/lib/puppet/type/mount.rb
@@ -155,13 +155,14 @@ module Puppet
end
newparam(:remounts) do
- desc "Whether the mount can be remounted ``mount -o remount``. If this is false,
- then the filesystem will be unmounted and remounted manually, which is prone to failure."
+ desc "Whether the mount can be remounted ``mount -o remount``. If
+ this is false, then the filesystem will be unmounted and remounted
+ manually, which is prone to failure."
newvalues(:true, :false)
defaultto do
case Facter.value(:operatingsystem)
- when "Darwin": false
+ when "Darwin", "FreeBSD": false
else
true
end
@@ -173,7 +174,10 @@ module Puppet
on the value of the 'ensure' parameter."
def refresh
- provider.remount
+ # Only remount if we're supposed to be mounted.
+ if ens = @states[:ensure] and ens.should == :mounted
+ provider.remount
+ end
end
def value(name)