From: JingLu5 Date: Tue, 4 Jul 2017 07:44:52 +0000 (+0000) Subject: Bugfix: test case constraint not work if "INSTALLER_TYPE" and "NODE_NAME" absent X-Git-Tag: opnfv-5.0.RC1~425^2 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F97%2F36897%2F3;p=yardstick.git Bugfix: test case constraint not work if "INSTALLER_TYPE" and "NODE_NAME" absent Change-Id: Idffc07c28fabda590b58c9501f388099f84f06b2 Signed-off-by: JingLu5 --- diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py index d1a4d7561..f9c2551a8 100644 --- a/yardstick/benchmark/core/task.py +++ b/yardstick/benchmark/core/task.py @@ -375,10 +375,10 @@ class TaskParser(object): # pragma: no cover tc_fit_installer = constraint.get('installer', None) LOG.info("cur_pod:%s, cur_installer:%s,tc_constraints:%s", cur_pod, cur_installer, constraint) - if cur_pod and tc_fit_pod and cur_pod not in tc_fit_pod: + if (cur_pod is None) or (tc_fit_pod and cur_pod not in tc_fit_pod): return False - if cur_installer and tc_fit_installer and \ - cur_installer not in tc_fit_installer: + if (cur_installer is None) or (tc_fit_installer and cur_installer + not in tc_fit_installer): return False return True