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

As a user I want to be able to pass a path to a YAML file with a list of Ansible Collections I wish to be represented by a Ansible Remote in the Ansible plugin #226

Closed
ajsween opened this issue May 6, 2021 · 4 comments · Fixed by #229
Labels
bug Something isn't working (template-set) feature request New feature request (template-set)
Milestone

Comments

@ajsween
Copy link

ajsween commented May 6, 2021

When creating or updating a remote Collection for the Ansible plugin the REST API documents a parameter, "requirements_file." This parameter is currently exposed via the pulp CLI tool. However, it only accepts a string directly. When you instead pass a file path to a YAML file it fails to serialize the YAML file correctly to JSON and throws an exception. My YAML file looked similar to the following:

---
collections:
  - testing.ansible_testing_content
  - pulp.squeezer
@mdellweg mdellweg added the feature request New feature request (template-set) label May 6, 2021
@ajsween
Copy link
Author

ajsween commented May 6, 2021

In examining the behavior of the wrapper today, I think this may actually be a bug. It appears to me that a file path is accepted but that serialization is not successful.

@mdellweg
Copy link
Member

mdellweg commented May 6, 2021

That is debatable. I'm pretty sure, JSON as a format is accepted, so adding YAML would be a feature.
Agreed, this may look weird when coming from an ansible minted mindset.
The change i envision to solve this would allow YAML anywhere in place of only JSON. And to me that is a feature.

@daviddavis
Copy link
Contributor

@mdellweg I believe that the REST API actually expects yaml for requirements_file. See https://docs.pulpproject.org/pulp_ansible/restapi.html#operation/remotes_ansible_collection_create.

@mdellweg
Copy link
Member

mdellweg commented May 6, 2021

So it's a feature request to accept yaml where we already accept json, and a bug by the principle of least surprise?

@mdellweg mdellweg added the bug Something isn't working (template-set) label May 6, 2021
daviddavis pushed a commit to daviddavis/pulp-cli that referenced this issue May 6, 2021
daviddavis pushed a commit to daviddavis/pulp-cli that referenced this issue May 6, 2021
daviddavis pushed a commit to daviddavis/pulp-cli that referenced this issue May 6, 2021
@mdellweg mdellweg added this to the 0.9.0 milestone May 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working (template-set) feature request New feature request (template-set)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants