Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added dry run support for upgrade-juju #64

Merged
merged 6 commits into from Jun 17, 2014
Merged

Conversation

mattyw
Copy link
Contributor

@mattyw mattyw commented Jun 10, 2014

Fix for https://bugs.launchpad.net/juju-core/+bug/1272544.

Added a --dry flag to the upgrade-juju command. When --dry is specified the action to be taken is output to Stderr. Added two tests to check that this information gets output and that the agent version's aren't changed after running the command with --dry

// TODO(fwereade): this list may be incomplete, pending envtools.Upload change.
logger.Infof("available tools: %s", context.tools)
ctx.Infof("available tools: %s", context.tools)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this particular line's output will be difficult to read when the list of tools grows. Thoughts?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah, might be good to make this a bit more compact. probably a separate issue though

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

but... thinking of the output, I think it would be best to have "available" before "chosen".

@axw
Copy link
Contributor

axw commented Jun 11, 2014

Lookin good, just a few cleanups in the test and possibly a different format for the tools list.

@dimitern
Copy link

Can we use --dry-run instead of --dry please? It's possible to support -n also as a shortcut for --dry-run, if you use a gnuflag.Var() and define a Set() method to parse both.

@fwereade
Copy link
Contributor

haven't looked at the code, but a comment re --dry-run: it doesn't guarantee that a new update won't land in between the dry run and the subsequent, uh, wet one. Might be nice to print the full command line to upgrade to the version that was reported?

@mattyw
Copy link
Contributor Author

mattyw commented Jun 12, 2014

@fwereade do you mean adding something like this?

ctx.Infof("to upgrade to this version run juju upgrade-juju --version=\"%s\"", context.chosen)

@@ -78,6 +79,7 @@ func (c *UpgradeJujuCommand) Info() *cmd.Info {
func (c *UpgradeJujuCommand) SetFlags(f *gnuflag.FlagSet) {
f.StringVar(&c.vers, "version", "", "upgrade to specific version")
f.BoolVar(&c.UploadTools, "upload-tools", false, "upload local version of tools")
f.BoolVar(&c.DryRun, "dry-run", false, "Don't change anything, just report what would change")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/Don't/don't/

@fwereade
Copy link
Contributor

few more comments, a bit rushed, please get another detailed review


for i, test := range tests {
c.Logf("\ntest %d: %s", i, test.about)
//version.Current = version.MustParseBinary(test.currentVersion)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

delete me

@axw
Copy link
Contributor

axw commented Jun 16, 2014

LGTM, thanks

@mattyw
Copy link
Contributor Author

mattyw commented Jun 17, 2014

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Jun 17, 2014

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

@jujubot
Copy link
Collaborator

jujubot commented Jun 17, 2014

Build failed: Tests failed
build url: http://juju-ci.vapour.ws:8080/job/github-merge-juju/183

@mattyw
Copy link
Contributor Author

mattyw commented Jun 17, 2014

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Jun 17, 2014

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

jujubot added a commit that referenced this pull request Jun 17, 2014
added dry run support for upgrade-juju

Fix for https://bugs.launchpad.net/juju-core/+bug/1272544.

Added a --dry flag to the upgrade-juju command. When --dry is specified the action to be taken is output to Stderr. Added two tests to check that this information gets output and that the agent version's aren't changed after running the command with --dry
@jujubot jujubot merged commit ffd31bf into juju:master Jun 17, 2014
@mattyw mattyw deleted the upgrade-dry-run branch July 24, 2014 05:35
ericsnowcurrently pushed a commit to ericsnowcurrently/juju that referenced this pull request May 26, 2015
hmlanigan pushed a commit to hmlanigan/juju that referenced this pull request Aug 26, 2019
Added functions related to tags in testservice

Added TestServer functions on api of tag shown below to testservice.

* GET /api/1.0/tags/ op=list
* POST /api/1.0/tags/ op=new
* GET /api/1.0/tags/{name}/
* GET /api/1.0/tags/{name}/ op=nodes
* POST /api/1.0/tags/{name}/ op=update_nodes
* PUT /api/1.0/tags/{name}/
* DELETE /api/1.0/tags/{name}/
laszlokajtar pushed a commit to laszlokajtar/juju that referenced this pull request Oct 25, 2023
…mepage

Render the discourse content on the homepage of docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants