From ce04f9832b94318fd84bf237c03078d3448aee89 Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 5 Mar 2024 11:38:34 +0100 Subject: [PATCH] workaround No-Issue --- .../integration/utils/pulp_interfaces.py | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/galaxy_ng/tests/integration/utils/pulp_interfaces.py b/galaxy_ng/tests/integration/utils/pulp_interfaces.py index 146ecc5255..ebcec5db34 100644 --- a/galaxy_ng/tests/integration/utils/pulp_interfaces.py +++ b/galaxy_ng/tests/integration/utils/pulp_interfaces.py @@ -1,3 +1,5 @@ +import time + from galaxy_ng.tests.integration.utils import ( wait_for_task, wait_for_all_tasks ) @@ -49,11 +51,31 @@ def __init__(self, client, name, repo_body=None, distro_body=None): self.create() def create(self): + ''' self._repo = self.client( f"{self.api_prefix}pulp/api/v3/repositories/ansible/ansible/", args=self._repo_body, method="POST" ) + ''' + # FIXME - the POST call will often result in an error with the oci+insights profile ... + _repo = None + retries = 10 + for x in range(0, retries): + try: + _repo = self.client( + f"{self.api_prefix}pulp/api/v3/repositories/ansible/ansible/", + args=self._repo_body, + method="POST" + ) + break + except Exception as e: + print(e) + time.sleep(5) + + if _repo is None: + raise Exception("failed to create repo and dist") + self._repo = _repo resp = self.client( f"{self.api_prefix}pulp/api/v3/distributions/ansible/ansible/",