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
This commit is contained in:
parent
5be084393b
commit
211c390404
|
@ -134,7 +134,7 @@ class OvsdbIdl(api.API):
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def _ovs(self):
|
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):
|
def transaction(self, check_error=False, log_errors=True, **kwargs):
|
||||||
return Transaction(self, OvsdbIdl.ovsdb_connection,
|
return Transaction(self, OvsdbIdl.ovsdb_connection,
|
||||||
|
|
|
@ -144,7 +144,7 @@ class DbGetCommand(DbCommand):
|
||||||
DbCommand.result.fset(self, val)
|
DbCommand.result.fset(self, val)
|
||||||
# DbCommand will return [{'column': value}] and we just want value.
|
# DbCommand will return [{'column': value}] and we just want value.
|
||||||
if self._result:
|
if self._result:
|
||||||
self._result = self._result[0].values()[0]
|
self._result = list(self._result[0].values())[0]
|
||||||
|
|
||||||
|
|
||||||
class BrExistsCommand(DbCommand):
|
class BrExistsCommand(DbCommand):
|
||||||
|
|
Loading…
Reference in New Issue