From de14a81b7370f4af954bc3c533947f51686fe5f5 Mon Sep 17 00:00:00 2001 From: Szymon Wroblewski Date: Thu, 20 Aug 2015 13:44:08 +0200 Subject: [PATCH] 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 --- cinder/backup/manager.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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' -- 2.45.2