From 14a1a780cd1ff08db73b3ab6cfd9aa6efa2f71f3 Mon Sep 17 00:00:00 2001 From: Petr Svoboda Date: Mon, 30 Sep 2013 15:47:43 +0200 Subject: [PATCH] Fail cloudformation operation when it is not completed successfully When cloudformation operation is successfully submitted but some step during stack creation or update fails, operation result should be failed=True. --- cloud/cloudformation | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cloud/cloudformation b/cloud/cloudformation index ae9f2e0f26f..41323ac562b 100644 --- a/cloud/cloudformation +++ b/cloud/cloudformation @@ -141,12 +141,12 @@ def stack_operation(cfn, stack_name, operation): output = 'Stack %s complete' % operation) break if '%s_ROLLBACK_COMPLETE' % operation == stack.stack_status: - result = dict(changed=True, + result = dict(changed=True, failed=True, events = map(str, list(stack.describe_events())), output = 'Problem with %s. Rollback complete' % operation) break elif '%s_FAILED' % operation == stack.stack_status: - result = dict(changed=False, + result = dict(changed=True, failed=True, events = map(str, list(stack.describe_events())), output = 'Stack %s failed' % operation) break