60 @return text result of the import action |
61 @return text result of the import action |
61 @rtype str |
62 @rtype str |
62 """ |
63 """ |
63 sys.path.insert(1, path) |
64 sys.path.insert(1, path) |
64 try: |
65 try: |
65 importedModule = __import__(module, globals(), locals(), [], 0) |
66 importedModule = importlib.import_module(module) |
66 self.services[fn] = importedModule.initService() |
67 self.services[fn] = importedModule.initService() |
67 with contextlib.suppress(AttributeError): |
68 with contextlib.suppress(AttributeError): |
68 self.batchServices["batch_" + fn] = importedModule.initBatchService() |
69 self.batchServices["batch_" + fn] = importedModule.initBatchService() |
69 return "ok" |
70 return "ok" |
70 except ImportError as err: |
71 except ImportError as err: |