Skip to content

Commit

Permalink
Merge pull request #202 from airbnb/ryandeivert-bug-fix-200
Browse files Browse the repository at this point in the history
[cli][bug] fixing bug related terraform not being installed. resolves #200
  • Loading branch information
ryandeivert authored Jun 27, 2017
2 parents a9a7e3f + b6ffa9e commit 2abbcb3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
3 changes: 3 additions & 0 deletions stream_alert_cli/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,9 @@ def run_command(runner_args, **kwargs):
except subprocess.CalledProcessError as err:
LOGGER_CLI.error('%s\n%s', error_message, err.cmd)
return False
except OSError as err:
LOGGER_CLI.error('%s\n%s (%s)', error_message, err.strerror, runner_args[0])
return False

return True

Expand Down
7 changes: 4 additions & 3 deletions stream_alert_cli/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,9 +84,9 @@ def lambda_handler(options):

def terraform_check():
"""Verify that Terraform is configured correctly"""
prereqs_message = ('Terraform not found! Please install and add to'
prereqs_message = ('Terraform not found! Please install and add to '
'your $PATH:\n'
'$ export PATH=$PATH:/usr/local/terraform/bin')
'\t$ export PATH=$PATH:/usr/local/terraform/bin')
run_command(['terraform', 'version'],
error_message=prereqs_message,
quiet=True)
Expand All @@ -95,7 +95,8 @@ def terraform_check():
def terraform_handler(options):
"""Handle all Terraform CLI operations"""
# verify terraform is installed
terraform_check()
if not terraform_check():
return
# use a named tuple to match the 'processor' attribute in the argparse options
deploy_opts = namedtuple('DeployOptions', ['processor'])

Expand Down

0 comments on commit 2abbcb3

Please sign in to comment.