From 1a4e84699945753952d83a03c934ae99ee902ea0 Mon Sep 17 00:00:00 2001 From: Carlos Lopez Date: Tue, 21 Nov 2023 15:40:33 -0500 Subject: [PATCH] [IMP] pre-commit stuff --- tasks_downstream.py | 12 +++++------- tests/test_settings_effect.py | 7 +++---- 2 files changed, 8 insertions(+), 11 deletions(-) diff --git a/tasks_downstream.py b/tasks_downstream.py index 853b8894..97ac2c77 100644 --- a/tasks_downstream.py +++ b/tasks_downstream.py @@ -231,6 +231,7 @@ def write_code_workspace_file(c, cw_path=None): addon / "__openerp__.py" ).is_file(): if subrepo.name == "odoo": + # ruff: noqa: UP031 local_path = "${workspaceFolder:%s}/addons/%s/" % ( subrepo.name, addon.name, @@ -773,7 +774,7 @@ def test( continue if m_to_skip not in modules_list: _logger.warn( - "%s not found in the list of addons to test: %s" % (m_to_skip, modules) + "%s not found in the list of addons to test: %s", (m_to_skip, modules) ) modules_list.remove(m_to_skip) modules = ",".join(modules_list) @@ -968,13 +969,10 @@ def snapshot( Uses click-odoo-copydb behind the scenes to make a snapshot. """ if not destination_db: - destination_db = "%s-%s" % ( - source_db, - datetime.now().strftime("%Y_%m_%d-%H_%M"), - ) + destination_db = f"{source_db}-{datetime.now().strftime('%Y_%m_%d-%H_%M')}" with c.cd(str(PROJECT_ROOT)): cur_state = c.run(DOCKER_COMPOSE_CMD + " stop odoo db", pty=True).stdout - _logger.info("Snapshoting current %s DB to %s" % (source_db, destination_db)) + _logger.info("Snapshoting current %s DB to %s", (source_db, destination_db)) _run = DOCKER_COMPOSE_CMD + " run --rm -l traefik.enable=false odoo" c.run( f"{_run} click-odoo-copydb {source_db} {destination_db}", @@ -1031,7 +1029,7 @@ def restore_snapshot( raise exceptions.PlatformError( "No snapshot found for destination_db %s" % destination_db ) - _logger.info("Restoring snapshot %s to %s" % (snapshot_name, destination_db)) + _logger.info("Restoring snapshot %s to %s", (snapshot_name, destination_db)) _run = DOCKER_COMPOSE_CMD + " run --rm -l traefik.enable=false odoo" c.run( f"{_run} click-odoo-dropdb {destination_db}", diff --git a/tests/test_settings_effect.py b/tests/test_settings_effect.py index 823bab33..c7f3ddd8 100644 --- a/tests/test_settings_effect.py +++ b/tests/test_settings_effect.py @@ -60,10 +60,9 @@ def _test_backup_config( backup_image_version ) else: - assert prod_config.services[ - "backup" - ].image == "ghcr.io/tecnativa/docker-duplicity-postgres:{}".format( - backup_image_version + assert ( + prod_config.services["backup"].image + == f"ghcr.io/tecnativa/docker-duplicity-postgres:{backup_image_version}" ) # Check SMTP configuration if smtp_relay_host: