summaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2007-11-26 22:48:44 -0600
committerLuke Kanies <luke@madstop.com>2007-11-26 22:48:44 -0600
commit2d19ee2a0452baf75a23093e6fea3b743a5f0a69 (patch)
tree432ad1cce58865af122e8ff7d7ba46497430fdec /lib
parentc3dde683158863ae764684c5b7d958e39e905874 (diff)
downloadpuppet-2d19ee2a0452baf75a23093e6fea3b743a5f0a69.tar.gz
puppet-2d19ee2a0452baf75a23093e6fea3b743a5f0a69.tar.xz
puppet-2d19ee2a0452baf75a23093e6fea3b743a5f0a69.zip
Fixing #920 -- I have replaced the existing mount test with an
rspec version. It's not perfect, in that it only tests the :ensure state, but that's where 90% of the behaviour is.
Diffstat (limited to 'lib')
-rw-r--r--lib/puppet/property.rb2
-rwxr-xr-xlib/puppet/type/mount.rb19
2 files changed, 8 insertions, 13 deletions
diff --git a/lib/puppet/property.rb b/lib/puppet/property.rb
index f3d879ee2..fcaa19d48 100644
--- a/lib/puppet/property.rb
+++ b/lib/puppet/property.rb
@@ -158,7 +158,7 @@ class Property < Puppet::Parameter
def call_valuemethod(name, value)
event = nil
if method = self.class.value_option(name, :method) and self.respond_to?(method)
- self.debug "setting %s (currently %s)" % [value, self.retrieve]
+ #self.debug "setting %s (currently %s)" % [value, self.retrieve]
begin
event = self.send(method)
diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb
index 0ad879e4f..7ba411452 100755
--- a/lib/puppet/type/mount.rb
+++ b/lib/puppet/type/mount.rb
@@ -44,15 +44,12 @@ module Puppet
newvalue(:mounted, :event => :mount_mounted) do
# Create the mount point if it does not already exist.
current_value = self.retrieve
- if current_value.nil? or current_value == :absent
- provider.create
- end
+ provider.create if current_value.nil? or current_value == :absent
syncothers()
+
# The fs can be already mounted if it was absent but mounted
- unless provider.mounted?
- provider.mount
- end
+ provider.mount unless provider.mounted?
end
def retrieve
@@ -71,11 +68,11 @@ module Puppet
def syncothers
# We have to flush any changes to disk.
currentvalues = @resource.retrieve
+
+ # Determine if there are any out-of-sync properties.
oos = @resource.send(:properties).find_all do |prop|
unless currentvalues.include?(prop)
- raise Puppet::DevError,
- "Parent has property %s but it doesn't appear in the current vallues",
- [prop.name]
+ raise Puppet::DevError, "Parent has property %s but it doesn't appear in the current values", [prop.name]
end
if prop.name == :ensure
false
@@ -198,9 +195,7 @@ module Puppet
def refresh
# Only remount if we're supposed to be mounted.
- if ens = @parameters[:ensure] and ens.should == :mounted
- provider.remount
- end
+ provider.remount if provider.mounted?
end
def value(name)