Capture exit code from upgrade process, use it to indicate success/fail
This commit is contained in:
parent
0c52a5c70f
commit
3aad95ad9a
|
@ -63,10 +63,11 @@ class UpgradeHandler(object):
|
||||||
cmd = self.config.upgrade_command()
|
cmd = self.config.upgrade_command()
|
||||||
with open(stdout_path, 'wb') as stdout:
|
with open(stdout_path, 'wb') as stdout:
|
||||||
with open(stderr_path, 'wb') as stderr:
|
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')
|
after_path = self.config.upgrade_filepath(upgrade.uuid, filename='requirements.after.txt')
|
||||||
self.record_requirements_snapshot(after_path)
|
self.record_requirements_snapshot(after_path)
|
||||||
|
return upgrade.exit_code == 0
|
||||||
|
|
||||||
def record_requirements_snapshot(self, path):
|
def record_requirements_snapshot(self, path):
|
||||||
pip = self.get_pip_path()
|
pip = self.get_pip_path()
|
||||||
|
|
Loading…
Reference in a new issue