Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Add the command that failed to the error log and the error email to h…

…elp debug problems where the error produces no output.
  • Loading branch information...
commit ba3544fc18d5c5e827b1c1777b7811201545a8c5 1 parent ddd1f9c
walsh159 authored
Showing with 4 additions and 2 deletions.
  1. +4 −2 boto/pyami/scriptbase.py
View
6 boto/pyami/scriptbase.py
@@ -30,9 +30,11 @@ def umount(self, path):
def run(self, command, notify=True, exit_on_error=False):
self.last_command = ShellCommand(command)
if self.last_command.status != 0:
- boto.log.error(self.last_command.output)
+ boto.log.error('Error running command: "%s". Output: "%s"' % (command, self.last_command.output))
if notify:
- self.notify('Error encountered', self.last_command.output)
+ self.notify('Error encountered', \
+ 'Error running the following command:\n\t%s\n\nCommand output:\n\t%s' % \
+ (command, self.last_command.output))
if exit_on_error:
sys.exit(-1)
return self.last_command.status
Please sign in to comment.
Something went wrong with that request. Please try again.