Skip to content

Commit 4baa509

Browse files
committed
cli: Display failed resources on create
If cluster creation doesn't complete, add an error message that includes all the resources which failed to create, along with the reasons for failure. Signed-off-by: Brian Barrett <[email protected]>
1 parent d225f4d commit 4baa509

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

cli/cfncluster/cfncluster.py

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,15 @@ def create(args):
9797
if resource_status != '':
9898
logger.debug(resource_status)
9999

100+
if status != 'CREATE_COMPLETE':
101+
logger.critical('\nCluster creation failed. Failed events:')
102+
events = cfnconn.describe_stack_events(stack)
103+
for event in events:
104+
if (event.resource_status == 'CREATE_FAILED'):
105+
logger.info(" - %s %s %s" %
106+
(event.resource_type, event.logical_resource_id,
107+
event.resource_status_reason))
108+
100109
outputs = cfnconn.describe_stacks(stack)[0].outputs
101110
for output in outputs:
102111
logger.info(output)

0 commit comments

Comments
 (0)