Merge "Refactor redundant exception type checking"

This commit is contained in:
Zuul 2020-03-10 16:34:33 +00:00 committed by Gerrit Code Review
commit e98b0c9611
1 changed files with 8 additions and 9 deletions

View File

@ -1416,15 +1416,14 @@ class Deploy(command.Command):
).lower()
if not prompt_response.startswith('y'):
raise exceptions.UndercloudUpgradeNotConfirmed(unconf_msg)
except (KeyboardInterrupt, EOFError) as e:
if e.__class__ == KeyboardInterrupt:
# ctrl-c
raise exceptions.UndercloudUpgradeNotConfirmed("(ctrl-c) %s" %
unconf_msg)
else:
# ctrl-d
raise exceptions.UndercloudUpgradeNotConfirmed("(ctrl-d) %s" %
unconf_msg)
except KeyboardInterrupt:
# ctrl-c
raise exceptions.UndercloudUpgradeNotConfirmed("(ctrl-c) %s" %
unconf_msg)
except EOFError:
# ctrl-d
raise exceptions.UndercloudUpgradeNotConfirmed("(ctrl-d) %s" %
unconf_msg)
try:
if parsed_args.standalone: