[celestica/dx010]: Fix incorrect path for voltage, current and power. (#6128)
Fixes #6126. There is a bug in getting the path of voltage, current and power. The list object is directly converted to string to format the file path. As a result, read_txt_file will get None value and a WARNING will be recorded. This commit fix the issue. Signed-off-by: bingwang <bingwang@microsoft.com>
This commit is contained in:
parent
026f0ec3fb
commit
49804c64b6
@ -82,7 +82,7 @@ class Psu(PsuBase):
|
||||
if vout_label_path:
|
||||
dir_name = os.path.dirname(vout_label_path)
|
||||
basename = os.path.basename(vout_label_path)
|
||||
in_num = list(filter(str.isdigit, basename))
|
||||
in_num = ''.join(list(filter(str.isdigit, basename)))
|
||||
vout_path = os.path.join(
|
||||
dir_name, voltage_name.format(in_num))
|
||||
vout_val = self.__read_txt_file(vout_path)
|
||||
@ -105,7 +105,7 @@ class Psu(PsuBase):
|
||||
if curr_label_path:
|
||||
dir_name = os.path.dirname(curr_label_path)
|
||||
basename = os.path.basename(curr_label_path)
|
||||
cur_num = list(filter(str.isdigit, basename))
|
||||
cur_num = ''.join(list(filter(str.isdigit, basename)))
|
||||
cur_path = os.path.join(
|
||||
dir_name, current_name.format(cur_num))
|
||||
cur_val = self.__read_txt_file(cur_path)
|
||||
@ -128,7 +128,7 @@ class Psu(PsuBase):
|
||||
if pw_label_path:
|
||||
dir_name = os.path.dirname(pw_label_path)
|
||||
basename = os.path.basename(pw_label_path)
|
||||
pw_num = list(filter(str.isdigit, basename))
|
||||
pw_num = ''.join(list(filter(str.isdigit, basename)))
|
||||
pw_path = os.path.join(
|
||||
dir_name, current_name.format(pw_num))
|
||||
pw_val = self.__read_txt_file(pw_path)
|
||||
|
@ -92,7 +92,7 @@ class Psu(PsuBase):
|
||||
if vout_label_path:
|
||||
dir_name = os.path.dirname(vout_label_path)
|
||||
basename = os.path.basename(vout_label_path)
|
||||
in_num = list(filter(str.isdigit, basename))
|
||||
in_num = ''.join(list(filter(str.isdigit, basename)))
|
||||
vout_path = os.path.join(
|
||||
dir_name, voltage_name.format(in_num))
|
||||
vout_val = self._api_helper.read_txt_file(vout_path)
|
||||
@ -115,7 +115,7 @@ class Psu(PsuBase):
|
||||
if curr_label_path:
|
||||
dir_name = os.path.dirname(curr_label_path)
|
||||
basename = os.path.basename(curr_label_path)
|
||||
cur_num = list(filter(str.isdigit, basename))
|
||||
cur_num = ''.join(list(filter(str.isdigit, basename)))
|
||||
cur_path = os.path.join(
|
||||
dir_name, current_name.format(cur_num))
|
||||
cur_val = self._api_helper.read_txt_file(cur_path)
|
||||
@ -138,7 +138,7 @@ class Psu(PsuBase):
|
||||
if pw_label_path:
|
||||
dir_name = os.path.dirname(pw_label_path)
|
||||
basename = os.path.basename(pw_label_path)
|
||||
pw_num = list(filter(str.isdigit, basename))
|
||||
pw_num = ''.join(list(filter(str.isdigit, basename)))
|
||||
pw_path = os.path.join(
|
||||
dir_name, current_name.format(pw_num))
|
||||
pw_val = self._api_helper.read_txt_file(pw_path)
|
||||
|
Loading…
Reference in New Issue
Block a user