diff options
author | Xavier Simonart <xavier.simonart@intel.com> | 2018-02-22 16:19:38 +0100 |
---|---|---|
committer | Ross Brattain <ross.b.brattain@intel.com> | 2018-03-05 17:33:48 +0000 |
commit | 94abcc7d80aa8e13a7c77b99483f08bee7c20fb2 (patch) | |
tree | e82cbf85d6126e4e6906602475f2c08e7031ce54 | |
parent | 56af3286c98a6c562a821f479a1a4c66262dcbab (diff) |
Fix report generation
The command "yardstick report generate task_id yaml_name" was returning
some errors and failing to generate a html report.
With this fix an html report will be generated with all data from influx.
JIRA: YARDSTICK-1023
Change-Id: If9aab4b85cfb2b5809f608568e1adb2ddeec8b78
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
-rw-r--r-- | yardstick/benchmark/core/report.py | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/yardstick/benchmark/core/report.py b/yardstick/benchmark/core/report.py index 997a125e7..199602444 100644 --- a/yardstick/benchmark/core/report.py +++ b/yardstick/benchmark/core/report.py @@ -45,7 +45,7 @@ class Report(object): self.task_id = "" def _validate(self, yaml_name, task_id): - if re.match("^[a-z0-9_-]+$", yaml_name): + if re.match(r"^[\w-]+$", yaml_name): self.yaml_name = yaml_name else: raise ValueError("invalid yaml_name", yaml_name) @@ -102,10 +102,12 @@ class Report(object): task_time = str(task_time, 'utf8') key = str(key, 'utf8') task_time = task_time[11:] - head, sep, tail = task_time.partition('.') + head, _, tail = task_time.partition('.') task_time = head + "." + tail[:6] self.Timestamp.append(task_time) - if isinstance(task[key], float) is True: + if task[key] is None: + values.append('') + elif isinstance(task[key], (int, float)) is True: values.append(task[key]) else: values.append(ast.literal_eval(task[key])) |