diff --git a/rsd_lib/resources/v2_1/ethernet_switch/ethernet_switch_static_mac.py b/rsd_lib/resources/v2_1/ethernet_switch/ethernet_switch_static_mac.py index 21fbdd5..70ba9ea 100644 --- a/rsd_lib/resources/v2_1/ethernet_switch/ethernet_switch_static_mac.py +++ b/rsd_lib/resources/v2_1/ethernet_switch/ethernet_switch_static_mac.py @@ -36,8 +36,13 @@ class EthernetSwitchStaticMAC(rsd_lib_base.ResourceBase): mac_address = base.Field("MACAddress") """The static mac address""" + def delete(self): + """Delete this static mac address""" + self._conn.delete(self._path) + class EthernetSwitchStaticMACCollection(rsd_lib_base.ResourceCollectionBase): + @property def _resource_type(self): return EthernetSwitchStaticMAC diff --git a/rsd_lib/tests/unit/resources/v2_1/ethernet_switch/test_ethernet_switch_static_mac.py b/rsd_lib/tests/unit/resources/v2_1/ethernet_switch/test_ethernet_switch_static_mac.py index 9c0006e..f02bd1b 100644 --- a/rsd_lib/tests/unit/resources/v2_1/ethernet_switch/test_ethernet_switch_static_mac.py +++ b/rsd_lib/tests/unit/resources/v2_1/ethernet_switch/test_ethernet_switch_static_mac.py @@ -52,6 +52,12 @@ class EthernetSwitchStaticMACTestCase(testtools.TestCase): self.assertEqual("00:11:22:33:44:55", self.static_mac_inst.mac_address) self.assertEqual(112, self.static_mac_inst.vlan_id) + def test_delete(self): + self.static_mac_inst.delete() + self.static_mac_inst._conn.delete.assert_called_once_with( + self.static_mac_inst.path + ) + class EthernetSwitchStaticMACCollectionTestCase(testtools.TestCase): def setUp(self):