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
Model "not found" handled consistently. #7797
Model "not found" handled consistently. #7797
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM with a suggestion to avoid copy&paste
cmd/juju/model/dump.go
Outdated
@@ -101,6 +101,13 @@ func (c *dumpCommand) Run(ctx *cmd.Context) error { | |||
} | |||
|
|||
modelDetails, err := store.ModelByName(controllerName, c.model) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you please instead add a new method to ControllerCommandBase?
func (*ControllerCommandBase) ModelDetails(modelName string) (*jujuclient.ModelDetails, error)
which will do the refresh, just like ModelCommandBase.ModelDetails
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I am not sure if it's worth it.
It looks like these 2 are the only commands that will call it and I agree with Roger that they both should be model-type commands anyway. I might just change them to be :) This will eliminate code duplication and couple of todos :D
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I concur. Please notify the mailing lists after it's done.
Changed "dump" and "dump-db" to be model-type commands. |
|
Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju |
Description of change
There are places in CLI where 'model not found" could benefit from models refresh on client side.
This PR identified all these places and corrected them to use consistent approach.
QA steps
n/a - internal change.
Documentation changes
n/a - internal change
Bug reference
n/a