Skip to content

Commit df00090

Browse files
committed
Fix pulp_container_content when allow_missing is false
Without this we see the following error if allow_missing is false and a tag does not exist in the source repository: unhashable type: 'dict' This change fixes the issue by pulling the tag names out of the Pulp API response.
1 parent b69f28a commit df00090

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

plugins/modules/pulp_container_content.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -136,10 +136,11 @@ def get_content_units(self, repo):
136136
tags.extend(search_result["results"])
137137
offset += PAGE_LIMIT
138138

139+
tag_names = [tag["name"] for tag in tags]
139140
if (self.module.params["state"] == "present" and
140141
not self.module.params["allow_missing"] and
141-
len(tags) != len(self.module.params["tags"])):
142-
missing = ", ".join(set(self.module.params["tags"]) - set(tags))
142+
len(tag_names) != len(self.module.params["tags"])):
143+
missing = ", ".join(set(self.module.params["tags"]) - set(tag_names))
143144
raise SqueezerException(f"Some tags not found in source repository: {missing}")
144145
return [result["pulp_href"] for result in tags]
145146

0 commit comments

Comments
 (0)