From 5278f7344b5b6220ba967e1d0cc0edfbd15ded90 Mon Sep 17 00:00:00 2001 From: Jan Grewe Date: Wed, 24 Jan 2018 11:55:54 +0100 Subject: [PATCH] Don't print a warning if there is no message Only output a warning for return code 2 (changes to be applied) if stderr actually contains a string. --- python_terraform/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python_terraform/__init__.py b/python_terraform/__init__.py index e207be3..af13f22 100644 --- a/python_terraform/__init__.py +++ b/python_terraform/__init__.py @@ -296,7 +296,7 @@ def cmd(self, cmd, *args, **kwargs): if ret_code == 0: self.read_state_file() - else: + elif (ret_code == 2 and len(err) > 0) or ret_code != 2: log.warn('error: {e}'.format(e=err)) self.temp_var_files.clean_up()