Reduce log level of SLA API error. #7439

Merged
merged 1 commit into from Jun 1, 2017

Conversation

Projects
None yet
3 participants
Owner

cmars commented Jun 1, 2017

SLA allocation is removed with best effort. Because the SLA API call
will fail on pre-2.2 controllers, debug level is more appropriate for
this error.

Description of change

Why is this change needed?

Before this change, when using a Juju 2.2 client with pre-2.2 controllers, you'll get an unactionable warning about SLAs when destroying a model, because the controller does not support them:

c@zeugmatic:~/go/juju/src/github.com/juju/juju$ juju add-model foo azure/westus --credential azure-cmars
Uploading credential 'azure/cmars@external/azure-cmars' to controller
Added 'foo' model on azure/westus with credential 'azure-cmars' for user 'cmars'
c@zeugmatic:~/go/juju/src/github.com/juju/juju$ juju destroy-model foo
WARNING! This command will destroy the "foo" model.
This includes all machines, applications, data and other resources.

Continue [y/N]? y
WARNING could not determine model SLA level: no such request - method ModelConfig(1).SLALevel is not implemented (not implemented)
Destroying model

QA steps

How do we verify that the change works?

You won't see the API error warning when destroying a model on a pre-2.2 controller.

c@zeugmatic:~/go/juju/src/github.com/juju/juju$ juju add-model foo azure/westus --credential azure-cmars
Uploading credential 'azure/cmars@external/azure-cmars' to controller
Added 'foo' model on azure/westus with credential 'azure-cmars' for user 'cmars'
c@zeugmatic:~/go/juju/src/github.com/juju/juju$ juju destroy-model foo                                                                                 
WARNING! This command will destroy the "foo" model.
This includes all machines, applications, data and other resources.

Continue [y/N]? y
Destroying model
Waiting on model to be removed...
Waiting on model to be removed...
Waiting on model to be removed...

Documentation changes

Does it affect current user workflow? CLI? API?

No

Bug reference

Does this change fix a bug? Please add a link to it.

N/A

Reduce log level of SLA API error.
SLA allocation is removed with best effort. Because the SLA API call
will fail on pre-2.2 controllers, debug level is more appropriate for
this error.

wupeka approved these changes Jun 1, 2017

LGTM
Sidenote - I'd add an explicit check of ModelConfig API version instead of calling SLA commands and checking if they fail.

Owner

cmars commented Jun 1, 2017

$$merge$$

Contributor

jujubot commented Jun 1, 2017

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

@jujubot jujubot merged commit 21411c3 into juju:develop Jun 1, 2017

1 check failed

github-check-merge-juju Built PR, ran unit tests, and tested LXD deploy. Use !!.*!! to request another build. IE, !!build!!, !!retry!!
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment