Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
No-Issue
  • Loading branch information
chr-stian committed Mar 5, 2024
1 parent 8dbafe5 commit 163e8c1
Showing 1 changed file with 9 additions and 25 deletions.
34 changes: 9 additions & 25 deletions galaxy_ng/tests/integration/api/rbac_actions/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 163e8c1

Please sign in to comment.