summaryrefslogtreecommitdiffstats
path: root/lib/puppet
diff options
context:
space:
mode:
authorLuke Kanies <luke@madstop.com>2009-06-16 10:57:54 -0500
committerJames Turnbull <james@lovedthanlost.net>2009-06-19 03:54:07 +1000
commitfeb7f89078f038e20895ff2c8042326e6b85b957 (patch)
tree051fdcd5227565fb5c93d47f9ed451545c14c02e /lib/puppet
parentccf4e69b684e6620c457475c4da6a70975d52dd5 (diff)
downloadpuppet-feb7f89078f038e20895ff2c8042326e6b85b957.tar.gz
puppet-feb7f89078f038e20895ff2c8042326e6b85b957.tar.xz
puppet-feb7f89078f038e20895ff2c8042326e6b85b957.zip
Fixing #1064 - Deprecating module 'plugins' directories
You should now use 'lib' instead of 'plugins'. The old directory still works, but you get a warning for every module that uses it. Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet')
-rw-r--r--lib/puppet/module.rb13
1 files changed, 12 insertions, 1 deletions
diff --git a/lib/puppet/module.rb b/lib/puppet/module.rb
index a9f845d6a..38ff2bf55 100644
--- a/lib/puppet/module.rb
+++ b/lib/puppet/module.rb
@@ -126,6 +126,17 @@ class Puppet::Module
end
def subpath(type)
- File.join(path, type)
+ return File.join(path, type) unless type.to_s == "plugins"
+
+ return backward_compatible_plugins_dir
+ end
+
+ def backward_compatible_plugins_dir
+ if dir = File.join(path, "plugins") and FileTest.exist?(dir)
+ Puppet.warning "Module %s uses the deprecated 'plugins' directory for ruby extensions; please move to 'lib'" % name
+ return dir
+ else
+ return File.join(path, "lib")
+ end
end
end