From 4b10f6876fc01c4ef8b5a3f3ec2baa31995e64a4 Mon Sep 17 00:00:00 2001 From: Brian Haley Date: Tue, 17 Mar 2020 16:48:59 -0400 Subject: [PATCH] Fix fake_meta_dvr_port initialization This generates a pylint warning: test_agent.py:149:0: E0237: Assigning to attribute 'device_owner' not defined in class slots (assigning-non-slot) The initialization looks a little odd, just do it directly to avoid the warning. Trivialfix Change-Id: Iabb553647b653f4e7b4344e5d2f872c0adc6c6f9 --- neutron/tests/unit/agent/dhcp/test_agent.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/neutron/tests/unit/agent/dhcp/test_agent.py b/neutron/tests/unit/agent/dhcp/test_agent.py index d850dff11ea..3811e6cbd4f 100644 --- a/neutron/tests/unit/agent/dhcp/test_agent.py +++ b/neutron/tests/unit/agent/dhcp/test_agent.py @@ -146,7 +146,7 @@ fake_meta_port = dhcp.DictModel(id='12345678-1234-aaaa-1234567890ab', fixed_ips=[fake_meta_fixed_ip]) fake_meta_dvr_port = dhcp.DictModel(fake_meta_port) -fake_meta_dvr_port.device_owner = const.DEVICE_OWNER_DVR_INTERFACE +fake_meta_dvr_port['device_owner'] = const.DEVICE_OWNER_DVR_INTERFACE fake_dist_port = dhcp.DictModel(id='12345678-1234-aaaa-1234567890ab', mac_address='aa:bb:cc:dd:ee:ff', @@ -199,7 +199,7 @@ fake_meta_network = dhcp.NetModel(id=FAKE_NETWORK_UUID, ports=[fake_meta_port]) fake_meta_dvr_network = dhcp.NetModel(fake_meta_network) -fake_meta_dvr_network.ports = [fake_meta_dvr_port] +fake_meta_dvr_network['ports'] = [fake_meta_dvr_port] fake_dist_network = dhcp.NetModel(id=FAKE_NETWORK_UUID, tenant_id=FAKE_TENANT_ID,