Merge "Bugfix: report date format wrong when upload result data to mongoDB"
[yardstick.git] / yardstick / common / task_template.py
index 2739323..9acc213 100755 (executable)
@@ -7,12 +7,14 @@
 # http://www.apache.org/licenses/LICENSE-2.0
 # yardstick: this file is copied from rally and slightly modified
 ##############################################################################
+from __future__ import absolute_import
 import re
 import jinja2
 import jinja2.meta
 
 
 class TaskTemplate(object):
+
     @classmethod
     def render(cls, task_template, **kwargs):
         """Render jinja2 task template to Yardstick input task.
@@ -43,11 +45,11 @@ def is_really_missing(mis, task_template):
     # Removing variables that have default values from
     # missing. Construction that won't be properly
     # check is {% set x = x or 1}
-    if re.search(mis.join(["{%\s*set\s+", "\s*=\s*", "[^\w]+"]),
+    if re.search(mis.join([r"{%\s*set\s+", "\s*=\s*", r"[^\w]+"]),
                  task_template):
         return False
     # Also check for a default filter which can show up as
     # a missing variable
-    if re.search(mis + "\s*\|\s*default\(", task_template):
+    if re.search(mis + r"\s*\|\s*default\(", task_template):
         return False
     return True