Add delete method in EthernetSwitchPort in RSD 2.1
Change-Id: I4f7da5260c5e6f0ec1f4f5354c899f2f6c2a76e5
This commit is contained in:
parent
ee1a29e504
commit
9223ccd4ad
@ -140,6 +140,10 @@ class EthernetSwitchPort(rsd_lib_base.ResourceBase):
|
||||
|
||||
links = LinksField("Links")
|
||||
|
||||
def delete(self):
|
||||
"""Delete this ethernet switch port"""
|
||||
self._conn.delete(self._path)
|
||||
|
||||
@property
|
||||
@utils.cache_it
|
||||
def vlans(self):
|
||||
@ -170,6 +174,7 @@ class EthernetSwitchPort(rsd_lib_base.ResourceBase):
|
||||
|
||||
|
||||
class EthernetSwitchPortCollection(rsd_lib_base.ResourceCollectionBase):
|
||||
|
||||
@property
|
||||
def _resource_type(self):
|
||||
return EthernetSwitchPort
|
||||
|
@ -110,6 +110,12 @@ class EthernetSwitchPortTestCase(testtools.TestCase):
|
||||
self.port_inst.links.oem.intel_rackscale.neighbor_interface,
|
||||
)
|
||||
|
||||
def test_delete(self):
|
||||
self.port_inst.delete()
|
||||
self.port_inst._conn.delete.assert_called_once_with(
|
||||
self.port_inst.path
|
||||
)
|
||||
|
||||
def test_static_mac(self):
|
||||
# | GIVEN |
|
||||
self.conn.get.return_value.json.reset_mock()
|
||||
|
Loading…
x
Reference in New Issue
Block a user