From 8efec09f6f6773ff1c69bd7ee0cfdf544d2fb008 Mon Sep 17 00:00:00 2001 From: Graham Hargreaves Date: Fri, 23 Sep 2022 15:38:29 +0100 Subject: [PATCH] fix: Handle terraform crashes (#58) When Terraform crashes the error code is 11 not 1. --- tftest.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tftest.py b/tftest.py index 8f1dcb5..0be6857 100644 --- a/tftest.py +++ b/tftest.py @@ -579,7 +579,7 @@ def execute_command(self, cmd, *cmd_args): raise TerraformTestError('Terraform executable not found: %s' % e) out, err = p.communicate() full_output = "".join(full_output_lines) - if retcode == 1: + if retcode in [1, 11]: message = 'Error running command {command}: {retcode} {out} {err}'.format( command=cmd, retcode=retcode, out=full_output, err=err) _LOGGER.critical(message)