zdtm: handle unknown flavors

Submitted by Andrei Vagin on April 30, 2016, 12:59 a.m.

Details

Message ID 1461977959-16183-1-git-send-email-avagin@openvz.org
State Accepted
Series "zdtm: handle unknown flavors"
Commit c727d2d60b1f390abbf17d0ab0aa5d0521fce695
Headers show

Commit Message

Andrei Vagin April 30, 2016, 12:59 a.m.
From: Andrew Vagin <avagin@virtuozzo.com>

Signed-off-by: Andrew Vagin <avagin@virtuozzo.com>
---
 test/zdtm.py | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/test/zdtm.py b/test/zdtm.py
index c9f8d14..b1ed38d 100755
--- a/test/zdtm.py
+++ b/test/zdtm.py
@@ -246,7 +246,10 @@  def encode_flav(f):
 	return (flavors.keys().index(f) + 128)
 
 def decode_flav(i):
-	return flavors.keys()[i - 128]
+        i = i - 128
+        if flavors.has_key(i):
+                return flavors.keys()[i - 128]
+        return "unknown"
 
 def tail(path):
 	p = subprocess.Popen(['tail', '-n1', path],

Comments

Pavel Emelianov May 4, 2016, 7:28 a.m.
Applied