Skip to content

Commit 1f59217

Browse files
committed
Add negative case for pci_detach()
Also, remove module_name from pci_detach() and get_bus_info()
1 parent daeed65 commit 1f59217

File tree

1 file changed

+5
-11
lines changed

1 file changed

+5
-11
lines changed

sonic_platform_base/module_base.py

+5-11
Original file line numberDiff line numberDiff line change
@@ -262,28 +262,22 @@ def get_state_info(self):
262262
"""
263263
raise NotImplementedError
264264

265-
def get_bus_info(self, module_name):
265+
def get_bus_info(self):
266266
"""
267-
Retrieves the bus information for the specified by "module_name" on a SmartSwitch.
267+
Retrieves the bus information. Returns None for non-smartswitch chassis.
268268
269269
Returns:
270270
Returns the PCI bus information in BDF format like "[DDDD:]BB:SS:F"
271271
"""
272272
raise NotImplementedError
273273

274-
def pci_detach(self, module_name):
274+
def pci_detach(self):
275275
"""
276276
Detaches the DPU PCI device specified by "module_name" on a SmartSwitch.
277+
Returns False for non-smartswitch chassis.
277278
278279
Returns: True once the PCI is successfully detached.
279-
"""
280-
raise NotImplementedError
281-
282-
def pci_reattach(self, module_name):
283-
"""
284-
Rescans and reconnects the DPU PCI device specified by "module_name" on a SmartSwitch.
285-
286-
Returns: True once the PCI is successfully reconnected.
280+
Returns False if PCI detachment fails or specified 'module_name' is not found.
287281
"""
288282
raise NotImplementedError
289283

0 commit comments

Comments
 (0)