We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent f24cb55 commit 47332acCopy full SHA for 47332ac
cmdb-api/api/lib/cmdb/value.py
@@ -3,7 +3,7 @@
3
4
from __future__ import unicode_literals
5
6
-import imp
+import importlib.util
7
8
import copy
9
import jinja2
@@ -198,11 +198,11 @@ def _compute_attr_value_from_script(script, ci_dict):
198
199
try:
200
path = script_f.name
201
- dir_name, name = os.path.dirname(path), os.path.basename(path)[:-3]
+ name = os.path.basename(path)[:-3]
202
203
- fp, path, desc = imp.find_module(name, [dir_name])
204
-
205
- mod = imp.load_module(name, fp, path, desc)
+ spec = importlib.util.spec_from_file_location(name, path)
+ mod = importlib.util.module_from_spec(spec)
+ spec.loader.exec_module(mod)
206
207
if hasattr(mod, 'computed'):
208
return mod.computed()
0 commit comments