From da7798b0f526a6346b49283cf21f3c7fde91d105 Mon Sep 17 00:00:00 2001 From: Renat Akhmerov Date: Mon, 21 Nov 2016 15:53:41 +0700 Subject: [PATCH] Fix config import in javascript action module Before this fix we couldn't individually run a number of unit tests from IDE because this module was importing configuration from oslo directly w/o giving a chance to load all needed config options defined in mistral/config.py Change-Id: Id538d773e1e3052d6fd7478e1baf5039be4d1a9a --- mistral/utils/javascript.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mistral/utils/javascript.py b/mistral/utils/javascript.py index a05f79b6..ab5d7e99 100644 --- a/mistral/utils/javascript.py +++ b/mistral/utils/javascript.py @@ -15,12 +15,11 @@ import abc import json -from oslo_config import cfg from oslo_utils import importutils +from mistral import config as cfg from mistral import exceptions as exc -CONF = cfg.CONF _PYV8 = importutils.try_import('PyV8') _V8EVAL = importutils.try_import('v8eval') @@ -62,7 +61,7 @@ class V8EvalEvaluator(JSEvaluator): encoding='UTF-8')) -EVALUATOR = (V8EvalEvaluator if CONF.js_implementation == 'v8eval' +EVALUATOR = (V8EvalEvaluator if cfg.CONF.js_implementation == 'v8eval' else PyV8Evaluator)