Skip to content

Commit

Permalink
Improve update_binlogs_collector_config.
Browse files Browse the repository at this point in the history
Co-authored-by: Paulo Machado <[email protected]>
  • Loading branch information
Zvirovyi and paulomach authored Jan 9, 2025
1 parent 9ac2a34 commit 38567e8
Showing 1 changed file with 8 additions and 9 deletions.
17 changes: 8 additions & 9 deletions lib/charms/mysql/v0/backups.py
Original file line number Diff line number Diff line change
Expand Up @@ -839,8 +839,8 @@ def update_binlogs_collector_config(self) -> bool:
else f"{s3_parameters['bucket']}/{s3_parameters['path']}/binlogs"
)

with io.StringIO() as string_io:
yaml.dump(

content = yaml.dump(
{
"endpoint": s3_parameters["endpoint"],
"hosts": self.charm._mysql.get_cluster_members(),
Expand All @@ -852,13 +852,12 @@ def update_binlogs_collector_config(self) -> bool:
"secret_access_key": s3_parameters["secret-key"],
"bucket_url": bucket_url,
"default_region": s3_parameters["region"],
},
},
string_io,
)
self.charm._mysql.write_content_to_file(
}
}
)
self.charm._mysql.write_content_to_file(
path=MYSQL_BINLOGS_COLLECTOR_CONFIG_FILE,
content=string_io.getvalue(),
)
content=content,
)

return True

0 comments on commit 38567e8

Please sign in to comment.