From 23826b3eaeb87faed936689c7b9b69bd8686245d Mon Sep 17 00:00:00 2001 From: paavaanan Date: Tue, 27 Nov 2018 05:54:51 -0500 Subject: [PATCH] hwmon reordering fixes --- device/dell/x86_64-dell_s6100_c2538-r0/plugins/psuutil.py | 4 +++- device/dell/x86_64-dell_z9100_c2538-r0/plugins/psuutil.py | 4 +++- .../s6100/scripts/platform_sensors.py | 4 +++- .../z9100/scripts/platform_sensors.py | 4 +++- 4 files changed, 12 insertions(+), 4 deletions(-) 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..eef8d6c8f131 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 = ', '.join(os.listdir(HWMON_DIR)) 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..28390561c628 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 = ', '.join(os.listdir(HWMON_DIR)) 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..bae3aa6aeddb 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 = ', '.join(os.listdir(HWMON_DIR)) +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 763e65772282..16ee512b1044 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/hwmon1" +HWMON_DIR = "/sys/devices/platform/SMF.512/hwmon/" +HWMON_NODE = ', '.join(os.listdir(HWMON_DIR)) +MAILBOX_DIR = HWMON_DIR + HWMON_NODE # Get a mailbox register