summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJack Chan <chenjiankun1@huawei.com>2018-03-22 08:23:00 +0000
committerGerrit Code Review <gerrit@opnfv.org>2018-03-22 08:23:00 +0000
commit00e5a93349c1213a09cff9a5547ab1b9e83afc77 (patch)
tree1c5aa796d705aa1dfb57c47fc5c806263360c337
parent612b7112144dc689652e035131417fc0d8686b38 (diff)
parente0e56c49ed2fde81aaf745068429f18bc7ed4e2c (diff)
Merge "Running Test Case in Latest Yardstick Docker Image shows Error"
-rw-r--r--yardstick/benchmark/core/task.py16
1 files changed, 13 insertions, 3 deletions
diff --git a/yardstick/benchmark/core/task.py b/yardstick/benchmark/core/task.py
index 4272a6db9..955b8cae2 100644
--- a/yardstick/benchmark/core/task.py
+++ b/yardstick/benchmark/core/task.py
@@ -614,15 +614,25 @@ class TaskParser(object): # pragma: no cover
vnf__0: vnf_0.yardstick
"""
def qualified_name(name):
- node_name, context_name = name.split('.')
+ try:
+ # for openstack
+ node_name, context_name = name.split('.')
+ sep = '.'
+ except ValueError:
+ # for kubernetes, some kubernetes resources don't support
+ # name format like 'xxx.xxx', so we use '-' instead
+ # need unified later
+ node_name, context_name = name.split('-')
+ sep = '-'
+
try:
ctx = next((context for context in contexts
- if context.assigned_name == context_name))
+ if context.assigned_name == context_name))
except StopIteration:
raise y_exc.ScenarioConfigContextNameNotFound(
context_name=context_name)
- return '{}.{}'.format(node_name, ctx.name)
+ return '{}{}{}'.format(node_name, sep, ctx.name)
if 'host' in scenario:
scenario['host'] = qualified_name(scenario['host'])