From 42b4f18b3fa8795abb1a42cbfff4366146cc60a2 Mon Sep 17 00:00:00 2001 From: bom Date: Wed, 12 Jan 2022 15:00:30 +0100 Subject: [PATCH] fixed destroy test --- python_terraform/terraform.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python_terraform/terraform.py b/python_terraform/terraform.py index b5aae6c..753f410 100644 --- a/python_terraform/terraform.py +++ b/python_terraform/terraform.py @@ -155,7 +155,10 @@ class Terraform: """ global_opts = self._generate_default_general_options(dir_or_plan) default = kwargs.copy() - default["force"] = force + # force is no longer a flag in version >= 1.0 + if self.terraform_version < 1.0: + default["force"] = force + default["auto-approve"] = True options = self._generate_default_options(default) args = self._generate_default_args(dir_or_plan) return self.cmd(global_opts, "destroy", *args, **options)