Skip to content

Commit 81fc670

Browse files
tpaulusCopilot
andcommitted
Handle AWX API playbook responses
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 1e5d244 commit 81fc670

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

awx/bootstrap.yaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,9 @@ data:
8484
if query:
8585
q.update(query)
8686
data = request("GET", path, query=q)
87+
if isinstance(data, list):
88+
merged.extend(data)
89+
return merged
8790
merged.extend(data.get("results", []))
8891
if not data.get("next"):
8992
return merged
@@ -138,7 +141,11 @@ data:
138141
status = project.get("status")
139142
if status == "successful":
140143
playbooks = list_all(f"projects/{project_id}/playbooks/")
141-
if any(item.get("name") == playbook_path for item in playbooks):
144+
if any(
145+
item == playbook_path
146+
or (isinstance(item, dict) and item.get("name") == playbook_path)
147+
for item in playbooks
148+
):
142149
log(f"Project sync complete and found playbook {playbook_path}")
143150
return
144151
raise RuntimeError(

0 commit comments

Comments
 (0)