Commit fe68441b authored by Cyrill Gorcunov's avatar Cyrill Gorcunov Committed by Pavel Emelyanov

zdtm.py: Fix eval error if empty desc file provided

If desc is empty we should not try to eval it,
otherwise it would lead to exceptio. So test
for its size as well.

travis-ci: success for zdtm.py: Fix eval error if empty desc file provided
Signed-off-by: 's avatarCyrill Gorcunov <gorcunov@openvz.org>
Signed-off-by: 's avatarPavel Emelyanov <xemul@virtuozzo.com>
parent d234b567
...@@ -1464,7 +1464,7 @@ default_test = {} ...@@ -1464,7 +1464,7 @@ default_test = {}
def get_test_desc(tname): def get_test_desc(tname):
d_path = tname + '.desc' d_path = tname + '.desc'
if os.access(d_path, os.F_OK): if os.access(d_path, os.F_OK) and os.path.getsize(d_path) > 0:
return eval(open(d_path).read()) return eval(open(d_path).read())
return default_test return default_test
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment