From 35e502d12419df08cfb9deb41d3bdd6e738b1411 Mon Sep 17 00:00:00 2001 From: Victor Seva Date: Thu, 30 Jun 2022 11:48:56 +0200 Subject: [PATCH] TT#121955 celery: fix problems with serialization > amqp.exceptions.FrameSyntaxError: Table type for key b'base_path' not handled by amqp. [value: PosixPath('/var/lib/repoapi/jbi_files/rate-o-mat-repos/1148')] Change-Id: I9c8a11a9b7a63b3b8af2631f15a24199389fabb0 --- repoapi/celery.py | 7 ++++--- repoapi/tasks.py | 2 +- repoapi/test/test_jbi_info.py | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/repoapi/celery.py b/repoapi/celery.py index 3723354..4f95d90 100644 --- a/repoapi/celery.py +++ b/repoapi/celery.py @@ -90,12 +90,13 @@ def receiver_setup_logging(loglevel, logfile, format, colorize, **kwargs): @app.task() -def jbi_parse_hotfix(jbi_id, path): +def jbi_parse_hotfix(jbi_id: str, path: str): app.send_task("hotfix.tasks.hotfix_released", args=[jbi_id, path]) @app.task() -def process_result(jbi_id, path_envVars): +def process_result(jbi_id: str, path_envVars: str): app.send_task( - "release_changed.tasks.process_result", args=[jbi_id, path_envVars] + "release_changed.tasks.process_result", + args=[jbi_id, path_envVars], ) diff --git a/repoapi/tasks.py b/repoapi/tasks.py index b0109eb..d47df4a 100644 --- a/repoapi/tasks.py +++ b/repoapi/tasks.py @@ -77,7 +77,7 @@ def get_jbi_files(jbi_id, jobname, buildnumber): else: log.debug("skip artifacts download") if jobname in settings.RELEASE_CHANGED_JOBS: - process_result.delay(jbi_id, path_envVars) + process_result.delay(jbi_id, str(path_envVars)) @shared_task(ignore_result=True) diff --git a/repoapi/test/test_jbi_info.py b/repoapi/test/test_jbi_info.py index 2ec0f69..7fb5840 100644 --- a/repoapi/test/test_jbi_info.py +++ b/repoapi/test/test_jbi_info.py @@ -157,4 +157,4 @@ class TestJBIReleaseChangedCelery(BaseTest): ) path = base_path.joinpath("envVars.json") dlfile.assert_any_call(url, path) - process_result.delay.assert_called_once_with(jbi.id, path) + process_result.delay.assert_called_once_with(jbi.id, str(path))