diff options
| author | Luke Kanies <luke@madstop.com> | 2009-08-18 16:00:21 -0700 |
|---|---|---|
| committer | Luke Kanies <luke@madstop.com> | 2009-08-18 16:00:21 -0700 |
| commit | e408d6c7d562f126df97cd57e04fd7802bc53390 (patch) | |
| tree | 238498ac559a381e879eb02035f6fa2e465b0b57 /lib/puppet/node | |
| parent | 796ba5c4ccec117bbc4dec69c670337e70b48634 (diff) | |
| download | puppet-e408d6c7d562f126df97cd57e04fd7802bc53390.tar.gz puppet-e408d6c7d562f126df97cd57e04fd7802bc53390.tar.xz puppet-e408d6c7d562f126df97cd57e04fd7802bc53390.zip | |
Refactoring the Module/Environment co-interface
This simplifies who owns what code in these two classes,
and the result should be much cleaner and simpler.
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, 2 insertions, 6 deletions
diff --git a/lib/puppet/node/environment.rb b/lib/puppet/node/environment.rb index 323f2793a..133f22c77 100644 --- a/lib/puppet/node/environment.rb +++ b/lib/puppet/node/environment.rb @@ -69,12 +69,8 @@ class Puppet::Node::Environment # Return all modules from this environment. # Cache the list, because it can be expensive to create. cached_attr(:modules, :ttl => Puppet[:filetimeout]) do - result = [] - Puppet::Module.each_module(modulepath) do |mod| - mod.environment = self - result << mod - end - result + module_names = modulepath.collect { |path| Dir.entries(path) }.flatten.uniq + module_names.collect { |path| Puppet::Module.new(path, self) rescue nil }.compact end def to_s |
