From bc4375d999ae13982401ffee86298aa7cada2a22 Mon Sep 17 00:00:00 2001 From: jem Date: Fri, 10 Apr 2020 09:38:43 +0200 Subject: [PATCH] fix plan's exitcode 2 --- build.py | 2 +- .../ddadevops/devops_terraform_build.py | 46 +++++++++---------- 2 files changed, 24 insertions(+), 24 deletions(-) diff --git a/build.py b/build.py index f181585..23fe6b1 100644 --- a/build.py +++ b/build.py @@ -28,7 +28,7 @@ use_plugin("python.distutils") default_task = "publish" name = "ddadevops" -version = "0.5.0.dev0" +version = "0.5.0.dev1" summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud" description = __doc__ authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")] diff --git a/src/main/python/ddadevops/devops_terraform_build.py b/src/main/python/ddadevops/devops_terraform_build.py index 80da11e..742dd45 100644 --- a/src/main/python/ddadevops/devops_terraform_build.py +++ b/src/main/python/ddadevops/devops_terraform_build.py @@ -44,28 +44,28 @@ class WorkaroundTerraform(Terraform): var_file, terraform_bin_path, is_env_vars_included) self.latest_cmd = '' - def apply(self, dir_or_plan=None, input=False, skip_plan=False, no_color=IsFlagged, - **kwargs): - """ - refer to https://terraform.io/docs/commands/apply.html - no-color is flagged by default - :param no_color: disable color of stdout - :param input: disable prompt for a missing variable - :param dir_or_plan: folder relative to working folder - :param skip_plan: force apply without plan (default: false) - :param kwargs: same as kwags in method 'cmd' - :returns return_code, stdout, stderr - """ - default = kwargs - default['input'] = input - default['no_color'] = no_color - if skip_plan: - default['auto-approve'] = IsFlagged - else: - default['auto-approve'] = None - option_dict = self._generate_default_options(default) - args = self._generate_default_args(dir_or_plan) - return self.cmd('apply', *args, **option_dict) + # def apply(self, dir_or_plan=None, input=False, skip_plan=False, no_color=IsFlagged, + # **kwargs): + # """ + # refer to https://terraform.io/docs/commands/apply.html + # no-color is flagged by default + # :param no_color: disable color of stdout + # :param input: disable prompt for a missing variable + # :param dir_or_plan: folder relative to working folder + # :param skip_plan: force apply without plan (default: false) + # :param kwargs: same as kwags in method 'cmd' + # :returns return_code, stdout, stderr + # """ + # default = kwargs + # default['input'] = input + # default['no_color'] = no_color + # if skip_plan: + # default['auto-approve'] = IsFlagged + # else: + # default['auto-approve'] = None + # option_dict = self._generate_default_options(default) + # args = self._generate_default_args(dir_or_plan) + # return self.cmd('apply', *args, **option_dict) def generate_cmd_string(self, cmd, *args, **kwargs): result = super().generate_cmd_string(cmd, *args, **kwargs) @@ -149,7 +149,7 @@ class DevopsTerraformBuild(DevopsBuild): def plan(self): tf = self.init_client() - tf.plan(capture_output=False, raise_on_error=True, + tf.plan(capture_output=False, raise_on_error=False, var=self.project_vars(), var_file=self.additional_tfvar_files) self.print_terraform_command(tf)