cmd/...: fix single-key config commands #6928

Merged
merged 1 commit into from Feb 7, 2017

Conversation

Projects
None yet
3 participants
Member

axw commented Feb 7, 2017

Description of change

Fix controller-config and model-config commands
so that when a single key is specified, by
default we will format the value in its raw
form. Internally, we use the "smart" formatter
to do this.

To do this in a way that users can still get
YAML/JSON formatting of single keys as needed,
we introduce and default to tabular formatting
of controller config as we do for model config.

Also, fix the model-config command to honour
the -o/--output flag when a single key is
specified.

QA steps

  1. juju bootstrap localhost
  2. juju controller-config ca-cert (should print ca-cert without YAML multi-line prefix)
  3. juju controller-config --format=yaml ca-cert (should print ca-cert with YAML multi-line prefix)
  4. juju controller-config (should print attributes in tabular format)
  5. juju model-config http-proxy="abc
    def"
  6. juju model-config --output=/tmp/config.txt http-proxy (contents of /tmp/config.txt should be:
abc
def

Documentation changes

Default format of controller-config has changed, and for single-key format of model-config. We do not guarantee stability of the default formats, you must specify YAML/JSON for that.

Bug reference

Fixes https://bugs.launchpad.net/juju/+bug/1661506

cmd/...: fix single-key config commands
Fix controller-config and model-config commands
so that when a single key is specified, by
default we will format the value in its raw
form. Internally, we use the "smart" formatter
to do this.

To do this in a way that users can still get
YAML/JSON formatting of single keys as needed,
we introduce and default to tabular formatting
of controller config as we do for model config.

Also, fix the model-config command to honour
the -o/--output flag when a single key is
specified.

Fixes https://bugs.launchpad.net/juju/+bug/1661506
Member

axw commented Feb 7, 2017

$$merge$$

Contributor

jujubot commented Feb 7, 2017

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

@jujubot jujubot merged commit ed209da into juju:2.1 Feb 7, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment