summaryrefslogtreecommitdiffstats
path: root/yardstick/dispatcher
diff options
context:
space:
mode:
authorchenjiankun <chenjiankun1@huawei.com>2017-05-03 01:05:01 +0000
committerchenjiankun <chenjiankun1@huawei.com>2017-05-03 02:16:29 +0000
commit1f59f2e6769cc7ae6f3b73eb1ce8ee09f2929f72 (patch)
treeb937c6a1797c5b3d21dae5886b5c728b09de9a1a /yardstick/dispatcher
parent284c0a3e13aa1c3cc83bac3d4c9d6b69fc479b79 (diff)
Bugfix: KeyError when using http dispatcher
JIRA: YARDSTICK-632 When we use http dispatcher to output yardstick result. It can upload data, but when we query the data, it get a KeyError. Change-Id: I5410c207c68cff2621ff8184ae17daa4c286cea5 Signed-off-by: chenjiankun <chenjiankun1@huawei.com>
Diffstat (limited to 'yardstick/dispatcher')
-rw-r--r--yardstick/dispatcher/http.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/yardstick/dispatcher/http.py b/yardstick/dispatcher/http.py
index e3bcbc89b..0d8d2a346 100644
--- a/yardstick/dispatcher/http.py
+++ b/yardstick/dispatcher/http.py
@@ -32,7 +32,7 @@ LOG = logging.getLogger(__name__)
CONF = cfg.CONF
http_dispatcher_opts = [
cfg.StrOpt('target',
- default='http://127.0.0.1:8000/results',
+ default=os.getenv('TARGET', 'http://127.0.0.1:8000/results'),
help='The target where the http request will be sent. '
'If this is not set, no data will be posted. For '
'example: target = http://hostname:1234/path'),
@@ -62,7 +62,8 @@ class HttpDispatcher(DispatchBase):
"description": "yardstick test cases result",
"pod_name": os.environ.get('NODE_NAME', 'unknown'),
"installer": os.environ.get('INSTALLER_TYPE', 'unknown'),
- "version": os.environ.get('YARDSTICK_VERSION', 'unknown')
+ "version": os.environ.get('YARDSTICK_VERSION', 'unknown'),
+ "build_tag": os.environ.get('BUILD_TAG')
}
def record_result_data(self, data):
@@ -75,7 +76,7 @@ class HttpDispatcher(DispatchBase):
'be posted.')
return
- self.result["details"] = self.raw_result
+ self.result["details"] = {'results': self.raw_result}
case_name = ""
for v in self.raw_result: