-
Notifications
You must be signed in to change notification settings - Fork 9
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
[ISSUE-42;ISSUE-43] is_resource_created improvements and fixes #44
[ISSUE-42;ISSUE-43] is_resource_created improvements and fixes #44
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.
This improvement looks really good. I will also fix the function fetch_relation_data
and change the line 504 of the data_interfaces
in this way:
if f"{self.relation_name}-relation-broken" in os.environ.get("JUJU_HOOK_NAME", ""):
This will avoid the raise of the runtime exception if the relation-broken
event is not related to the database.
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.
Looks good to me!
@deusebio @welpaolo @delgod could this be improved?
was not check checking the name of the database relation to ensure it is only related to database relations? |
I'm not sure I fully understand what you mean. IIRC, here the issue is that there may exist multiple relations under the same relation name, and Now, previously in the So, here we basically just fetch the data that can be fetched. If the databag of the relation broken is not available, the dictionary would just NOT have the corresponding relation id key rather than raising an exception. I don't think the users would do anything wrong to use |
@deusebio |
Addressing #42 and #43