Skip to content

Commit

Permalink
[device/celestica] Silverstone format sfputil codes
Browse files Browse the repository at this point in the history
  • Loading branch information
pphuchar authored and tiantianlv committed Sep 24, 2019
1 parent 2e3ce7e commit a2d7757
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions device/celestica/x86_64-cel_silverstone-r0/plugins/sfputil.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ def __init__(self):
SfpUtilBase.__init__(self)

def get_presence(self, port_num):

# Check for invalid port_num
if port_num not in range(self.port_start, self.port_end + 1):
return False
Expand Down Expand Up @@ -105,7 +104,7 @@ def get_low_power_mode(self, port_num):

try:
port_name = self.get_port_name(port_num)
reg_file = open("/".join([self.PORT_INFO_PATH,
reg_file = open("/".join([self.PORT_INFO_PATH,
port_name, "qsfp_lpmode"]))
except IOError as e:
print "Error: unable to open file: %s" % str(e)
Expand All @@ -127,8 +126,8 @@ def set_low_power_mode(self, port_num, lpmode):

try:
port_name = self.get_port_name(port_num)
reg_file = open("/".join([self.PORT_INFO_PATH,
port_name, "qsfp_lpmode"]), "r+")
reg_file = open("/".join([self.PORT_INFO_PATH,
port_name, "qsfp_lpmode"]), "r+")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
Expand All @@ -148,8 +147,8 @@ def reset(self, port_num):

try:
port_name = self.get_port_name(port_num)
reg_file = open("/".join([self.PORT_INFO_PATH,
port_name, "qsfp_reset"]), "w")
reg_file = open("/".join([self.PORT_INFO_PATH,
port_name, "qsfp_reset"]), "w")
except IOError as e:
print "Error: unable to open file: %s" % str(e)
return False
Expand Down Expand Up @@ -181,4 +180,3 @@ def get_transceiver_change_event(self, timeout=0):
TBD
"""
return NotImplementedError

0 comments on commit a2d7757

Please sign in to comment.