From 211c390404ee048605bd81042f766fc0df18e053 Mon Sep 17 00:00:00 2001 From: Cyril Roelandt Date: Tue, 19 May 2015 16:16:38 +0000 Subject: [PATCH] Python 3: do not index a dict_values object In Python 3, dict.values() return a dict_values object instead of a list, as in Python 2. This object cannot be indexed. Change-Id: Ia4fdb4cafb1811c55dc8f14e303ab2db1b1110b3 Blueprint: neutron-python3 --- impl_idl.py | 2 +- impl_vsctl.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/impl_idl.py b/impl_idl.py index 45851f8d..57399fc0 100644 --- a/impl_idl.py +++ b/impl_idl.py @@ -134,7 +134,7 @@ class OvsdbIdl(api.API): @property def _ovs(self): - return self._tables['Open_vSwitch'].rows.values()[0] + return list(self._tables['Open_vSwitch'].rows.values())[0] def transaction(self, check_error=False, log_errors=True, **kwargs): return Transaction(self, OvsdbIdl.ovsdb_connection, diff --git a/impl_vsctl.py b/impl_vsctl.py index 4fd8937d..3351a100 100644 --- a/impl_vsctl.py +++ b/impl_vsctl.py @@ -144,7 +144,7 @@ class DbGetCommand(DbCommand): DbCommand.result.fset(self, val) # DbCommand will return [{'column': value}] and we just want value. if self._result: - self._result = self._result[0].values()[0] + self._result = list(self._result[0].values())[0] class BrExistsCommand(DbCommand):