Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Galaxykit Remotes, Distributions and Repositories - create and delete #87

Merged
merged 7 commits into from
Apr 13, 2023

Conversation

MilanPospisil
Copy link
Contributor

@MilanPospisil MilanPospisil commented Apr 3, 2023

@MilanPospisil MilanPospisil changed the title Remotes and Repositories - create and delete Galaxykit Remotes, Distributions and Repositories - create and delete Apr 5, 2023
galaxykit/command.py Outdated Show resolved Hide resolved
galaxykit/command.py Outdated Show resolved Hide resolved
galaxykit/command.py Outdated Show resolved Hide resolved


def parse_pulp_id(pulp_href):
return pulp_href.split("/")[-2]
Copy link
Collaborator

@himdel himdel Apr 10, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the index can vary depending on where the href comes from .. if you're putting this in utils, it should be looking for the uuid

.. it's already implemented as tasks.pulp_href_to_id, maybe move that one here?
.. also implemented as roles.pulp_href_to_id
(and should, but isn't used in containers.add_owner_to_ee (ns_id))

@himdel
Copy link
Collaborator

himdel commented Apr 10, 2023

The rest looks good 👍 :)

himdel added a commit to himdel/ansible-hub-ui that referenced this pull request Apr 12, 2023
@himdel
Copy link
Collaborator

himdel commented Apr 12, 2023

Tested in ansible/ansible-hub-ui#3574 (https://github.com/ansible/ansible-hub-ui/actions/runs/4682109624/jobs/8295536826?pr=3574)

Error: Galaxykit failed: Traceback (most recent call last):
  File "/home/runner/.local/bin/galaxykit", line 8, in <module>
    sys.exit(main())
  File "/home/runner/.local/lib/python3.10/site-packages/galaxykit/command.py", line 723, in main
    resp = roles.delete_role(client, args.name)
  File "/home/runner/.local/lib/python3.10/site-packages/galaxykit/roles.py", line 69, in delete_role
    role_id = get_role_id(client, role_name)
  File "/home/runner/.local/lib/python3.10/site-packages/galaxykit/roles.py", line 27, in get_role_id
    return utils.pulp_href_to_id(resp["results"][0]["pulp_href"])
  File "/home/runner/.local/lib/python3.10/site-packages/galaxykit/utils.py", line 82, in pulp_href_to_id
    if re.match(uuid_regex, section):
NameError: name 're' is not defined

... fixing
... fixed, https://github.com/ansible/ansible-hub-ui/actions/runs/4682109624/jobs/8299456914

@himdel himdel merged commit e7a483e into ansible:main Apr 13, 2023
chr-stian pushed a commit that referenced this pull request Apr 13, 2023
…#87)

* Remotes and Repositories - create and delete

* Creates also distribution

* Distributions

* Black and add distribution.py

* parsing href into id

* Renaming the help texts.

* pulp_href_to_id: fix missing re import, use for one more slash split

---------

Co-authored-by: Martin Hradil <mhradil@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants