diff --git a/changelogs/fragments/bug_collection_delete.yml b/changelogs/fragments/bug_collection_delete.yml index 4d4bf5f8..36d9e524 100644 --- a/changelogs/fragments/bug_collection_delete.yml +++ b/changelogs/fragments/bug_collection_delete.yml @@ -1,4 +1,5 @@ --- bugfixes: - Fixed an issue where if version was not specified in ah_collection and state=absent then the module will fail + - Fixed an issue where if the collection version has a '-' then it would not be referenced properly from the file path ... diff --git a/plugins/modules/ah_collection.py b/plugins/modules/ah_collection.py index 1fdc6772..0dfbc048 100644 --- a/plugins/modules/ah_collection.py +++ b/plugins/modules/ah_collection.py @@ -143,7 +143,7 @@ def main(): if version: pass elif path: - version = path.split("-")[-1].replace('.tar.gz', '') + version = "-".join(path.split("-")[2:]).replace('.tar.gz', '') # Attempt to look up an existing item based on the provided data if version: