diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/eeprom.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/eeprom.py index 909a4a05d93..c44700b9be9 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/eeprom.py +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/eeprom.py @@ -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 diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/psuutil.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/psuutil.py index ad6391e1698..972b3074218 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/psuutil.py +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/psuutil.py @@ -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()) @@ -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 @@ -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 @@ -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 diff --git a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py index b64aa061ff7..d1a1da8f217 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py +++ b/device/barefoot/x86_64-accton_wedge100bf_32x-r0/plugins/sfputil.py @@ -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 @@ -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 @@ -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 diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/eeprom.py b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/eeprom.py index 909a4a05d93..c44700b9be9 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/eeprom.py +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/eeprom.py @@ -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 diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/psuutil.py b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/psuutil.py index ad6391e1698..972b3074218 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/psuutil.py +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/psuutil.py @@ -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()) @@ -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 @@ -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 @@ -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 diff --git a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/sfputil.py b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/sfputil.py index b64aa061ff7..d1a1da8f217 100644 --- a/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/sfputil.py +++ b/device/barefoot/x86_64-accton_wedge100bf_65x-r0/plugins/sfputil.py @@ -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 @@ -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 @@ -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