From 1f59217371bd6f15c38211d437df7f3e90bbe8ce Mon Sep 17 00:00:00 2001 From: Vasundhara Volam Date: Wed, 9 Oct 2024 19:13:15 +0000 Subject: [PATCH] Add negative case for pci_detach() Also, remove module_name from pci_detach() and get_bus_info() --- sonic_platform_base/module_base.py | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/sonic_platform_base/module_base.py b/sonic_platform_base/module_base.py index 5ca847e88..a5188e01c 100644 --- a/sonic_platform_base/module_base.py +++ b/sonic_platform_base/module_base.py @@ -262,28 +262,22 @@ def get_state_info(self): """ raise NotImplementedError - def get_bus_info(self, module_name): + def get_bus_info(self): """ - Retrieves the bus information for the specified by "module_name" on a SmartSwitch. + Retrieves the bus information. Returns None for non-smartswitch chassis. Returns: Returns the PCI bus information in BDF format like "[DDDD:]BB:SS:F" """ raise NotImplementedError - def pci_detach(self, module_name): + def pci_detach(self): """ Detaches the DPU PCI device specified by "module_name" on a SmartSwitch. + Returns False for non-smartswitch chassis. Returns: True once the PCI is successfully detached. - """ - raise NotImplementedError - - def pci_reattach(self, module_name): - """ - Rescans and reconnects the DPU PCI device specified by "module_name" on a SmartSwitch. - - Returns: True once the PCI is successfully reconnected. + Returns False if PCI detachment fails or specified 'module_name' is not found. """ raise NotImplementedError