From e9255b118c76c84ba2c7bf1a940c119f397ab2a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marwan=20Rabb=C3=A2a?= Date: Fri, 24 Nov 2017 22:03:56 +0100 Subject: [PATCH] add force param to terraform apply --- python_terraform/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/python_terraform/__init__.py b/python_terraform/__init__.py index 3d33a28..c3ef955 100644 --- a/python_terraform/__init__.py +++ b/python_terraform/__init__.py @@ -84,7 +84,7 @@ class Terraform(object): return wrapper - def apply(self, dir_or_plan=None, input=False, no_color=IsFlagged, + 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 @@ -92,12 +92,14 @@ class Terraform(object): :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 + default['auto-approve'] = (skip_plan == True) option_dict = self._generate_default_options(default) args = self._generate_default_args(dir_or_plan) return self.cmd('apply', *args, **option_dict)