From b750646731835b2a2a959dbbb4954c9919cc5b2b Mon Sep 17 00:00:00 2001 From: Nazarii Hnydyn Date: Fri, 12 Oct 2018 18:38:55 +0300 Subject: [PATCH] Fixed trancevier presence getter. Signed-off-by: Nazarii Hnydyn --- device/mellanox/x86_64-mlnx_msn2010-r0/plugins/sfputil.py | 5 ++++- device/mellanox/x86_64-mlnx_msn2100-r0/plugins/sfputil.py | 5 ++++- device/mellanox/x86_64-mlnx_msn2410-r0/plugins/sfputil.py | 5 ++++- device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py | 5 ++++- device/mellanox/x86_64-mlnx_msn2740-r0/plugins/sfputil.py | 5 ++++- 5 files changed, 20 insertions(+), 5 deletions(-) diff --git a/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/sfputil.py index 77831b54d2f..aab347a2a6c 100644 --- a/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2010-r0/plugins/sfputil.py @@ -15,6 +15,9 @@ REDIS_PORT = 6379 REDIS_TIMEOUT_USECS = 0 +# parameters for SFP presence +SFP_STATUS_INSERTED = '1' + class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_START = 0 @@ -71,7 +74,7 @@ def get_presence(self, port_num): content = reg_file.readline().rstrip() # content is a string with the qsfp status - if content == "1": + if content == SFP_STATUS_INSERTED: return True return False diff --git a/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/sfputil.py index a4eda6edfe3..2c82a7c053a 100644 --- a/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2100-r0/plugins/sfputil.py @@ -15,6 +15,9 @@ REDIS_PORT = 6379 REDIS_TIMEOUT_USECS = 0 +# parameters for SFP presence +SFP_STATUS_INSERTED = '1' + class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_START = 0 @@ -70,7 +73,7 @@ def get_presence(self, port_num): content = reg_file.readline().rstrip() # content is a string with the qsfp status - if content == "good": + if content == SFP_STATUS_INSERTED: return True return False diff --git a/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/sfputil.py index 8bd4ba78916..c280dce501a 100644 --- a/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2410-r0/plugins/sfputil.py @@ -15,6 +15,9 @@ REDIS_PORT = 6379 REDIS_TIMEOUT_USECS = 0 +# parameters for SFP presence +SFP_STATUS_INSERTED = '1' + class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_START = 0 @@ -71,7 +74,7 @@ def get_presence(self, port_num): content = reg_file.readline().rstrip() # content is a string with the qsfp status - if content == "good": + if content == SFP_STATUS_INSERTED: return True return False diff --git a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py index 11a5bdcb02b..a899672fe41 100644 --- a/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2700-r0/plugins/sfputil.py @@ -15,6 +15,9 @@ REDIS_PORT = 6379 REDIS_TIMEOUT_USECS = 0 +# parameters for SFP presence +SFP_STATUS_INSERTED = '1' + class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_START = 0 @@ -70,7 +73,7 @@ def get_presence(self, port_num): content = reg_file.readline().rstrip() # content is a string with the qsfp status - if content == "good": + if content == SFP_STATUS_INSERTED: return True return False diff --git a/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/sfputil.py b/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/sfputil.py index f84cefc6726..fae197cb567 100644 --- a/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/sfputil.py +++ b/device/mellanox/x86_64-mlnx_msn2740-r0/plugins/sfputil.py @@ -15,6 +15,9 @@ REDIS_PORT = 6379 REDIS_TIMEOUT_USECS = 0 +# parameters for SFP presence +SFP_STATUS_INSERTED = '1' + class SfpUtil(SfpUtilBase): """Platform-specific SfpUtil class""" PORT_START = 0 @@ -70,7 +73,7 @@ def get_presence(self, port_num): content = reg_file.readline().rstrip() # content is a string with the qsfp status - if content == "good": + if content == SFP_STATUS_INSERTED: return True return False