Fix iteritems in pretty_print_upgrade_path for py3

Partial-Bug: #1735720
Change-Id: Ib31c3bc5336cd150fd7a283254454466accd3873
This commit is contained in:
Liam Young 2017-12-01 13:18:13 +00:00
parent e1a0b3558b
commit 9a883e7dad
2 changed files with 6 additions and 1 deletions

View File

@ -2171,7 +2171,7 @@ UCA_CODENAME_MAP = {
def pretty_print_upgrade_paths():
"""Pretty print supported upgrade paths for ceph"""
return ["{} -> {}".format(key, value)
for key, value in UPGRADE_PATHS.iteritems()]
for key, value in UPGRADE_PATHS.items()]
def resolve_ceph_version(source):

View File

@ -506,6 +506,11 @@ class CephTestCase(unittest.TestCase):
with self.assertRaises(Exception):
utils.osd_noout(True)
def test_pretty_print_upgrade_paths(self):
expected = (['firefly -> hammer', 'jewel -> luminous',
'hammer -> jewel'])
self.assertEqual(utils.pretty_print_upgrade_paths(), expected)
class CephVersionTestCase(unittest.TestCase):
@patch.object(utils, 'get_os_codename_install_source')