Skip to content
This repository has been archived by the owner on Jul 13, 2021. It is now read-only.

Commit

Permalink
Merge pull request #14 from upgrades-migrations/new_return_codes
Browse files Browse the repository at this point in the history
New return codes from preupgrade-assistant
  • Loading branch information
bocekm authored Aug 30, 2016
2 parents 9b617aa + 2fb5611 commit 6802dba
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions redhat-upgrade-tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -171,10 +171,10 @@ def main(args):
if not args.force:
# Run preupg --riskcheck
returncode = XccdfHelper.check_inplace_risk(get_preupgrade_result_name(), 0)
if int(returncode) == 0:
if int(returncode) < 12:
print _("Preupgrade assistant does not found any risks")
print _("Upgrade will continue.")
elif int(returncode) == 1:
elif int(returncode) == 12:
print _("Preupgrade assistant risk check found risks for this upgrade.")
print _("You can run preupg --riskcheck --verbose to view these risks.")
print _("Addressing high risk issues is required before the in-place upgrade")
Expand All @@ -190,6 +190,7 @@ def main(args):

global sigwinch
sigwinch = False

def handle_sigwinch(signum, frame):
global sigwinch
sigwinch = True
Expand All @@ -214,7 +215,7 @@ def handle_sigwinch(signum, frame):
# TRANSLATORS: y for yes
if answer.lower() != _('y'):
raise SystemExit(1)
elif int(returncode) == 2:
elif int(returncode) > 12:
print _("preupgrade-assistant risk check found EXTREME risks for this upgrade.")
print _("Run preupg --riskcheck --verbose to view these risks.")
print _("Continuing with this upgrade is not recommended.")
Expand Down

0 comments on commit 6802dba

Please sign in to comment.