From d4257ea870a665f7d52fbedc225b56f6607d439d Mon Sep 17 00:00:00 2001 From: Freddy Tan Date: Tue, 24 May 2016 11:10:47 +0800 Subject: [PATCH] fix parameters string --- python_terraform/__init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/python_terraform/__init__.py b/python_terraform/__init__.py index ce1a649..fd2ce5b 100644 --- a/python_terraform/__init__.py +++ b/python_terraform/__init__.py @@ -39,7 +39,10 @@ class Terraform: def _gen_param_string(self, kargs): params = [] for key, value in kargs.items(): - params += ['%s=%s' % (key, value)] + if not value: + params += ['-%s=%s' % (key, value)] + else: + params += ['-%s' % key] return params def _run_cmd(self, cmd):