Method: Puppet::Module.find

Defined in:
lib/puppet/module.rb

.find(modname, environment = nil) ⇒ Object

Find and return the module that path belongs to. If path is absolute, or if there is no module whose name is the first component of path, return nil



36
37
38
39
40
41
42
# File 'lib/puppet/module.rb', line 36

def self.find(modname, environment = nil)
  return nil unless modname

  # Unless a specific environment is given, use the current environment
  env = environment ? Puppet.lookup(:environments).get!(environment) : Puppet.lookup(:current_environment)
  env.module(modname)
end