juju model-defaults supports region for get #6443

Merged
merged 1 commit into from Oct 13, 2016

Conversation

Projects
None yet
4 participants
Owner

wallyworld commented Oct 13, 2016

juju model-defaults command now supports specifying a region for which we want the default values.
$ juju model-defaults us-east-1

QA. bootstrap aws, set some defaults
$juju model-defaults us-east-1
Attribute Default Controller
ftp-proxy "" -
us-east-1 foobar -
no-proxy "" -
us-east-1 foo -

mjs approved these changes Oct 13, 2016

cmd/juju/model/defaultscommand.go
+ // If a region was specified and reset was specified, we shouldn't have
+ // an extra arg. If it had an "=" in it, we should have handled it
+ // already.
+ return errors.New("cannot retrieve defaults for a key and reset args at the same time")
@mjs

mjs Oct 13, 2016

Contributor

s/args //

Owner

wallyworld commented Oct 13, 2016

$$merge$$

Contributor

jujubot commented Oct 13, 2016

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

@jujubot jujubot merged commit 1b3489b into juju:master Oct 13, 2016

@@ -214,8 +217,8 @@ func (c *defaultsCommand) Init(args []string) error {
// set args.
return c.handleSetArgs(args)
case len(args) == 0:
- // This should be reset only (but possibly for a region).
- return c.handleZeroArgs()
+ c.action = c.getDefaults
@reedobrien

reedobrien Oct 15, 2016

Contributor

This change causes juju model-defaults --reset foo to reset foo and print out all the model defaults. Also in the case that one names a cloud/region it resets the key(s) and prints out the args that have a setting in that region.

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