From: Szymon Wroblewski Date: Thu, 20 Aug 2015 11:44:08 +0000 (+0200) Subject: Python 3 incompatible expression fix X-Git-Url: https://review.fuel-infra.org/gitweb?a=commitdiff_plain;h=de14a81b7370f4af954bc3c533947f51686fe5f5;p=openstack-build%2Fcinder-build.git Python 3 incompatible expression fix In Python 3 dict.keys() return iterable view which does not support indexing. This patch fixes the issue by using appropriate iterator functions. Implements: bp cinder-python3 Change-Id: Ib31531e5890fb050ce3c03ea0a078afd2122abe4 --- diff --git a/cinder/backup/manager.py b/cinder/backup/manager.py index b77b24a31..4cbbf87c3 100644 --- a/cinder/backup/manager.py +++ b/cinder/backup/manager.py @@ -120,8 +120,8 @@ class BackupManager(manager.SchedulerDependentManager): host) if 'default' not in self.volume_managers: - # For multi-backend we just pick the top of the list. - return self.volume_managers.keys()[0] + # For multi-backend we just pick "first" from volume managers dict + return next(iter(self.volume_managers)) return 'default'