PY34 support change iteritems to items

At the momemt plugins using the L3GW code are unable to support
python 3.4 due to this issue.

Closes-bug: #1599795

Change-Id: I5894485e55c04a8ca69825128798227714550c9d
stable/ocata
Gary Kotton 7 years ago
parent f4074dd401
commit cdfe0f5955
  1. 2
      networking_l2gw/db/l2gateway/db_query.py
  2. 2
      networking_l2gw/db/l2gateway/l2gateway_db.py
  3. 2
      networking_l2gw/tests/scenario/test_l2gateways.py

@ -26,7 +26,7 @@ class L2GatewayCommonDbMixin(object):
def _apply_filters_to_query(self, query, model, filters):
"""Apply filters to query for the models."""
if filters:
for key, value in filters.iteritems():
for key, value in filters.items():
column = getattr(model, key, None)
if column:
query = query.filter(column.in_(value))

@ -130,7 +130,7 @@ class L2GatewayMixin(l2gateway.L2GatewayPluginBase,
def _retrieve_gateway_connections(self, context, gateway_id,
mapping_info={}, only_one=False):
filters = {'l2_gateway_id': [gateway_id]}
for k, v in mapping_info.iteritems():
for k, v in mapping_info.items():
if v and k != constants.SEG_ID:
filters[k] = [v]
query = self._get_collection_query(context,

@ -260,7 +260,7 @@ class TestL2GatewayBasic(base.BaseAdminNetworkTest):
ip = port['ports'][i]['fixed_ips'][0]['ip_address']
ip_mac_dict.update({mac: ip})
try:
for key, value in ip_mac_dict.iteritems():
for key, value in ip_mac_dict.items():
row = objConnection.find_row(key, count_uuid, resp_dec)
self.assertIn(value, row)
except Exception:

Loading…
Cancel
Save