/usr/lib/python2.6/site-packages/boto/pyami
NameSizeModeActions
installers/-0755rm
bootstrap.py57480644editdlrm
bootstrap.pyc49700644editdlrm
bootstrap.pyo49700644editdlrm
config.py80040644editdlrm
config.pyc78620644editdlrm
config.pyo78620644editdlrm
copybot.cfg17070644editdlrm
copybot.py42610644editdlrm
copybot.pyc39670644editdlrm
copybot.pyo39670644editdlrm
helloworld.py12380644editdlrm
helloworld.pyc6180644editdlrm
helloworld.pyo6180644editdlrm
launch_ami.py75850644editdlrm
launch_ami.pyc65700644editdlrm
launch_ami.pyo65700644editdlrm
scriptbase.py14270644editdlrm
scriptbase.pyc25020644editdlrm
scriptbase.pyo25020644editdlrm
startup.py24750644editdlrm
startup.pyc18990644editdlrm
startup.pyo18990644editdlrm
__init__.py11070644editdlrm
__init__.pyc1420644editdlrm
__init__.pyo1420644editdlrm
Edit: /usr/lib/python2.6/site-packages/boto/pyami/scriptbase.py (1427B)
import os import sys from boto.utils import ShellCommand, get_ts import boto import boto.utils class ScriptBase(object): def __init__(self, config_file=None): self.instance_id = boto.config.get('Instance', 'instance-id', 'default') self.name = self.__class__.__name__ self.ts = get_ts() if config_file: boto.config.read(config_file) def notify(self, subject, body=''): boto.utils.notify(subject, body) def mkdir(self, path): if not os.path.isdir(path): try: os.mkdir(path) except: boto.log.error('Error creating directory: %s' % path) def umount(self, path): if os.path.ismount(path): self.run('umount %s' % path) def run(self, command, notify=True, exit_on_error=False, cwd=None): self.last_command = ShellCommand(command, cwd=cwd) if self.last_command.status != 0: boto.log.error('Error running command: "%s". Output: "%s"' % (command, self.last_command.output)) if notify: 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 def main(self): pass