Skip to content
This repository has been archived by the owner on Jan 7, 2023. It is now read-only.

Commit

Permalink
read case.conf will show error if has blank lines
Browse files Browse the repository at this point in the history
Signed-off-by: shaoshian <[email protected]>
  • Loading branch information
Shaoshian committed Nov 8, 2016
1 parent 5c8bc86 commit 0bfe951
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 1 deletion.
6 changes: 5 additions & 1 deletion benchmarking/run_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,11 @@ def main(args):

else:
with open("../conf/cases.conf", "r") as f:
for line in f.readlines():
case_lines = f.readlines()
for i in case_lines:
if i.strip() == "":
case_lines.remove(i)
for line in case_lines:
p = line.split()
testcase_list.append({"engine":p[0],"parameter":p[1:]})
for testcase in testcase_list:
Expand Down
6 changes: 6 additions & 0 deletions conf/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,19 @@ def get_config(self):
try:
with open(self.conf_path,"r") as f:
lines = f.readlines()
for i in lines:
if i.strip() == "":
lines.remove(i)
for line in lines:
p = line.split()
testcase_list.append( self.parse_benchmark_cases( p ) )
except:
common.bash("cp %s %s" % (self.default_conf_path, self.conf_path))
with open(self.conf_path,"r") as f:
lines = f.readlines()
for i in lines:
if i.strip() == "":
lines.remove(i)
for line in lines:
p = line.split()
testcase_list.append( self.parse_benchmark_cases( p ) )
Expand Down

0 comments on commit 0bfe951

Please sign in to comment.