| When listing modules by path, puppet changes the current working directory unnecessarily. This was first reported in PUP-9997, but broken out here into a separate issue:
def modules_by_path |
modules_by_path = {} |
modulepath.each do |path| |
if Puppet::FileSystem.exist?(path) |
Dir.chdir(path) do |
module_names = Dir.entries(path).select do |name| |
Puppet::Module.is_module_directory?(name, path) |
end |
modules_by_path[path] = module_names.sort.map do |name| |
Puppet::Module.new(name, File.join(path, name), self) |
end |
end |
else |
modules_by_path[path] = [] |
end |
end |
modules_by_path |
end
|
|