Revert "Nit: Change from dict to object notation"
This reverts commit feec91cec1
. Turns out
this wasn't okay, sub_ports property on Trunk objects is a list of
dictionaries.
This also fixes unit tests to account for that.
Change-Id: I17f217a6f2bfc833019ba407c248564e74b663d2
This commit is contained in:
parent
6b4992e585
commit
9cd15b6d37
@ -306,6 +306,6 @@ class NestedVlanPodVIFDriver(nested_vif.NestedPodVIFDriver):
|
||||
os_net = clients.get_network_client()
|
||||
trunk = os_net.get_trunk(trunk_id)
|
||||
for port in trunk.sub_ports:
|
||||
vlan_ids.add(port.segmentation_id)
|
||||
vlan_ids.add(port['segmentation_id'])
|
||||
|
||||
return vlan_ids
|
||||
|
@ -644,7 +644,7 @@ class TestNestedVlanPodVIFDriver(test_base.TestCase):
|
||||
trunk_id = mock.sentinel.trunk_id
|
||||
vlan_ids.add('100')
|
||||
|
||||
port = os_port.Port(segmentation_id='100')
|
||||
port = {"segmentation_id": '100'} # Trunk.sub_ports is a list of dicts
|
||||
trunk_obj = os_trunk.Trunk(sub_ports=[port])
|
||||
os_net.get_trunk.return_value = trunk_obj
|
||||
self.assertEqual(vlan_ids,
|
||||
|
Loading…
Reference in New Issue
Block a user