Jira (PUP-11166) Don't change current working directory when listing modules

19 views
Skip to first unread message

Josh Cooper (Jira)

unread,
Jul 8, 2021, 7:55:03 PM7/8/21
to puppe...@googlegroups.com
Josh Cooper created an issue
 
Puppet / Bug PUP-11166
Don't change current working directory when listing modules
Issue Type: Bug Bug
Assignee: Unassigned
Created: 2021/07/08 4:54 PM
Priority: Normal Normal
Reporter: Josh Cooper

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

Add Comment Add Comment
 
This message was sent by Atlassian Jira (v8.13.2#813002-sha1:c495a97)
Atlassian logo

Josh Cooper (Jira)

unread,
Jul 8, 2021, 7:56:02 PM7/8/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jul 8, 2021, 8:19:01 PM7/8/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Sprint: Platform Core KANBAN

Andy Troup (Jira)

unread,
Jul 13, 2021, 6:55:04 AM7/13/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jul 15, 2021, 2:00:06 PM7/15/21
to puppe...@googlegroups.com

Heather McDonough (Jira)

unread,
Jul 15, 2021, 2:51:02 PM7/15/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jul 15, 2021, 7:54:04 PM7/15/21
to puppe...@googlegroups.com

Josh Cooper (Jira)

unread,
Jul 15, 2021, 7:55:02 PM7/15/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
 
Change By: Josh Cooper
Release Notes: Bug Fix
Release Notes Summary: Puppet server and agent no longer change their current working directories when listing modules in an environment directory.

Josh Cooper (Jira)

unread,
Jul 15, 2021, 7:55:04 PM7/15/21
to puppe...@googlegroups.com
Josh Cooper updated an issue
Change By: Josh Cooper
Fix Version/s: PUP 7.10.0
Fix Version/s: PUP 6.25.0

Josh Cooper (Jira)

unread,
Jul 20, 2021, 2:03:04 AM7/20/21
to puppe...@googlegroups.com
Josh Cooper commented on Bug PUP-11166
 
Re: Don't change current working directory when listing modules

Passed CI in b6e983bef76b7d6825c30da3a812de7d5c998d4e

Claire Cadman (Jira)

unread,
Aug 11, 2021, 9:03:02 AM8/11/21
to puppe...@googlegroups.com
Reply all
Reply to author
Forward
0 new messages