fix command exit code reporting

This commit is contained in:
lilydjwg 2012-12-15 18:41:03 +08:00
parent f29833ca67
commit ee21aec66a

View file

@ -73,9 +73,10 @@ class RepoMan:
p.set_exit_callback(partial(self.command_done, callbacks)) p.set_exit_callback(partial(self.command_done, callbacks))
def command_done(self, callbacks, status): def command_done(self, callbacks, status):
if status == 0 and callbacks: if status == 0:
for cb in callbacks: if callbacks:
cb() for cb in callbacks:
cb()
logging.info('previous command done.') logging.info('previous command done.')
else: else:
logging.warn('previous command failed with status code %d.', status) logging.warn('previous command failed with status code %d.', status)