From 163e8c17d987aa4161312c40ce4ce001e0f17c1b Mon Sep 17 00:00:00 2001 From: Christian Date: Tue, 5 Mar 2024 16:27:13 +0100 Subject: [PATCH] revert No-Issue --- .../integration/api/rbac_actions/utils.py | 34 +++++-------------- 1 file changed, 9 insertions(+), 25 deletions(-) diff --git a/galaxy_ng/tests/integration/api/rbac_actions/utils.py b/galaxy_ng/tests/integration/api/rbac_actions/utils.py index a73e4be3eb..36ccd32584 100644 --- a/galaxy_ng/tests/integration/api/rbac_actions/utils.py +++ b/galaxy_ng/tests/integration/api/rbac_actions/utils.py @@ -9,7 +9,8 @@ wait_for_task as wait_for_task_fixtures, TaskWaitingTimeout, gen_string, - wait_for_all_tasks as wait_for_all_tasks_fixtures + wait_for_all_tasks as wait_for_all_tasks_fixtures, + AnsibleDistroAndRepo ) from ansible.galaxy.api import GalaxyError @@ -18,8 +19,6 @@ get_galaxy_client, AnsibleConfigFixture from galaxy_ng.tests.integration.utils.rbac_utils import create_local_image_container from galaxykit.container_images import get_container, get_container_images_latest -from galaxykit.repositories import create_repository, create_distribution - ansible_config = get_ansible_config() CLIENT_CONFIG = ansible_config("admin") ADMIN_CLIENT = get_client(CLIENT_CONFIG) @@ -418,34 +417,19 @@ def __del__(self): self.cleanup() -class ReusableAnsibleRepository: +class ReusableAnsibleRepository(AnsibleDistroAndRepo): def __init__(self, name, is_staging, is_private=False, add_collection=False): - _ansible_config = get_ansible_config() - galaxy_client = get_galaxy_client(_ansible_config) - gc = galaxy_client("admin") - pipeline = None + repo_body = {} if is_staging: - pipeline = "staging" - self._repo = create_repository( - gc, - name, - hide_from_search=False, - private=is_private, - pipeline=pipeline, - remote=None, - ) - create_distribution(gc, name, self._repo["pulp_href"]) - self._distro = {"base_path": name, "name": name, "repository": self._repo["pulp_href"]} + repo_body["pulp_labels"] = {"pipeline": "staging"} + if is_private: + repo_body["private"] = True + super().__init__( + ADMIN_CLIENT, name, repo_body=repo_body, distro_body=None) if add_collection: self._add_collection() - def get_distro(self): - return self._distro - - def get_repo(self): - return self._repo - def _add_collection(self): namespace = gen_namespace(gen_string()) artifact = build_collection(