Capture exit code from upgrade process, use it to indicate success/fail

This commit is contained in:
Lance Edgar 2017-08-08 20:31:22 -05:00
parent 0c52a5c70f
commit 3aad95ad9a

View file

@ -63,10 +63,11 @@ class UpgradeHandler(object):
cmd = self.config.upgrade_command()
with open(stdout_path, 'wb') as stdout:
with open(stderr_path, 'wb') as stderr:
subprocess.call(cmd, stdout=stdout, stderr=stderr)
upgrade.exit_code = subprocess.call(cmd, stdout=stdout, stderr=stderr)
after_path = self.config.upgrade_filepath(upgrade.uuid, filename='requirements.after.txt')
self.record_requirements_snapshot(after_path)
return upgrade.exit_code == 0
def record_requirements_snapshot(self, path):
pip = self.get_pip_path()