summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Brown <sb@ryansb.com>2016-11-10 11:32:32 -0500
committerGitHub <noreply@github.com>2016-11-10 11:32:32 -0500
commit801f4f0bf430a33be1f94b63789b10ad5ac2ad94 (patch)
tree254d3b0a3bbd86f04eb727c12d8cb5f239ba0529
parent4f83b809dcc51c554f55a06e2930fd76377c6bda (diff)
downloadansible-modules-core-801f4f0bf430a33be1f94b63789b10ad5ac2ad94.tar.gz
Fix `cloudformation` error when stack-rollback fails (#5550)
In cases where a CFN stack could not complete (due to lack of permissions or similar) but also failed to roll back, the gathering of stack resources would fail because successfully deleted items in the rollback would no longer have a `PhysicalResourceId` property. This PR fixes that by soft-failing when there's no physical ID associated to a resource.
-rw-r--r--cloud/amazon/cloudformation.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/cloud/amazon/cloudformation.py b/cloud/amazon/cloudformation.py
index 0d02ad70..f5b713e0 100644
--- a/cloud/amazon/cloudformation.py
+++ b/cloud/amazon/cloudformation.py
@@ -464,7 +464,7 @@ def main():
for res in reslist.get('StackResourceSummaries', []):
stack_resources.append({
"logical_resource_id": res['LogicalResourceId'],
- "physical_resource_id": res['PhysicalResourceId'],
+ "physical_resource_id": res.get('PhysicalResourceId', ''),
"resource_type": res['ResourceType'],
"last_updated_time": res['LastUpdatedTimestamp'],
"status": res['ResourceStatus'],