Skip to content

Commit

Permalink
[cli][bug] fixing bug related terraform not being installed. resolves…
Browse files Browse the repository at this point in the history
… issue #200
  • Loading branch information
ryandeivert committed Jun 26, 2017
1 parent 68ace7f commit fb0bfec
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 fb0bfec

Please sign in to comment.