Move displayed checker title to be in variable

Title of check command displayed to user is now moved
to be defined as atribute of UpgradeCommands class.
This will allow to override this command for projects which
inherits from this class.

This will be usefull for Neutron to use same class in new
sanity-check tool which will be implemented in same way as
upgrade-check is done.

Change-Id: I8218b21a219db3a3198750fd98033aff244b7002
Related-Bug: #1809878
This commit is contained in:
Slawek Kaplonski 2019-02-07 16:28:30 +01:00
parent 226d9b14d3
commit 1829c08e5a
1 changed files with 2 additions and 2 deletions

View File

@ -75,6 +75,7 @@ class UpgradeCommands(object):
done through the sqlalchemy query language directly like the database
schema migrations.
"""
display_title = _('Upgrade Check Results')
_upgrade_checks = ()
def _get_details(self, upgrade_check_result):
@ -120,8 +121,7 @@ class UpgradeCommands(object):
# NOTE(bnemec): We use six.text_type on the translated string to
# force immediate translation if lazy translation is in use.
# See lp1801761 for details.
t = prettytable.PrettyTable([six.text_type(_('Upgrade Check Results'))
],
t = prettytable.PrettyTable([six.text_type(self.display_title)],
hrules=prettytable.ALL)
t.align = 'l'
for name, result in check_results: