summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.pylintrc1
-rw-r--r--neutron/agent/l3/router_info.py6
-rw-r--r--neutron/tests/unit/agent/dhcp/test_agent.py10
-rw-r--r--neutron/tests/unit/agent/l3/test_agent.py6
-rw-r--r--neutron/tests/unit/agent/linux/test_dhcp.py15
5 files changed, 18 insertions, 20 deletions
diff --git a/.pylintrc b/.pylintrc
index 13b1554075..e4ee68d077 100644
--- a/.pylintrc
+++ b/.pylintrc
@@ -87,7 +87,6 @@ disable=
too-many-return-statements,
too-many-statements,
# new for python3 version of pylint
- consider-using-dict-comprehension,
consider-using-set-comprehension,
unnecessary-pass,
useless-object-inheritance
diff --git a/neutron/agent/l3/router_info.py b/neutron/agent/l3/router_info.py
index 38a459f3bc..1d1b412b75 100644
--- a/neutron/agent/l3/router_info.py
+++ b/neutron/agent/l3/router_info.py
@@ -1189,8 +1189,8 @@ class RouterInfo(object):
# Update ex_gw_port on the router info cache
self.ex_gw_port = self.get_ex_gw_port()
- self.fip_map = dict([(fip['floating_ip_address'],
- fip['fixed_ip_address'])
- for fip in self.get_floating_ips()])
+ self.fip_map = dict((fip['floating_ip_address'],
+ fip['fixed_ip_address'])
+ for fip in self.get_floating_ips())
self.fip_managed_by_port_forwardings = self.router.get(
'fip_managed_by_port_forwardings')
diff --git a/neutron/tests/unit/agent/dhcp/test_agent.py b/neutron/tests/unit/agent/dhcp/test_agent.py
index 3b46a3a070..a7f5132e8e 100644
--- a/neutron/tests/unit/agent/dhcp/test_agent.py
+++ b/neutron/tests/unit/agent/dhcp/test_agent.py
@@ -308,9 +308,9 @@ class TestDhcpAgent(base.BaseTestCase):
with mock.patch(DEVICE_MANAGER):
dhcp = dhcp_agent.DhcpAgent(HOSTNAME)
attrs_to_mock = dict(
- [(a, mock.DEFAULT) for a in
- ['periodic_resync', 'start_ready_ports_loop',
- '_process_loop']])
+ (a, mock.DEFAULT) for a in
+ ['periodic_resync', 'start_ready_ports_loop',
+ '_process_loop'])
with mock.patch.multiple(dhcp, **attrs_to_mock) as mocks:
with mock.patch.object(dhcp_agent.eventlet,
'spawn_n') as spawn_n:
@@ -380,9 +380,9 @@ class TestDhcpAgent(base.BaseTestCase):
dhcp = dhcp_agent.DhcpAgent(HOSTNAME)
- attrs_to_mock = dict([(a, mock.DEFAULT)
+ attrs_to_mock = dict((a, mock.DEFAULT)
for a in ['disable_dhcp_helper', 'cache',
- 'safe_configure_dhcp_for_network']])
+ 'safe_configure_dhcp_for_network'])
with mock.patch.multiple(dhcp, **attrs_to_mock) as mocks:
mocks['cache'].get_network_ids.return_value = known_net_ids
diff --git a/neutron/tests/unit/agent/l3/test_agent.py b/neutron/tests/unit/agent/l3/test_agent.py
index 752b4c3574..755a6fff77 100644
--- a/neutron/tests/unit/agent/l3/test_agent.py
+++ b/neutron/tests/unit/agent/l3/test_agent.py
@@ -1730,9 +1730,9 @@ class TestBasicRouterOperations(BasicRouterOperationsFramework):
p = ri.external_gateway_nat_fip_rules
s = ri.external_gateway_nat_snat_rules
attrs_to_mock = dict(
- [(a, mock.DEFAULT) for a in
- ['external_gateway_nat_fip_rules',
- 'external_gateway_nat_snat_rules']]
+ (a, mock.DEFAULT) for a in
+ ['external_gateway_nat_fip_rules',
+ 'external_gateway_nat_snat_rules']
)
with mock.patch.multiple(ri, **attrs_to_mock) as mocks:
mocks['external_gateway_nat_fip_rules'].side_effect = p
diff --git a/neutron/tests/unit/agent/linux/test_dhcp.py b/neutron/tests/unit/agent/linux/test_dhcp.py
index b4a7e8bb12..5c55866afd 100644
--- a/neutron/tests/unit/agent/linux/test_dhcp.py
+++ b/neutron/tests/unit/agent/linux/test_dhcp.py
@@ -1134,8 +1134,7 @@ class TestDhcpLocalProcess(TestBase):
@mock.patch.object(fileutils, 'ensure_tree')
def test_enable(self, ensure_dir):
attrs_to_mock = dict(
- [(a, mock.DEFAULT) for a in
- ['active', 'interface_name']]
+ (a, mock.DEFAULT) for a in ['active', 'interface_name']
)
with mock.patch.multiple(LocalChild, **attrs_to_mock) as mocks:
@@ -1158,8 +1157,8 @@ class TestDhcpLocalProcess(TestBase):
self.assertTrue(self.external_process().disable.called)
def test_disable_not_active(self):
- attrs_to_mock = dict([(a, mock.DEFAULT) for a in
- ['active', 'interface_name']])
+ attrs_to_mock = dict((a, mock.DEFAULT) for a in
+ ['active', 'interface_name'])
with mock.patch.multiple(LocalChild, **attrs_to_mock) as mocks:
mocks['active'].__get__ = mock.Mock(return_value=False)
mocks['interface_name'].__get__ = mock.Mock(return_value='tap0')
@@ -1176,8 +1175,8 @@ class TestDhcpLocalProcess(TestBase):
delete_ns.assert_called_with('qdhcp-ns')
def test_disable_retain_port(self):
- attrs_to_mock = dict([(a, mock.DEFAULT) for a in
- ['active', 'interface_name']])
+ attrs_to_mock = dict((a, mock.DEFAULT) for a in
+ ['active', 'interface_name'])
network = FakeDualNetwork()
with mock.patch.multiple(LocalChild, **attrs_to_mock) as mocks:
mocks['active'].__get__ = mock.Mock(return_value=True)
@@ -1318,8 +1317,8 @@ class TestDnsmasq(TestBase):
self.execute.return_value = ('', '')
attrs_to_mock = dict(
- [(a, mock.DEFAULT) for a in
- ['_output_opts_file', 'get_conf_file_name', 'interface_name']]
+ (a, mock.DEFAULT) for a in
+ ['_output_opts_file', 'get_conf_file_name', 'interface_name']
)
test_pm = mock.Mock()