Helper class to run a command and store the output.
"""
- def __init__(self, command):
+ def __init__(self, command, nextcommand=None):
self._command = command
+ self._next = nextcommand
self._stdout = None
self._stderr = None
self._status = None
self._status = subproc.returncode
self._stdout = output[0]
self._stderr = output[1]
-
+ if self._next:
+ self._next.run()
return self
@property
cmd_str = 'tar -C %s -xf %s' % (dest_dir, archive)
else:
pass
- CommandRunner(cmd_str).run()
+ return CommandRunner(cmd_str)
def apply_sources(self):
if not self._sources:
for dest, url in self._sources.iteritems():
tmp_name = self._url_to_tmp_filename(url)
cmd_str = 'wget -O %s %s' % (tmp_name, url)
- CommandRunner(cmd_str).run()
+ decompress_command = self._decompress(tmp_name, dest)
+ CommandRunner(cmd_str, decompress_command).run()
try:
os.makedirs(dest)
except OSError as e:
logger.debug(str(e))
else:
logger.exception(e)
- self._decompress(tmp_name, dest)
class ServicesHandler(object):