[devices]: Fixed trancevier presence getter on Mellanox. (#2144)
Signed-off-by: Nazarii Hnydyn <nazariig@mellanox.com>
This commit is contained in:
parent
7d51f8363f
commit
33d4140f27
@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
|
|||||||
REDIS_PORT = 6379
|
REDIS_PORT = 6379
|
||||||
REDIS_TIMEOUT_USECS = 0
|
REDIS_TIMEOUT_USECS = 0
|
||||||
|
|
||||||
|
# parameters for SFP presence
|
||||||
|
SFP_STATUS_INSERTED = '1'
|
||||||
|
|
||||||
class SfpUtil(SfpUtilBase):
|
class SfpUtil(SfpUtilBase):
|
||||||
"""Platform-specific SfpUtil class"""
|
"""Platform-specific SfpUtil class"""
|
||||||
PORT_START = 0
|
PORT_START = 0
|
||||||
@ -71,7 +74,7 @@ class SfpUtil(SfpUtilBase):
|
|||||||
content = reg_file.readline().rstrip()
|
content = reg_file.readline().rstrip()
|
||||||
|
|
||||||
# content is a string with the qsfp status
|
# content is a string with the qsfp status
|
||||||
if content == "1":
|
if content == SFP_STATUS_INSERTED:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
|
|||||||
REDIS_PORT = 6379
|
REDIS_PORT = 6379
|
||||||
REDIS_TIMEOUT_USECS = 0
|
REDIS_TIMEOUT_USECS = 0
|
||||||
|
|
||||||
|
# parameters for SFP presence
|
||||||
|
SFP_STATUS_INSERTED = '1'
|
||||||
|
|
||||||
class SfpUtil(SfpUtilBase):
|
class SfpUtil(SfpUtilBase):
|
||||||
"""Platform-specific SfpUtil class"""
|
"""Platform-specific SfpUtil class"""
|
||||||
PORT_START = 0
|
PORT_START = 0
|
||||||
@ -70,7 +73,7 @@ class SfpUtil(SfpUtilBase):
|
|||||||
content = reg_file.readline().rstrip()
|
content = reg_file.readline().rstrip()
|
||||||
|
|
||||||
# content is a string with the qsfp status
|
# content is a string with the qsfp status
|
||||||
if content == "good":
|
if content == SFP_STATUS_INSERTED:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
|
|||||||
REDIS_PORT = 6379
|
REDIS_PORT = 6379
|
||||||
REDIS_TIMEOUT_USECS = 0
|
REDIS_TIMEOUT_USECS = 0
|
||||||
|
|
||||||
|
# parameters for SFP presence
|
||||||
|
SFP_STATUS_INSERTED = '1'
|
||||||
|
|
||||||
class SfpUtil(SfpUtilBase):
|
class SfpUtil(SfpUtilBase):
|
||||||
"""Platform-specific SfpUtil class"""
|
"""Platform-specific SfpUtil class"""
|
||||||
PORT_START = 0
|
PORT_START = 0
|
||||||
@ -71,7 +74,7 @@ class SfpUtil(SfpUtilBase):
|
|||||||
content = reg_file.readline().rstrip()
|
content = reg_file.readline().rstrip()
|
||||||
|
|
||||||
# content is a string with the qsfp status
|
# content is a string with the qsfp status
|
||||||
if content == "good":
|
if content == SFP_STATUS_INSERTED:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
|
|||||||
REDIS_PORT = 6379
|
REDIS_PORT = 6379
|
||||||
REDIS_TIMEOUT_USECS = 0
|
REDIS_TIMEOUT_USECS = 0
|
||||||
|
|
||||||
|
# parameters for SFP presence
|
||||||
|
SFP_STATUS_INSERTED = '1'
|
||||||
|
|
||||||
class SfpUtil(SfpUtilBase):
|
class SfpUtil(SfpUtilBase):
|
||||||
"""Platform-specific SfpUtil class"""
|
"""Platform-specific SfpUtil class"""
|
||||||
PORT_START = 0
|
PORT_START = 0
|
||||||
@ -70,7 +73,7 @@ class SfpUtil(SfpUtilBase):
|
|||||||
content = reg_file.readline().rstrip()
|
content = reg_file.readline().rstrip()
|
||||||
|
|
||||||
# content is a string with the qsfp status
|
# content is a string with the qsfp status
|
||||||
if content == "good":
|
if content == SFP_STATUS_INSERTED:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
@ -15,6 +15,9 @@ REDIS_HOSTNAME = "localhost"
|
|||||||
REDIS_PORT = 6379
|
REDIS_PORT = 6379
|
||||||
REDIS_TIMEOUT_USECS = 0
|
REDIS_TIMEOUT_USECS = 0
|
||||||
|
|
||||||
|
# parameters for SFP presence
|
||||||
|
SFP_STATUS_INSERTED = '1'
|
||||||
|
|
||||||
class SfpUtil(SfpUtilBase):
|
class SfpUtil(SfpUtilBase):
|
||||||
"""Platform-specific SfpUtil class"""
|
"""Platform-specific SfpUtil class"""
|
||||||
PORT_START = 0
|
PORT_START = 0
|
||||||
@ -70,7 +73,7 @@ class SfpUtil(SfpUtilBase):
|
|||||||
content = reg_file.readline().rstrip()
|
content = reg_file.readline().rstrip()
|
||||||
|
|
||||||
# content is a string with the qsfp status
|
# content is a string with the qsfp status
|
||||||
if content == "good":
|
if content == SFP_STATUS_INSERTED:
|
||||||
return True
|
return True
|
||||||
|
|
||||||
return False
|
return False
|
||||||
|
Loading…
Reference in New Issue
Block a user