While working on #2662 , I noticed that there were inconsistencies in the Manage Relations how-to pages.
See #2662 (comment) for the original discussions.
There are some inconsistencies in the examples, which I am planning to address in another PR. Let me know if that is okay.
Some examples:
def _on_db_relation_created(self, event: ops.RelationCreatedEvent):
if not self.unit.is_leader():
return
credentials = self.create_database(event.app.name)
data = DatabaseProviderAppData(credentials=credentials)
relation.save(data, event.app)
relation is undefined. I assume we need event.relation.save(data, event.app).
def _update_configuration(self, _: ops.Eventbase):
...
secret_contents = self.model.get_secret(id=secret_id).get_contents(
refresh=True
)
self.push_configuration(
username=secret['username'],
password=secret['password'],
)
I assume secret should be secret_contents.
While working on #2662 , I noticed that there were inconsistencies in the Manage Relations how-to pages.
See #2662 (comment) for the original discussions.
There are some inconsistencies in the examples, which I am planning to address in another PR. Let me know if that is okay.
Some examples:
relationis undefined. I assume we needevent.relation.save(data, event.app).I assume
secretshould besecret_contents.