From 5f951106500049ffe6e225e803d55e0c6a4533d8 Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Tue, 31 May 2016 17:55:08 +0100 Subject: [PATCH] koji_task_id label must be a string --- osbs/build/build_request.py | 2 +- osbs/core.py | 2 +- tests/build/test_build_request.py | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/osbs/build/build_request.py b/osbs/build/build_request.py index 683b31b78..ae0c31f58 100644 --- a/osbs/build/build_request.py +++ b/osbs/build/build_request.py @@ -863,7 +863,7 @@ def render(self, validate=True): koji_task_id = self.spec.koji_task_id.value if koji_task_id is not None: self.template['metadata'].setdefault('labels', {}) - self.template['metadata']['labels']['koji-task-id'] = koji_task_id + self.template['metadata']['labels']['koji-task-id'] = str(koji_task_id) use_auth = self.spec.use_auth.value self.render_add_filesystem() diff --git a/osbs/core.py b/osbs/core.py index 8773adea4..89526b165 100755 --- a/osbs/core.py +++ b/osbs/core.py @@ -485,7 +485,7 @@ def list_builds(self, build_config_id=None, koji_task_id=None, label['buildconfig'] = build_config_id if koji_task_id is not None: - label['koji-task-id'] = koji_task_id + label['koji-task-id'] = str(koji_task_id) if label: query['labelSelector'] = ','.join([selector.format(key=key, diff --git a/tests/build/test_build_request.py b/tests/build/test_build_request.py index 9b72e4a6f..63045edfc 100644 --- a/tests/build/test_build_request.py +++ b/tests/build/test_build_request.py @@ -272,7 +272,7 @@ def test_render_prod_request_with_repo(self, architecture, build_image, build_im build_json = build_request.render() assert build_json["metadata"]["name"] == TEST_BUILD_CONFIG - assert build_json["metadata"]["labels"]["koji-task-id"] == koji_task_id + assert build_json["metadata"]["labels"]["koji-task-id"] == str(koji_task_id) assert "triggers" not in build_json["spec"] assert build_json["spec"]["source"]["git"]["uri"] == TEST_GIT_URI assert build_json["spec"]["source"]["git"]["ref"] == TEST_GIT_REF @@ -1186,7 +1186,7 @@ def test_render_prod_request_with_koji_secret(self, tmpdir): build_request.set_params(**kwargs) build_json = build_request.render() - assert build_json["metadata"]["labels"]["koji-task-id"] == koji_task_id + assert build_json["metadata"]["labels"]["koji-task-id"] == str(koji_task_id) plugins = get_plugins_from_build_json(build_json) assert get_plugin(plugins, "exit_plugins", "koji_promote")