model-config can read values from a file #7520

Merged
merged 1 commit into from Jun 21, 2017

Conversation

Projects
None yet
3 participants
Owner

wallyworld commented Jun 20, 2017

Description of change

model-config and model-defaults can now read values from a config.yaml file in addition to key=value args. Any grouping may be used, and last one wins. This is similar to how bootstrap works with its --config args except here there's no --config component. eg

$ juju model-config myconfig.yaml
$ juju model-config http-proxy=someproxy myconfig.yaml

QA steps

juju bootstrap
create a config.yaml
juju model-config path/to/config.yaml
etc

Documentation changes

Doc for model-config and model-defaults commands needs updating.

Bug reference

https://bugs.launchpad.net/juju/+bug/1647758

- logger.Warningf("key %q is not defined in the current model configuration: possible misspelling", key)
+ var keys []string
+ values := make(attributes)
+ for k, v := range attrs {
@howbazaar

howbazaar Jun 21, 2017

Owner

Have we lost the misspelling warning?

@wallyworld

wallyworld Jun 21, 2017

Owner

attrs is used all over juju (1557 according to my count)

@@ -34,15 +34,7 @@ func (s *ConfigCommandSuite) TestInit(c *gc.C) {
errorMatch string
nilErr bool
}{
- { // Test set
@howbazaar

howbazaar Jun 21, 2017

Owner

Have we lost the duplicate checks?

@wallyworld

wallyworld Jun 21, 2017

Owner

Yes because as per PR description, we now use the same --config processing as for bootstrap where an attribute may be specified more than once and last one wins. This allows a file to be used and then you can override just one or two values from that file with extra --config etc.

Owner

wallyworld commented Jun 21, 2017

$$merge$$

Contributor

jujubot commented Jun 21, 2017

Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju

@jujubot jujubot merged commit a7106a5 into juju:2.2 Jun 21, 2017

1 check failed

github-check-merge-juju Ran tests against PR. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment