Permalink
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...
1 parent ddd1f9c commit ba3544fc18d5c5e827b1c1777b7811201545a8c5 walsh159 committed Dec 14, 2009
Showing with 4 additions and 2 deletions.
  1. +4 −2 boto/pyami/scriptbase.py
View
@@ -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

0 comments on commit ba3544f

Please sign in to comment.