1. fix typo

2. fix false bool value will skip
3. fix print to log
This commit is contained in:
Freddy Tan 2016-12-21 00:18:57 +08:00
parent 26f8aee018
commit 211e73a109

View file

@ -51,7 +51,7 @@ class Terraform(object):
self.terraform_bin_path = terraform_bin_path \ self.terraform_bin_path = terraform_bin_path \
if terraform_bin_path else 'terraform' if terraform_bin_path else 'terraform'
self.var_file = var_file self.var_file = var_file
self.temp_var_files = VaribleFiles() self.temp_var_files = VariableFiles()
# store the tfstate data # store the tfstate data
self.tfstate = None self.tfstate = None
@ -59,7 +59,7 @@ class Terraform(object):
def __getattr__(self, item): def __getattr__(self, item):
def wrapper(*args, **kwargs): 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 self.cmd(item, *args, **kwargs)
return wrapper return wrapper
@ -152,12 +152,12 @@ class Terraform(object):
if v is IsNotFlagged: if v is IsNotFlagged:
continue continue
if not v:
continue
if type(v) is bool: if type(v) is bool:
v = 'true' if v else 'false' v = 'true' if v else 'false'
if not v:
continue
cmds += ['-{k}={v}'.format(k=k, v=v)] cmds += ['-{k}={v}'.format(k=k, v=v)]
cmds += args cmds += args
@ -239,7 +239,7 @@ class Terraform(object):
self.temp_var_files.clean_up() self.temp_var_files.clean_up()
class VaribleFiles(object): class VariableFiles(object):
def __init__(self): def __init__(self):
self.files = [] self.files = []