Skip to content

Commit

Permalink
fix: remove sensitive data from logs (#173)
Browse files Browse the repository at this point in the history
don't log the DB password
  • Loading branch information
alexsander-souza authored Jul 29, 2024
1 parent 07a8c84 commit 7f7ef2e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions maas-region/src/charm.py
Original file line number Diff line number Diff line change
Expand Up @@ -324,9 +324,8 @@ def _on_maasdb_created(self, event: db.DatabaseCreatedEvent) -> None:
event (DatabaseCreatedEvent): event from DatabaseRequires
"""
logger.info(f"MAAS database credentials received for user '{event.username}'")
if conn := self.connection_string:
if self.connection_string:
self.unit.status = ops.MaintenanceStatus("Initialising the MAAS database")
logger.info(f"DSN: {conn}")
self._initialize_maas()

def _on_maasdb_endpoints_changed(self, event: db.DatabaseEndpointsChangedEvent) -> None:
Expand All @@ -336,9 +335,8 @@ def _on_maasdb_endpoints_changed(self, event: db.DatabaseEndpointsChangedEvent)
event (DatabaseEndpointsChangedEvent): event from DatabaseRequires
"""
logger.info(f"MAAS database endpoints have been changed to: {event.endpoints}")
if conn := self.connection_string:
if self.connection_string:
self.unit.status = ops.MaintenanceStatus("Updating database connection")
logger.info(f"DSN: {conn}")
self._initialize_maas()

def _on_api_endpoint_changed(self, event: ops.RelationEvent) -> None:
Expand Down

0 comments on commit 7f7ef2e

Please sign in to comment.