Merge "Make dict.keys() PY3 compatible"

This commit is contained in:
Jenkins 2016-06-24 15:15:53 +00:00 committed by Gerrit Code Review
commit 46f7142313
2 changed files with 8 additions and 1 deletions

View File

@ -125,7 +125,7 @@ class BackupManager(manager.SchedulerDependentManager):
if 'default' not in self.volume_managers:
# For multi-backend we just pick the top of the list.
return self.volume_managers.keys()[0]
return next(iter(self.volume_managers))
return 'default'

View File

@ -348,6 +348,13 @@ class BackupTestCase(BaseBackupTest):
def test_is_working(self):
self.assertTrue(self.backup_mgr.is_working())
def test_get_volume_backend(self):
backup_mgr = manager.BackupManager()
backup_mgr.volume_managers = {'backend1': 'backend1',
'backend2': 'backend2'}
backend = backup_mgr._get_volume_backend(allow_null_host=True)
self.assertIn(backend, backup_mgr.volume_managers)
def test_cleanup_incomplete_backup_operations_with_exceptions(self):
"""Test cleanup resilience in the face of exceptions."""