Skip to content

Commit

Permalink
[IMP] pre-commit stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
celm1990 committed Nov 21, 2023
1 parent faca106 commit 1a4e846
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 11 deletions.
12 changes: 5 additions & 7 deletions tasks_downstream.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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}",
Expand Down Expand Up @@ -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}",
Expand Down
7 changes: 3 additions & 4 deletions tests/test_settings_effect.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 1a4e846

Please sign in to comment.