From daaeaf55318e2ffe1c27e11f61733291c71decc9 Mon Sep 17 00:00:00 2001 From: Xiubo Li Date: Wed, 4 Nov 2020 22:25:23 -0500 Subject: [PATCH] packageing: add force_noarch option support Add one "force_noarch : True" option to force to use the "noarch" to build the uri, False as default. Signed-off-by: Xiubo Li --- docs/detailed_test_config.rst | 12 ++++++++++++ teuthology/packaging.py | 6 +++++- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/docs/detailed_test_config.rst b/docs/detailed_test_config.rst index 50ae910a91..97ce7343da 100644 --- a/docs/detailed_test_config.rst +++ b/docs/detailed_test_config.rst @@ -270,3 +270,15 @@ the location of the sandbox directory, the following option can be specified in ``$HOME/.teuthology.yaml``:: test_path: + +Shaman options +============== + +Shaman is a helper class which could be used to build the uri for specified +packages based the 'shaman_host': 'shaman.ceph.com'. + +Options:: + + use_shaman: True # Enable to use Shaman, False as default + shaman: + force_noarch: True # Force to use "noarch" to build the uri diff --git a/teuthology/packaging.py b/teuthology/packaging.py index 11e29f1eb2..14a6082903 100644 --- a/teuthology/packaging.py +++ b/teuthology/packaging.py @@ -853,6 +853,9 @@ class ShamanProject(GitbuilderProject): super(ShamanProject, self).__init__(project, job_config, ctx, remote) self.query_url = 'https://%s/api/' % config.shaman_host + # Force to use the "noarch" instead to build the uri. + self.force_noarch = self.job_config.get("shaman", {}).get("force_noarch", False) + def _get_base_url(self): self.assert_result() return self._result.json()[0]['url'] @@ -882,7 +885,8 @@ class ShamanProject(GitbuilderProject): req_obj['status'] = 'ready' req_obj['project'] = self.project req_obj['flavor'] = flavor - req_obj['distros'] = '%s/%s' % (self.distro, self.arch) + arch = "noarch" if self.force_noarch else self.arch + req_obj['distros'] = '%s/%s' % (self.distro, arch) ref_name, ref_val = list(self._choose_reference().items())[0] if ref_name == 'tag': req_obj['sha1'] = self._sha1 = self._tag_to_sha1() -- 2.39.5