From 211e73a1099388d1c6f842af37e7e1a16e71573f Mon Sep 17 00:00:00 2001 From: Freddy Tan Date: Wed, 21 Dec 2016 00:18:57 +0800 Subject: [PATCH] 1. fix typo 2. fix false bool value will skip 3. fix print to log --- python_terraform/__init__.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/python_terraform/__init__.py b/python_terraform/__init__.py index 9c1bc2c..e61ff00 100644 --- a/python_terraform/__init__.py +++ b/python_terraform/__init__.py @@ -51,7 +51,7 @@ class Terraform(object): self.terraform_bin_path = terraform_bin_path \ if terraform_bin_path else 'terraform' self.var_file = var_file - self.temp_var_files = VaribleFiles() + self.temp_var_files = VariableFiles() # store the tfstate data self.tfstate = None @@ -59,7 +59,7 @@ class Terraform(object): def __getattr__(self, item): def wrapper(*args, **kwargs): - print('called with %r and %r' % (args, kwargs)) + logging.debug('called with %r and %r' % (args, kwargs)) return self.cmd(item, *args, **kwargs) return wrapper @@ -152,12 +152,12 @@ class Terraform(object): if v is IsNotFlagged: continue - if not v: - continue - if type(v) is bool: v = 'true' if v else 'false' + if not v: + continue + cmds += ['-{k}={v}'.format(k=k, v=v)] cmds += args @@ -239,7 +239,7 @@ class Terraform(object): self.temp_var_files.clean_up() -class VaribleFiles(object): +class VariableFiles(object): def __init__(self): self.files = []