|
|
|
@ -83,6 +83,23 @@ lDaemonActivityLogDict={} #Словарь отработанных активн
|
|
|
|
|
lDaemonLastDateTime=datetime.datetime.now()
|
|
|
|
|
gSettingsDict["Server"]["WorkingDirectoryPathStr"] = os.getcwd() # Set working directory in g settings
|
|
|
|
|
|
|
|
|
|
# Init SettingsUpdate defs from file list (after RDP restore)
|
|
|
|
|
lSettingsUpdateFilePathList = gSettingsDict.get("OrchestratorStart", {}).get("DefSettingsUpdatePathList",[])
|
|
|
|
|
lSubmoduleFunctionName = "SettingsUpdate"
|
|
|
|
|
lSettingsPath = "\\".join(os.path.join(os.getcwd(), __file__).split("\\")[:-1])
|
|
|
|
|
for lModuleFilePathItem in lSettingsUpdateFilePathList: # Import defs with try catch
|
|
|
|
|
try: # Try to init - go next if error and log in logger
|
|
|
|
|
lModuleName = lModuleFilePathItem[0:-3]
|
|
|
|
|
lFileFullPath = os.path.join(lSettingsPath, lModuleFilePathItem)
|
|
|
|
|
lTechSpecification = importlib.util.spec_from_file_location(lModuleName, lFileFullPath)
|
|
|
|
|
lTechModuleFromSpec = importlib.util.module_from_spec(lTechSpecification)
|
|
|
|
|
lTechSpecificationModuleLoader = lTechSpecification.loader.exec_module(lTechModuleFromSpec)
|
|
|
|
|
if lSubmoduleFunctionName in dir(lTechModuleFromSpec):
|
|
|
|
|
# Run SettingUpdate function in submodule
|
|
|
|
|
getattr(lTechModuleFromSpec, lSubmoduleFunctionName)(gSettingsDict)
|
|
|
|
|
except Exception as e:
|
|
|
|
|
if lL: lL.exception(f"Error when init .py file in orchestrator '{lModuleFilePathItem}'. Exception is below:")
|
|
|
|
|
|
|
|
|
|
# Turn on backward compatibility
|
|
|
|
|
BackwardCompatibility.Update(inGSettings= gSettingsDict)
|
|
|
|
|
|
|
|
|
|