Skip to content

Commit

Permalink
Adds workaround for requires_ansible
Browse files Browse the repository at this point in the history
Collections on galaxy.ansible.com may not have the expected
`requires_ansible` data.

closes pulp#806
  • Loading branch information
bmbouter committed Jan 27, 2022
1 parent 750e8b0 commit 98117a8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 2 additions & 0 deletions CHANGES/806.bugfix
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
Adds workaround to handle collections that do not have a ``requires_ansible`` in the
``meta/runtime.yml`` data. This can happen in collections from ``galaxy.ansible.com``.
4 changes: 3 additions & 1 deletion pulp_ansible/app/tasks/collections.py
Original file line number Diff line number Diff line change
Expand Up @@ -1046,7 +1046,9 @@ def _post_save(self, batch):
)
if runtime_metadata:
runtime_yaml = yaml.safe_load(runtime_metadata)
collection_version.requires_ansible = runtime_yaml.get("requires_ansible")
if runtime_yaml:
collection_version.requires_ansible = runtime_yaml.get(
"requires_ansible")
manifest_data = json.load(
get_file_obj_from_tarball(tar, "MANIFEST.json", artifact.file.name)
)
Expand Down

0 comments on commit 98117a8

Please sign in to comment.