Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Add --no-switch to juju bootstrap and add-model #7237
Conversation
mjs
changed the base branch from
staging
to
develop
Apr 13, 2017
| f.BoolVar(&c.showClouds, "clouds", false, "Print the available clouds which can be used to bootstrap a Juju environment") | ||
| f.StringVar(&c.showRegionsForCloud, "regions", "", "Print the available regions for the specified cloud") | ||
| + f.BoolVar(&c.noGUI, "no-gui", false, "Do not install the Juju GUI in the controller when bootstrapping") | ||
| + f.BoolVar(&c.noSwitch, "S", false, "Do not switch to the newly created controller") |
jameinel
Apr 13, 2017
Owner
I'm not sure that we want -S as a short variable, it doesn't feel like this would be used enough.
Also, IMO, if you are going to have "no-foo" then you should also have "foo" so that any sort of change-to-the-default can always be done compatibly in the future.
mjs
Apr 13, 2017
Contributor
As per IRC, I'll canvass some opinions on this. If we're going to do --switch (default to true) then I'd prefer to not have a --no-switch. It seems weird to me to have to competing flags.
Then people would do --switch=false if they don't want switching.
cmars
Apr 14, 2017
Owner
I will use the heck out of this feature, because I automate Juju with scripts. I like -S quite a bit.
|
I didn't think gnuflag supported --flag=false, I thought that was only
supported by default go Flag package.
I would say --no-switch=false is a lot worse than
--switch/--switch=true/false
Double negatives are very hard to understand.
If we do support =false, then I'm in favor of --switch=false rather than
--no-switch=false to mean switch.
John
=:->
…
|
|
@jameinel I disagree. I think a capitalized short -S flag, and a --no-switch long flag fit the existing idiom in the Juju CLI really well, for example:
I'd rather be consistent than anything else. |
|
Given that various |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
!!build!! |
|
!!build!! |
|
Looks like the changes are now incompatible with the current |
mjs
added some commits
Apr 13, 2017
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$vsphere-flakiness$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$merge$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
|
Build failed: Tests failed |
|
$$mongodb-on-windows$$ |
|
Status: merge request accepted. Url: http://juju-ci.vapour.ws:8080/job/github-merge-juju |
mjs commentedApr 13, 2017
Description of change
When performing operations in a script or in parallel the automatic switching to new controllers and models can lead to surprises and unwanted actions.
juju bootstrapandjuju add-modelnow take a-S/--no-switchflag to suppress this behaviour.QA steps
Documentation changes
Perhaps worth mentioning but this is fairly minor.
Bug reference
https://bugs.launchpad.net/juju/+bug/1618234