summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-16 21:47:50 +0000
committerluke <luke@980ebf18-57e1-0310-9a29-db15c13687c0>2006-11-16 21:47:50 +0000
commit185ba8cc77bb90ac566ed2b6fe9132ae5c78d378 (patch)
tree7b12b785b0f951ea3b5432f11e40c74fc8e22b0b
parent5f5417aada66f65d9aeb924f64aebb28077286cf (diff)
downloadpuppet-185ba8cc77bb90ac566ed2b6fe9132ae5c78d378.tar.gz
puppet-185ba8cc77bb90ac566ed2b6fe9132ae5c78d378.tar.xz
puppet-185ba8cc77bb90ac566ed2b6fe9132ae5c78d378.zip
Fixing backwards compatibility in mounts -- they were not correctly copying the path over to the name
git-svn-id: https://reductivelabs.com/svn/puppet/trunk@1888 980ebf18-57e1-0310-9a29-db15c13687c0
-rw-r--r--lib/puppet/provider/mount.rb2
-rwxr-xr-xlib/puppet/type/mount.rb2
-rwxr-xr-xtest/types/mount.rb29
3 files changed, 26 insertions, 7 deletions
diff --git a/lib/puppet/provider/mount.rb b/lib/puppet/provider/mount.rb
index d3597ef15..d1ba79c7c 100644
--- a/lib/puppet/provider/mount.rb
+++ b/lib/puppet/provider/mount.rb
@@ -36,4 +36,4 @@ module Puppet::Provider::Mount
end
end
-# $Id$ \ No newline at end of file
+# $Id$
diff --git a/lib/puppet/type/mount.rb b/lib/puppet/type/mount.rb
index 4ec6d3516..884b86c00 100755
--- a/lib/puppet/type/mount.rb
+++ b/lib/puppet/type/mount.rb
@@ -133,7 +133,7 @@ module Puppet
newparam(:path) do
desc "The deprecated name for the mount point. Please use ``name`` now."
- def should=(value)
+ def value=(value)
warning "'path' is deprecated for mounts. Please use 'name'."
@parent[:name] = value
super
diff --git a/test/types/mount.rb b/test/types/mount.rb
index 8b8cf9ab5..1134b664a 100755
--- a/test/types/mount.rb
+++ b/test/types/mount.rb
@@ -76,6 +76,14 @@ class TestMounts < Test::Unit::TestCase
def mkmount
mount = nil
+ assert_nothing_raised {
+ mount = Puppet.type(:mount).create(mkmount_args)
+ }
+
+ return mount
+ end
+
+ def mkmount_args
if defined? @pcount
@pcount += 1
else
@@ -95,11 +103,7 @@ class TestMounts < Test::Unit::TestCase
end
end
- assert_nothing_raised {
- mount = Puppet.type(:mount).create(args)
- }
-
- return mount
+ return args
end
def test_simplemount
@@ -223,6 +227,21 @@ class TestMounts < Test::Unit::TestCase
"Mount was not actually removed")
end
end
+
+ # Make sure that the name gets correctly set if they set the path,
+ # which used to be the namevar.
+ def test_name_and_path
+ mount = nil
+ args = mkmount_args
+ args[:name] = "mount_name"
+ args[:path] = "mount_path"
+
+ assert_nothing_raised do
+ mount = @mount.create(args)
+ end
+
+ assert_equal("mount_path", mount[:name], "Name did not get copied over")
+ end
end
# $Id$