Skip to content

Commit

Permalink
Fixes issue in collection_remotes module where the requriements could…
Browse files Browse the repository at this point in the history
… not be blanked out (#420)

Co-authored-by: David Danielsson <[email protected]>
  • Loading branch information
Tompage1994 and djdanielsson authored Aug 5, 2024
1 parent 606b7fe commit 79655f0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
4 changes: 4 additions & 0 deletions changelogs/fragments/collection_remote_requirements.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
bugfixes:
- Fixes issue in collection_remotes module where the requriements could not be blanked out
...
9 changes: 6 additions & 3 deletions plugins/modules/collection_remote.py
Original file line number Diff line number Diff line change
Expand Up @@ -230,9 +230,12 @@ def main():
new_fields = {}

requirements = module.params.get("requirements")
if requirements:
requirements_content = "\n - ".join(requirements)
new_fields["requirements_file"] = "---\ncollections:\n - " + requirements_content
if requirements is not None:
if len(requirements):
requirements_content = "\n - ".join(requirements)
new_fields["requirements_file"] = "---\ncollections:\n - " + requirements_content
else:
new_fields["requirements_file"] = None

requirements_file = module.params.get("requirements_file")
if requirements_file:
Expand Down

0 comments on commit 79655f0

Please sign in to comment.