Skip to content

Commit

Permalink
terrabutler: tf.py: Add check for returncode for Terraform runner
Browse files Browse the repository at this point in the history
  • Loading branch information
MiguelNdeCarvalho committed Jul 13, 2022
1 parent 1260fbe commit bac8193
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions terrabutler/tf.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,11 @@ def terraform_command_runner(command, site, args=[], options=[],
try:
p = subprocess.Popen(args=command, cwd=site_dir)
p.wait()

if p.returncode != 0:
print(Fore.RED + "There was an error while running the terraform"
" command.")
exit(1)
except KeyboardInterrupt:
p.send_signal(signal.SIGINT)
p.wait()
Expand Down

0 comments on commit bac8193

Please sign in to comment.