fix handling no environement file

Signed-off-by: Jakub Sokołowski <jakub@status.im>
This commit is contained in:
Jakub Sokołowski 2019-02-16 01:11:30 +01:00
parent d4e7d2bea0
commit 933b631739
No known key found for this signature in database
GPG Key ID: 4EF064D0E6D63020
1 changed files with 5 additions and 2 deletions

View File

@ -8,8 +8,11 @@ import sys
def _tf_env():
# way to figure out currenly used TF workspace
with open(TERRAFORM_ENV) as f:
return f.read()
try:
with open(TERRAFORM_ENV) as f:
return f.read()
except:
return 'default'
TERRAFORM_PATH = os.environ.get('ANSIBLE_TF_BIN', 'terraform')
TERRAFORM_DIR = os.environ.get('ANSIBLE_TF_DIR', os.getcwd())