Skip to content

Commit

Permalink
(maint) Only resolve environment dirs if versioned dirs are enabled
Browse files Browse the repository at this point in the history
The previous implementation would not set the resolved_path variable of
an environment to the actual resolved path unless the
"report_configured_environment" was set to false. This should not matter
since the externalize_path method will check the
"report_configured_environment" setting.

The implementation should probably either always set the resolved_path
to the resolved path, or only set it if "versioned_environment_dirs" is
true. This patch sets it only if the "versioned_environment_dirs" setting
is true.
  • Loading branch information
justinstoller committed Oct 23, 2023
1 parent 813909f commit 70b4c72
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions lib/puppet/environments.rb
Original file line number Diff line number Diff line change
Expand Up @@ -246,10 +246,8 @@ def create_environment(name)

configured_path = File.join(@environment_dir, name.to_s)
env.configured_path = configured_path
if Puppet.settings[:report_configured_environmentpath]
if Puppet.settings[:versioned_environment_dirs]
env.resolved_path = validated_directory(configured_path)
else
env.resolved_path = configured_path
end

env
Expand Down

0 comments on commit 70b4c72

Please sign in to comment.