diff --git a/device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py b/device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py index 5f9661a51e3c..2f3673801526 100644 --- a/device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py +++ b/device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py @@ -11,6 +11,8 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") +HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/" +HWMON_NODE = os.listdir(HWMON_DIR)[0] class PsuUtil(PsuBase): """Platform-specific PSUutil class""" @@ -20,7 +22,7 @@ def __init__(self): # Get a mailbox register def get_pmc_register(self, reg_name): - mailbox_dir = "/sys/devices/platform/SMF.512/hwmon/hwmon1" + mailbox_dir = HWMON_DIR + HWMON_NODE retval = 'ERR' mb_reg_file = mailbox_dir+'/' + reg_name if (not os.path.isfile(mb_reg_file)): diff --git a/device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py b/device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py index 66253850e6ff..f96fac6f46cf 100644 --- a/device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py +++ b/device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py @@ -11,6 +11,8 @@ except ImportError as e: raise ImportError(str(e) + "- required module not found") +HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/" +HWMON_NODE = os.listdir(HWMON_DIR)[0] class PsuUtil(PsuBase): """Platform-specific PSUutil class""" @@ -20,7 +22,7 @@ def __init__(self): # Get a mailbox register def get_pmc_register(self, reg_name): - mailbox_dir = "/sys/devices/platform/SMF.512/hwmon/hwmon1" + mailbox_dir = HWMON_DIR + HWMON_NODE retval = 'ERR' mb_reg_file = mailbox_dir+'/' + reg_name if (not os.path.isfile(mb_reg_file)): diff --git a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_sensors.py b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_sensors.py index fb59df1ee7f3..a0231bc507cf 100755 --- a/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_sensors.py +++ b/platform/broadcom/sonic-platform-modules-dell/s6100/scripts/platform_sensors.py @@ -16,7 +16,9 @@ S6100_MAX_PSUS = 2 S6100_MAX_IOMS = 4 -MAILBOX_DIR = "/sys/devices/platform/SMF.512/hwmon/hwmon1" +HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/" +HWMON_NODE = os.listdir(HWMON_DIR)[0] +MAILBOX_DIR = HWMON_DIR + HWMON_NODE iom_status_list = [] # Get a mailbox register diff --git a/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/platform_sensors.py b/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/platform_sensors.py index 1457537918f4..76e527e13d73 100755 --- a/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/platform_sensors.py +++ b/platform/broadcom/sonic-platform-modules-dell/z9100/scripts/platform_sensors.py @@ -16,7 +16,9 @@ Z9100_MAX_PSUS = 2 S6100_MAX_IOMS = 4 -MAILBOX_DIR = "/sys/devices/platform/SMF.512/hwmon/hwmon0" +HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/" +HWMON_NODE = os.listdir(HWMON_DIR)[0] +MAILBOX_DIR = HWMON_DIR + HWMON_NODE # Get a mailbox register