From 47968e7214c381a78a2183050a9766546bac859d Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Wed, 1 Apr 2026 22:35:44 +0200 Subject: [PATCH 1/3] Fix GenericSwitchNotSupported exceptions These exceptions were not instantiated with the correct arguments, leading to a TypeError that was hiding the real issue (lack of support for trunks on ports or bonds). Closes-Bug: #2147055 Change-Id: Ifde3a65cb51a237801c49d4c443f222f320f6274 Signed-off-by: Pierre Riteau (cherry picked from commit eb205914be2801a358ee030f6fe48ad40174aad7) --- networking_generic_switch/generic_switch_mech.py | 9 +++++---- .../tests/unit/test_generic_switch_mech.py | 7 ++++++- ...icswitchnotsupported-exceptions-80fcdcaadb16ca7b.yaml | 7 +++++++ 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 releasenotes/notes/fix-genericswitchnotsupported-exceptions-80fcdcaadb16ca7b.yaml diff --git a/networking_generic_switch/generic_switch_mech.py b/networking_generic_switch/generic_switch_mech.py index 13621c21..72303108 100644 --- a/networking_generic_switch/generic_switch_mech.py +++ b/networking_generic_switch/generic_switch_mech.py @@ -394,16 +394,17 @@ def update_port_postcommit(self, context): if (trunk_details and not switch.support_trunk_on_bond_ports): raise ngs_exc.GenericSwitchNotSupported( - "Trunks are not supported by " - "networking-generic-switch %s.", - switch.device_name) + feature="trunks", + switch=switch.device_name, + error="Trunks are not supported on bond ports.") switch.plug_bond_to_network(port_id, segmentation_id, **plug_kwargs) else: if trunk_details and not switch.support_trunk_on_ports: raise ngs_exc.GenericSwitchNotSupported( feature="trunks", - switch=switch.device_name) + switch=switch.device_name, + error="Trunks are not supported on ports.") switch.plug_port_to_network(port_id, segmentation_id, **plug_kwargs) LOG.info("Successfully plugged port %(port_id)s in segment " diff --git a/networking_generic_switch/tests/unit/test_generic_switch_mech.py b/networking_generic_switch/tests/unit/test_generic_switch_mech.py index 2f946b0c..05c616bb 100644 --- a/networking_generic_switch/tests/unit/test_generic_switch_mech.py +++ b/networking_generic_switch/tests/unit/test_generic_switch_mech.py @@ -854,7 +854,12 @@ def test_update_port_postcommit_trunk_not_supported(self, m_pc, m_list): self.switch_mock.support_trunk_on_bond_ports = False self.switch_mock.support_trunk_on_ports = False - with self.assertRaises(exceptions.GenericSwitchNotSupported): + exception_regex = ( + 'Requested feature trunks is not supported by ' + 'networking-generic-switch on the .*. Trunks are not supported on ' + 'ports.') + with self.assertRaisesRegex(exceptions.GenericSwitchNotSupported, + exception_regex): driver.update_port_postcommit(mock_context) self.switch_mock.plug_port_to_network.assert_not_called() m_pc.assert_not_called() diff --git a/releasenotes/notes/fix-genericswitchnotsupported-exceptions-80fcdcaadb16ca7b.yaml b/releasenotes/notes/fix-genericswitchnotsupported-exceptions-80fcdcaadb16ca7b.yaml new file mode 100644 index 00000000..90b6d0c2 --- /dev/null +++ b/releasenotes/notes/fix-genericswitchnotsupported-exceptions-80fcdcaadb16ca7b.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Fixes incorrect instantiations of GenericSwitchNotSupported exceptions. See + `LP#2147055 + `__ for + details. From 7400ff89e5c149ae335fec926bf6d0488924772b Mon Sep 17 00:00:00 2001 From: Pierre Riteau Date: Wed, 1 Apr 2026 23:19:30 +0200 Subject: [PATCH 2/3] Add Dell OS10 bond trunk support Change-Id: Ic0cff059ca315aa3fd058d892a3c36f2da07eded Signed-off-by: Pierre Riteau (cherry picked from commit df7c0a29577d49ca89dbdd567e5a4ccfa21a0d8e) --- .../devices/netmiko_devices/dell.py | 37 +++++++++++++++++++ ...dell-os10-bond-trunk-8df03c8490ee94b0.yaml | 5 +++ 2 files changed, 42 insertions(+) create mode 100644 releasenotes/notes/dell-os10-bond-trunk-8df03c8490ee94b0.yaml diff --git a/networking_generic_switch/devices/netmiko_devices/dell.py b/networking_generic_switch/devices/netmiko_devices/dell.py index 90e44947..ea18720e 100644 --- a/networking_generic_switch/devices/netmiko_devices/dell.py +++ b/networking_generic_switch/devices/netmiko_devices/dell.py @@ -39,12 +39,25 @@ class DellOS10(netmiko_devices.NetmikoSwitch): "exit", ) + PLUG_BOND_TO_NETWORK = ( + "interface {bond}", + "switchport mode access", + "switchport access vlan {segmentation_id}", + "exit", + ) + DELETE_PORT = ( "interface {port}", "no switchport access vlan", "exit", ) + UNPLUG_BOND_FROM_NETWORK = ( + "interface {bond}", + "no switchport access vlan", + "exit", + ) + ADD_NETWORK_TO_TRUNK = ( "interface {port}", "switchport mode trunk", @@ -52,23 +65,47 @@ class DellOS10(netmiko_devices.NetmikoSwitch): "exit", ) + ADD_NETWORK_TO_BOND_TRUNK = ( + "interface {bond}", + "switchport mode trunk", + "switchport trunk allowed vlan {segmentation_id}", + "exit", + ) + REMOVE_NETWORK_FROM_TRUNK = ( "interface {port}", "no switchport trunk allowed vlan {segmentation_id}", "exit", ) + DELETE_NETWORK_ON_BOND_TRUNK = ( + "interface {bond}", + "no switchport trunk allowed vlan {segmentation_id}", + "exit", + ) + SET_NATIVE_VLAN = ( 'interface {port}', 'switchport mode trunk', 'switchport access vlan {segmentation_id}', ) + SET_NATIVE_VLAN_BOND = ( + 'interface {bond}', + 'switchport mode trunk', + 'switchport access vlan {segmentation_id}', + ) + DELETE_NATIVE_VLAN = ( 'interface {port}', 'no switchport access vlan', ) + DELETE_NATIVE_VLAN_BOND = ( + 'interface {bond}', + 'no switchport access vlan', + ) + ENABLE_PORT = ( "interface {port}", "no shutdown", diff --git a/releasenotes/notes/dell-os10-bond-trunk-8df03c8490ee94b0.yaml b/releasenotes/notes/dell-os10-bond-trunk-8df03c8490ee94b0.yaml new file mode 100644 index 00000000..e7929c72 --- /dev/null +++ b/releasenotes/notes/dell-os10-bond-trunk-8df03c8490ee94b0.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Add bond trunk commands so LACP bond trunk ports are supported on Dell OS10 + switches. From a88a7fa2363779f8de892f9e7e38ee4d715834bc Mon Sep 17 00:00:00 2001 From: Julia Kreger Date: Fri, 13 Feb 2026 04:35:56 -0800 Subject: [PATCH 3/3] CI: Temporary setuptools pin Temporarily pin setuptools to an older version. While not great, until we have consensus we're in a not good state for CI. Change-Id: I15cc92846670af80ff487c8035cf2e365437473b Signed-off-by: Julia Kreger (cherry picked from commit 2ccb2635444780f35cf7e67b17215c1361944242) --- tox.ini | 1 + 1 file changed, 1 insertion(+) diff --git a/tox.ini b/tox.ini index 6f7683d5..e3c265a3 100644 --- a/tox.ini +++ b/tox.ini @@ -35,6 +35,7 @@ deps = bashate~=2.1.0 # Apache-2.0 pycodestyle>=2.0.0,<3.0.0 # MIT doc8~=1.1.0 # Apache-2.0 + setuptools<81.0.0 allowlist_externals = bash {toxinidir}/tools/run_bashate.sh commands =