diff options
author | Luke Kanies <luke@madstop.com> | 2009-05-14 11:36:20 -0500 |
---|---|---|
committer | James Turnbull <james@lovedthanlost.net> | 2009-05-15 10:01:26 +1000 |
commit | fb957ccb6636ce86bd98c141d5818c54bc0d4659 (patch) | |
tree | 4ee5fd0ddc1e09dbb72bc06e6fcfd0caeee04f38 /lib/puppet/node | |
parent | c6084093e67b1e415e49c192b3ac6f6b9aebc4ba (diff) | |
download | puppet-fb957ccb6636ce86bd98c141d5818c54bc0d4659.tar.gz puppet-fb957ccb6636ce86bd98c141d5818c54bc0d4659.tar.xz puppet-fb957ccb6636ce86bd98c141d5818c54bc0d4659.zip |
Modules now can find their own paths
Previously, when you created a module you had to specify
the path. Now Module instances can use the module path
to look up their paths, and there are methods for determining
whether the module is present (if the path is present).
Also cleaned up the methods for figuring out what's in
the module (plugins, etc.).
Signed-off-by: Luke Kanies <luke@madstop.com>
Diffstat (limited to 'lib/puppet/node')
-rw-r--r-- | lib/puppet/node/environment.rb | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb index 445439aa3..3d13af1f8 100644 --- a/lib/puppet/node/environment.rb +++ b/lib/puppet/node/environment.rb @@ -30,11 +30,9 @@ class Puppet::Node::Environment end def module(name) - Puppet::Module.each_module(modulepath) do |mod| - return mod if mod.name == name - end - - return nil + mod = Puppet::Module.new(name, self) + return nil unless mod.exist? + return mod end def modulepath |