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

Address bug #1733920, don't tread model NotFound as an error #8125

Merged
merged 3 commits into from
Nov 26, 2017

Conversation

jameinel
Copy link
Member

@jameinel jameinel commented Nov 23, 2017

Description of change

When destroying a model, we should expect it to eventually go away.
Don't treat NotFound as a real error.

QA steps

$ juju add-model testing
$ juju destroy-model testing
Added 'testing' model with credential 'localhost' for user 'admin'
Destroying model
Waiting on model to be removed...
Waiting on model to be removed...
Waiting on model to be removed...
Model destroyed.

It used to give

$ juju destroy-model testing -y
Destroying model
Waiting on model to be removed...
Waiting on model to be removed...
Could not get the model status from the API: model 815f0b8c-c1f2-4838-8f7c-2b516fdda155 has been removed.

Documentation changes

None

Bug reference

lp:1733920

// No need to give the user a warning that the model they asked
// to destroy is no longer there.
if errors.IsNotFound(status[0].Error) || params.IsCodeNotFound(status[0].Error) {
ctx.Infof("Model destroyed.")
Copy link
Contributor

Choose a reason for hiding this comment

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

If we're adding logging for this one, we should probably do it when checking the immedate error result of ModelStatus, too.

@jameinel
Copy link
Member Author

jameinel commented Nov 24, 2017 via email

@axw
Copy link
Contributor

axw commented Nov 24, 2017

Instead of just updating the error of the single response, merge the
errors which was already handling when it was getting ErrNotFound.
@anastasiamac
Copy link
Contributor

$$merge$$

@jujubot
Copy link
Collaborator

jujubot commented Nov 26, 2017

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

@jujubot jujubot merged commit adbe8ca into juju:develop Nov 26, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants