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

Model "not found" handled consistently. #7797

Merged

Conversation

anastasiamac
Copy link
Contributor

@anastasiamac anastasiamac commented Aug 28, 2017

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

Copy link
Contributor

@axw axw left a 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

@@ -101,6 +101,13 @@ func (c *dumpCommand) Run(ctx *cmd.Context) error {
}

modelDetails, err := store.ModelByName(controllerName, c.model)
Copy link
Contributor

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

Copy link
Contributor Author

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

Copy link
Contributor

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.

@anastasiamac
Copy link
Contributor Author

Changed "dump" and "dump-db" to be model-type commands.
I'll notify juju-dev mailing list once this lands \o/ The only difference would be that the arguments have changed from positional to explicit flags/options as per other model commands.

@anastasiamac
Copy link
Contributor Author

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Aug 28, 2017

Status: merge request accepted. Url: http://ci.jujucharms.com/job/github-merge-juju

@jujubot jujubot merged commit e4517dc into juju:develop Aug 28, 2017
@anastasiamac anastasiamac deleted the model-not-found-consistent-handling branch August 28, 2017 08:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants