-
Notifications
You must be signed in to change notification settings - Fork 102
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
Handle FileNotFoundError on current_controller() #937
Conversation
1 similar comment
@DanielArndt thanks for the PR! Looks like the |
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.
This looks great to me, thanks again for working on this, @DanielArndt! I like introducing JujuControllerNotFoundError
. Let's see the CI run complete, then I'll go ahead and merge this right away 👍
CI failures are unrelated, this can land after the |
/build |
/merge |
2 similar comments
/merge |
/merge |
@DanielArndt the merge is failing because there's a commit in there that's not signed, can you please |
84a394b
to
4466594
Compare
@cderici Done. |
/build |
@DanielArndt linter fix needed. Feel free to add me as a collaborator on your fork too if you want me to take care of small things like these 👍 |
/build |
/merge |
#988 ## What's Changed The main contribution of this release is the user secrets that's released as a part of Juju 3.3. * Free pyblijuju from relying on juju client when connecting to a controller by @cderici in #984 * Handle FileNotFoundError on current_controller() by @DanielArndt in #937 * Add support for adding user secrets by @cderici in #986 * Complete support for user secrets by @cderici in #987 #### Notes & Discussion JUJU-5079
Description
When Juju is not bootstrapped,
controllers.yaml
does not yet exist. This throws aFileNotFoundError
which is hard to decipher the root cause.This is a bit of a contract change, but it appears the only place this is used (at least internally) already guards against
None
. I added a hint to the error message in this case to indicate that Juju may not be bootstrapped.See Notes & Discussion for alternatives.
QA Steps
jujudata.current_controller()
on a machine that is not yet bootstrapped.Notes & Discussion
An alternative to this might be raising a
JujuError
directly fromFileJujuData.current_controller()
.This should also probably be applied to
FileJujuData.controllers()
,FileJujuData.models()
,FileJujuData.accounts()
, andFileJujuData.credentials()
calls.Happy to make changes here if there's a preferred approach, but I thought I'd open the discussion.