Skip to content
This repository was archived by the owner on Jan 3, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def read_eeprom(self):
output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
eeprom,err = output.communicate()
if err != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(err))
raise Exception('Runtime Exception')
else:
return eeprom

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def get_num_psus(self):
output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
num,err = output.communicate()
if err != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(err))
raise Exception('Runtime Exception')
else:
return int(num.strip())

Expand All @@ -45,7 +46,8 @@ def get_psu_status(self, index):
output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out,err = output.communicate()
if err != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(err))
raise Exception('Runtime Exception')
else:
if out.strip() == "True":
presence = True
Expand All @@ -57,7 +59,8 @@ def get_psu_status(self, index):
sout,serr = status.communicate()

if serr != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(serr))
raise Exception('Runtime Exception')
else:
if sout.strip() == "True":
psu_status = True
Expand All @@ -78,7 +81,8 @@ def get_psu_presence(self, index):
output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out,err = output.communicate()
if err != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(err))
raise Exception('Runtime Exception')
else:
if out.strip() == "True":
presence = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def port_start(self):

@property
def port_end(self):
cmd = "docker exec -it syncd sfputil get_number_qsfp_ports"
cmd = "docker exec -i syncd sfputil get_number_qsfp_ports"
count=subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE).stdout.read()
return int(count.strip())-1

Expand All @@ -40,7 +40,7 @@ def get_presence(self, port_num):
if port_num < self.port_start or port_num > self.port_end:
return False
qsfp_port = port_num + 1
cmd = "docker exec -it syncd sfputil get_presence {0:s}".format(str(qsfp_port))
cmd = "docker exec -i syncd sfputil get_presence {0:s}".format(str(qsfp_port))
presence=subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE).stdout.read()
if presence.strip() == "True":
return True
Expand All @@ -52,7 +52,7 @@ def get_low_power_mode(self, port_num):
if port_num < self.port_start or port_num > self.port_end:
return False
qsfp_port = port_num + 1
cmd = "docker exec -it syncd sfputil get_lp_mode {0:s}".format(str(qsfp_port))
cmd = "docker exec -i syncd sfputil get_lp_mode {0:s}".format(str(qsfp_port))
lpmode=subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE).stdout.read()
if lpmode.strip() == "True":
return True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,8 @@ def read_eeprom(self):
output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
eeprom,err = output.communicate()
if err != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(err))
raise Exception('Runtime Exception')
else:
return eeprom

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@ def get_num_psus(self):
output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
num,err = output.communicate()
if err != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(err))
raise Exception('Runtime Exception')
else:
return int(num.strip())

Expand All @@ -45,7 +46,8 @@ def get_psu_status(self, index):
output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out,err = output.communicate()
if err != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(err))
raise Exception('Runtime Exception')
else:
if out.strip() == "True":
presence = True
Expand All @@ -57,7 +59,8 @@ def get_psu_status(self, index):
sout,serr = status.communicate()

if serr != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(serr))
raise Exception('Runtime Exception')
else:
if sout.strip() == "True":
psu_status = True
Expand All @@ -78,7 +81,8 @@ def get_psu_presence(self, index):
output = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.PIPE)
out,err = output.communicate()
if err != "":
raise RuntimeError("{0:s}".format(err))
sys.stderr.write("{0:s}".format(err))
raise Exception('Runtime Exception')
else:
if out.strip() == "True":
presence = True
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def port_start(self):

@property
def port_end(self):
cmd = "docker exec -it syncd sfputil get_number_qsfp_ports"
cmd = "docker exec -i syncd sfputil get_number_qsfp_ports"
count=subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE).stdout.read()
return int(count.strip())-1

Expand All @@ -40,7 +40,7 @@ def get_presence(self, port_num):
if port_num < self.port_start or port_num > self.port_end:
return False
qsfp_port = port_num + 1
cmd = "docker exec -it syncd sfputil get_presence {0:s}".format(str(qsfp_port))
cmd = "docker exec -i syncd sfputil get_presence {0:s}".format(str(qsfp_port))
presence=subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE).stdout.read()
if presence.strip() == "True":
return True
Expand All @@ -52,7 +52,7 @@ def get_low_power_mode(self, port_num):
if port_num < self.port_start or port_num > self.port_end:
return False
qsfp_port = port_num + 1
cmd = "docker exec -it syncd sfputil get_lp_mode {0:s}".format(str(qsfp_port))
cmd = "docker exec -i syncd sfputil get_lp_mode {0:s}".format(str(qsfp_port))
lpmode=subprocess.Popen(cmd, shell=True,stdout=subprocess.PIPE).stdout.read()
if lpmode.strip() == "True":
return True
Expand Down