Merge lp://staging/~thumper/juju-core/set-environment into lp://staging/~juju/juju-core/trunk
Status: | Merged |
---|---|
Merged at revision: | 1142 |
Proposed branch: | lp://staging/~thumper/juju-core/set-environment |
Merge into: | lp://staging/~juju/juju-core/trunk |
Prerequisite: | lp://staging/~thumper/juju-core/get-environment |
Diff against target: |
643 lines (+351/-65) 9 files modified
cmd/juju/environment.go (+75/-0) cmd/juju/environment_test.go (+93/-0) cmd/juju/main.go (+1/-0) cmd/juju/main_test.go (+2/-0) environs/config/config.go (+73/-41) environs/config/config_test.go (+92/-1) environs/dummy/environs.go (+5/-7) environs/ec2/config.go (+5/-8) environs/openstack/config.go (+5/-8) |
To merge this branch: | bzr merge lp://staging/~thumper/juju-core/set-environment |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Juju Engineering | Pending | ||
Review via email: mp+157986@code.staging.launchpad.net |
Description of the change
Implement 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.SetEnviro
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.
Reviewers: mp+157986_ code.launchpad. net,
Message:
Please take a look.
Description:
Implement 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, nConfig.
and then
validated using the provider Validate method. The resulting
configuration is
passed bach through to the state.SetEnviro
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: /code.launchpad .net/~thumper/ juju-core/ get-environment /+merge/ 157968
https:/
(do not edit description out of merge proposal)
Please review this at https:/ /codereview. appspot. com/8610043/
Affected files: environment. go environment_ test.go main_test. go config/ config. go config/ config_ test.go dummy/environs. go ec2/config. go openstack/ config. go
A [revision details]
M cmd/juju/
M cmd/juju/
M cmd/juju/main.go
M cmd/juju/
M environs/
M environs/
M environs/
M environs/
M environs/