Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

(PUP-5032) Change configured_environment behavior #4152

Closed

Conversation

MikaelSmith
Copy link
Contributor

Puppet's communication with the node and catalog terminus included a
configured_environment option in the last release. That option sometimes
includes redundant or irrelevant information when Puppet[:environment]
has the default setting. That redundant information precludes it from
being used to identify when an agent has explicitly requested a
particular environment.

Change the behavior of configured_environment to only be set when the
environment setting is explicitly set.

@MikaelSmith
Copy link
Contributor Author

/cc @pcarlisle @reidmv

@reidmv
Copy link
Contributor

reidmv commented Aug 12, 2015

👍

@MikaelSmith MikaelSmith changed the title (tbd) Change configured_environment behavior (PUP-5032) Change configured_environment behavior Aug 12, 2015
Puppet's communication with the node and catalog terminus included a
configured_environment option in the last release. That option sometimes
includes redundant or irrelevant information when `Puppet[:environment]`
has the default setting. That redundant information precludes it from
being used to identify when an agent has explicitly requested a
particular environment.

Change the behavior of configured_environment to only be set when the
`environment` setting is explicitly set.
expect(@settings.set_by_config?(:myval)).to be_truthy
end

it "should not identify configured settings from environment" do
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This one's interesting, but made sense for the methods use in setting agent_specified_environment. We wouldn't expect the environment.conf to specify an environment.

In general, it would make sense to extend set_by_config? to take an environment argument as an option.

Michael Smith added 2 commits August 12, 2015 15:54
When `set_by_config?` was implemented, spec tests for its functionality
were overlooked. Add some now.
Without this change, `set_by_config?` will ignore settings in the
current environment's config file and only examines the preferred run
mode. With this change, it allows environment and run_mode to be
specified as arguments.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants