From fb957ccb6636ce86bd98c141d5818c54bc0d4659 Mon Sep 17 00:00:00 2001 From: Luke Kanies Date: Thu, 14 May 2009 11:36:20 -0500 Subject: 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 --- lib/puppet/node/environment.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'lib/puppet/node') 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 -- cgit