respect auto approve
This commit is contained in:
parent
95aaccb647
commit
9a70deb4ee
2 changed files with 7 additions and 5 deletions
2
build.py
2
build.py
|
@ -28,7 +28,7 @@ use_plugin("python.distutils")
|
|||
default_task = "publish"
|
||||
|
||||
name = "ddadevops"
|
||||
version = "0.4.2.dev0"
|
||||
version = "0.4.2.dev1"
|
||||
summary = "tools to support builds combining gopass, terraform, dda-pallet, aws & hetzner-cloud"
|
||||
description = __doc__
|
||||
authors = [Author("meissa GmbH", "buero@meissa-gmbh.de")]
|
||||
|
|
|
@ -103,15 +103,17 @@ class DevopsTerraformBuild(DevopsBuild):
|
|||
def apply(self, p_auto_approve=False):
|
||||
tf = self.init_client()
|
||||
self.print_terraform_command('apply')
|
||||
kwargs = {"auto-approve": p_auto_approve}
|
||||
tf.apply(capture_output=False, var=self.project_vars(),**kwargs)
|
||||
tf.apply(capture_output=False, var=self.project_vars(),skip_plan=p_auto_approve)
|
||||
self.write_output(tf)
|
||||
|
||||
def destroy(self, p_auto_approve=False):
|
||||
tf = self.init_client()
|
||||
self.print_terraform_command('destroy')
|
||||
kwargs = {"auto-approve": p_auto_approve}
|
||||
tf.destroy(capture_output=False, var=self.project_vars(),**kwargs)
|
||||
if p_auto_approve:
|
||||
force=IsFlagged
|
||||
else:
|
||||
force=None
|
||||
tf.destroy(capture_output=False, force=force, var=self.project_vars())
|
||||
|
||||
def tf_import(self, tf_import_name, tf_import_resource,):
|
||||
tf = self.init_client()
|
||||
|
|
Loading…
Reference in a new issue