DescriptionImplement the set-environment command.
This change introduces a new command called set-environment. It has an alias
of set-env, and is the pair to get-environment.
Key/value pairs are taken on the command line as positional parameters.
The environment is retrieved from state, updated with the new values, and then
validated using the provider Validate method. The resulting configuration is
passed bach through to the state.SetEnvironConfig.
There are some standard config values that we really don't want
changing. These rules have been encoded in a new function config.Validate.
This is now called from each of the provider validate methods.
I added a non-exported helper method on Config to do the type coersion for
getting values from the known map. This is now used in many internal places.
Since the agent-version was always added in the config.New to be the default
value, I instead add this to the schema default values. The existing tests
make sure this still works as intended.
Added an extra test for backslashes in names. Moved the firewall-mode default
behaviour up into the base class, as it was identical in all three provider
validate methods.
https://code.launchpad.net/~thumper/juju-core/set-environment/+merge/157986
Requires: https://code.launchpad.net/~thumper/juju-core/get-environment/+merge/157968
(do not edit description out of merge proposal)
Patch Set 1 #
Total comments: 18
Patch Set 2 : Implement the set-environment command. #
Total comments: 4
Patch Set 3 : Implement the set-environment command. #
MessagesTotal messages: 6
|