[devices]: Fixed trancevier presence getter on Mellanox. (#2144)

Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
This commit is contained in:
Nazarii Hnydyn 2018-10-13 02:00:30 +03:00 committed by lguohan
parent 7d51f8363f
commit 33d4140f27
5 changed files with 20 additions and 5 deletions

View File

@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
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 @@ class SfpUtil(SfpUtilBase):
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

View File

@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
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 @@ class SfpUtil(SfpUtilBase):
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

View File

@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
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 @@ class SfpUtil(SfpUtilBase):
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

View File

@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
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 @@ class SfpUtil(SfpUtilBase):
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

View File

@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
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 @@ class SfpUtil(SfpUtilBase):
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