Skip to content

Commit

Permalink
Fix backports
Browse files Browse the repository at this point in the history
(cherry picked from commit deb3bc7)
  • Loading branch information
Alex-Welsh authored and mnasiadka committed Sep 7, 2023
1 parent b4a9c39 commit 1704f74
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 45 deletions.
1 change: 1 addition & 0 deletions networking_generic_switch/devices/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
{'name': 'ngs_network_name_format', 'default': '{network_id}'},
# If false, ngs will not add and delete VLANs from switches
{'name': 'ngs_manage_vlans', 'default': True},
{'name': 'vlan_translation_supported', 'default': False},
# If False, ngs will skip saving configuration on devices
{'name': 'ngs_save_configuration', 'default': True},
# When true try to batch up in flight switch requests
Expand Down
45 changes: 0 additions & 45 deletions networking_generic_switch/tests/unit/netmiko/test_dell.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,51 +21,6 @@
from networking_generic_switch.tests.unit.netmiko import test_netmiko_base


class TestNetmikoDellOS10(test_netmiko_base.NetmikoSwitchTestBase):

def _make_switch_device(self, extra_cfg={}):
device_cfg = {'device_type': 'netmiko_dell_os10'}
device_cfg.update(extra_cfg)
return dell.DellOS10(device_cfg)

def test_get_trunk_port_cmds_no_vlan_translation(self):
mock_context = mock.create_autospec(driver_context.PortContext)
self.switch.ngs_config['vlan_translation_supported'] = True
trunk_details = {'trunk_id': 'aaa-bbb-ccc-ddd',
'sub_ports': [{'segmentation_id': 130,
'port_id': 'aaa-bbb-ccc-ddd',
'segmentation_type': 'vlan',
'mac_address': u'fa:16:3e:1c:c2:7e'}]}
mock_context.current = {'binding:profile':
{'local_link_information':
[
{
'switch_info': 'foo',
'port_id': '2222'
}
]
},
'binding:vnic_type': 'baremetal',
'id': 'aaaa-bbbb-cccc',
'trunk_details': trunk_details}
mock_context.network = mock.Mock()
mock_context.network.current = {'provider:segmentation_id': 123}
mock_context.segments_to_bind = [
{
'segmentation_id': 777,
'id': 123
}
]
res = self.switch.get_trunk_port_cmds_no_vlan_translation(
'2222', 777, trunk_details)
self.assertEqual(['interface 2222', 'switchport mode access',
'switchport mode trunk',
'switchport access vlan 777',
'interface 2222',
'switchport trunk allowed vlan 130'],
res)


class TestNetmikoDellNos(test_netmiko_base.NetmikoSwitchTestBase):

def _make_switch_device(self, extra_cfg={}):
Expand Down

0 comments on commit 1704f74

Please sign in to comment.