orc log eng to rus

dev-linux
robo-bo 2 years ago
parent 04ec23bbc5
commit 770aefd6cb

@ -108,7 +108,7 @@ def v1_2_0_Monitor_ControlPanelDictGet_SessionCheckInit(inRequest,inGlobalDict):
if lCookieSessionGUIDStr in inGlobalDict["Client"]["Session"]["TechnicalSessionGUIDCache"]: if lCookieSessionGUIDStr in inGlobalDict["Client"]["Session"]["TechnicalSessionGUIDCache"]:
lItemValue = inGlobalDict["Client"]["Session"]["TechnicalSessionGUIDCache"][lCookieSessionGUIDStr] lItemValue = inGlobalDict["Client"]["Session"]["TechnicalSessionGUIDCache"][lCookieSessionGUIDStr]
if (time.time() - lTimeStartSecFloat) >= lLifetimeRequestSecFloat: # Check if lifetime client request is over or has no key if (time.time() - lTimeStartSecFloat) >= lLifetimeRequestSecFloat: # Check if lifetime client request is over or has no key
if lL: lL.debug(f"Client request lifetime is over") if lL: lL.debug(f"Время жизни HTTP запроса истекло - удалить из отслеживаемых!")
lDoWhileBool = False # Stop the iterations lDoWhileBool = False # Stop the iterations
if lDoWhileBool: if lDoWhileBool:
TechnicalCheck() # Calculate the CP TechnicalCheck() # Calculate the CP
@ -277,7 +277,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
"ArgLogger": "inLogger" # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgLogger": "inLogger" # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
} }
else: else:
raise Exception(f"BackwardCompatibility up to v1.2.0, old processor: No type {inActivityOld['Type']} has been found in old processor.") raise Exception(f"Обратная совместимость до v1.2.0, старый процессор: Тип {inActivityOld['Type']} был обнаружен в старом процессоре")
return lResult # return the result return lResult # return the result
@ -295,7 +295,7 @@ def Update(inGSettings):
inGSettings["Autocleaner"] = { # Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings inGSettings["Autocleaner"] = { # Some gurbage is collecting in g settings. So you can configure autocleaner to periodically clear gSettings
"IntervalSecFloat": 7200.0, # Sec float to periodically clear gsettings "IntervalSecFloat": 7200.0, # Sec float to periodically clear gsettings
} }
if lL: lL.warning(f"Backward compatibility (v1.1.13 to v1.1.14): Add default 'Autocleaner' structure") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (от v1.1.13 до v1.1.14): Добавить 'Autocleaner' структуру") # Log about compatibility
if "Client" not in inGSettings: # Add "Client" structure if "Client" not in inGSettings: # Add "Client" structure
inGSettings["Client"] = { # Settings about client web orchestrator inGSettings["Client"] = { # Settings about client web orchestrator
"Session":{ # Settings about web session. Session algorythms works only for special requests (URL in ServerSettings) "Session":{ # Settings about web session. Session algorythms works only for special requests (URL in ServerSettings)
@ -318,14 +318,14 @@ def Update(inGSettings):
} }
} }
} }
if lL: lL.warning(f"Backward compatibility (v1.1.13 to v1.1.14): Add default 'Client' structure") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.13 -> v1.1.14): Добавить структуру 'Client'") # Log about compatibility
if "Server" in inGSettings and "RequestTimeoutSecFloat" not in inGSettings["Server"]: # Add Server > "RequestTimeoutSecFloat" property if "Server" in inGSettings and "RequestTimeoutSecFloat" not in inGSettings["Server"]: # Add Server > "RequestTimeoutSecFloat" property
inGSettings["Server"]["RequestTimeoutSecFloat"] = 300 # Time to handle request in seconds inGSettings["Server"]["RequestTimeoutSecFloat"] = 300 # Time to handle request in seconds
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.1.13 to v1.1.14): Add default 'Server' > 'RequestTimeoutSecFloat' property") # Log about compatibility f"Backward compatibility (v1.1.13 to v1.1.14): Add default 'Server' > 'RequestTimeoutSecFloat' property") # Log about compatibility
if "DefSettingsUpdatePathList" not in inGSettings["OrchestratorStart"]: # Add OrchestratorStart > "DefSettingsUpdatePathList" property if "DefSettingsUpdatePathList" not in inGSettings["OrchestratorStart"]: # Add OrchestratorStart > "DefSettingsUpdatePathList" property
inGSettings["OrchestratorStart"]["DefSettingsUpdatePathList"] = [] # List of the .py files which should be loaded before init the algorythms inGSettings["OrchestratorStart"]["DefSettingsUpdatePathList"] = [] # List of the .py files which should be loaded before init the algorythms
if lL: lL.warning(f"Backward compatibility (v1.1.13 to v1.1.14): Add default 'OrchestratorStart' > 'DefSettingsUpdatePathList' property list") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.13 -> v1.1.14): Преобразовать структуру 'OrchestratorStart' > 'DefSettingsUpdatePathList'") # Log about compatibility
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
# v1.1.20 to v1.2.0 # v1.1.20 to v1.2.0
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
@ -338,14 +338,14 @@ def Update(inGSettings):
"DumpLogList": [], # Will be filled automatically "DumpLogList": [], # Will be filled automatically
"DumpLogListHashStr": None, # Will be filled automatically "DumpLogListHashStr": None, # Will be filled automatically
}) })
if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Create new attribute 'Client > DumpLog... with default parameters'") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.20 -> v1.2.0): Создать атрибут 'Client > DumpLog... с параметрами по умолчанию'") # Log about compatibility
if "Processor" in inGSettings: # Check if Processor exist if "Processor" in inGSettings: # Check if Processor exist
# Update Logger # Update Logger
if lL is not None: if lL is not None:
SettingsTemplate.LoggerDumpLogHandlerAdd(inLogger=lL, inGSettingsClientDict=inGSettings["Client"]) SettingsTemplate.LoggerDumpLogHandlerAdd(inLogger=lL, inGSettingsClientDict=inGSettings["Client"])
if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Add web dump log in logger as handler") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.20 -> v1.2.0): Добавить веб дамп для отображения лога на веб клиенте оркестратора") # Log about compatibility
del inGSettings["Processor"] # Remove the key del inGSettings["Processor"] # Remove the key
if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Remove old structure 'Processor'") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.20 -> v1.2.0): Удалить структуру старого процессора 'Processor'") # Log about compatibility
if "ProcessorDict" not in inGSettings: # Create new ProcessorDict structure if "ProcessorDict" not in inGSettings: # Create new ProcessorDict structure
inGSettings["ProcessorDict"]={ inGSettings["ProcessorDict"]={
"ActivityList": [ # List of the activities "ActivityList": [ # List of the activities
@ -361,14 +361,14 @@ def Update(inGSettings):
"ExecuteBool": True, # Flag to execute thread processor "ExecuteBool": True, # Flag to execute thread processor
"ThreadIdInt": None # Fill thread id when processor will be inited "ThreadIdInt": None # Fill thread id when processor will be inited
} }
if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Create new structure 'ProcessorDict'") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.20 -> v1.2.0): Создать новую структуру 'ProcessorDict'") # Log about compatibility
if "VersionStr" not in inGSettings: # Create new ProcessorDict structure if "VersionStr" not in inGSettings: # Create new ProcessorDict structure
inGSettings["VersionStr"] = None inGSettings["VersionStr"] = None
if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Create new attribute 'VersionStr'") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.20 -> v1.2.0): Создать новую структуру 'VersionStr'") # Log about compatibility
if "AgentDict" not in inGSettings: # Create new AgentDict structure if "AgentDict" not in inGSettings: # Create new AgentDict structure
inGSettings["AgentDict"]= {} inGSettings["AgentDict"]= {}
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.1.20 to v1.2.0): Create new attribute 'AgentDict'") # Log about compatibility f"Обратная совместимость (v1.1.20 -> v1.2.0): Создать новую структуру 'AgentDict'") # Log about compatibility
# Alg to convert UAC ControlPanelAllawedList to UACClient hierarchy # Alg to convert UAC ControlPanelAllawedList to UACClient hierarchy
# if inGSettings["Server"]["AccessUsers"]["FlagCredentialsAsk"] is True: # if inGSettings["Server"]["AccessUsers"]["FlagCredentialsAsk"] is True:
# lUserRights = inGSettings["Server"]["AccessUsers"]["RuleDomainUserDict"][(inRequest.OpenRPA["Domain"].upper(), inRequest.OpenRPA["User"].upper())] # lUserRights = inGSettings["Server"]["AccessUsers"]["RuleDomainUserDict"][(inRequest.OpenRPA["Domain"].upper(), inRequest.OpenRPA["User"].upper())]
@ -379,7 +379,7 @@ def Update(inGSettings):
# Check if Server is active > convert to ServerDict # Check if Server is active > convert to ServerDict
inGSettings["ServerDict"] = inGSettings["Server"] inGSettings["ServerDict"] = inGSettings["Server"]
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.1.20 to v1.2.0): Convert Server to ServerDict") # Log about compatibility f"Обратная совместимость (v1.1.20 -> v1.2.0): Преобразовать 'Server' -> 'ServerDict'") # Log about compatibility
# Remove old structure Scheduler # Remove old structure Scheduler
del inGSettings["Server"] del inGSettings["Server"]
lShowWarnBool = False lShowWarnBool = False
@ -401,7 +401,7 @@ def Update(inGSettings):
# remove "ControlPanelKeyAllowedList" - will be removed in __Orchestrator__.UACUpdate # remove "ControlPanelKeyAllowedList" - will be removed in __Orchestrator__.UACUpdate
#del inGSettings["ServerDict"]["AccessUsers"]["RuleDomainUserDict"][lItemKeyTurple]["ControlPanelKeyAllowedList"] #del inGSettings["ServerDict"]["AccessUsers"]["RuleDomainUserDict"][lItemKeyTurple]["ControlPanelKeyAllowedList"]
if lShowWarnBool: # Show only 1 warning per all run if lShowWarnBool: # Show only 1 warning per all run
if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Convert CP allowed list to UAC Client hierarchy (consolidated)") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.20 -> v1.2.0): Интегрировать структуру доступа к панелям управления в общую UAC иерархию") # Log about compatibility
# Check if ControlPanelDict is active > convert to CPDict # Check if ControlPanelDict is active > convert to CPDict
if "ControlPanelDict" in inGSettings: if "ControlPanelDict" in inGSettings:
if "CPDict" not in inGSettings: inGSettings["CPDict"]={} if "CPDict" not in inGSettings: inGSettings["CPDict"]={}
@ -409,7 +409,7 @@ def Update(inGSettings):
inGSettings["CPDict"][lItemDict["KeyStr"]]={"HTMLRenderDef":lItemDict["RenderFunction"], "JSONGeneratorDef":None, "JSInitGeneratorDef":None} inGSettings["CPDict"][lItemDict["KeyStr"]]={"HTMLRenderDef":lItemDict["RenderFunction"], "JSONGeneratorDef":None, "JSInitGeneratorDef":None}
# Remove old structure ControlPanel # Remove old structure ControlPanel
del inGSettings["ControlPanelDict"] del inGSettings["ControlPanelDict"]
if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Convert ControlPanelDict to CPDict") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.20 -> v1.2.0): Преобразовать 'ControlPanelDict' -> 'CPDict'") # Log about compatibility
# Check if Scheduler is active > convert to SchedulerDict # Check if Scheduler is active > convert to SchedulerDict
if "Scheduler" in inGSettings: if "Scheduler" in inGSettings:
if "SchedulerDict" not in inGSettings: inGSettings["SchedulerDict"]={ "CheckIntervalSecFloat": 5.0, "ActivityTimeList":[]} if "SchedulerDict" not in inGSettings: inGSettings["SchedulerDict"]={ "CheckIntervalSecFloat": 5.0, "ActivityTimeList":[]}
@ -423,27 +423,27 @@ def Update(inGSettings):
inGSettings["SchedulerDict"]["ActivityTimeList"].append(lItemDict) inGSettings["SchedulerDict"]["ActivityTimeList"].append(lItemDict)
# Remove old structure Scheduler # Remove old structure Scheduler
del inGSettings["Scheduler"] del inGSettings["Scheduler"]
if lL: lL.warning(f"Backward compatibility (v1.1.20 to v1.2.0): Convert Scheduler to SchedulerDict with new features") # Log about compatibility if lL: lL.warning(f"Обратная совместимость (v1.1.20 -> v1.2.0): Преобразовать 'Scheduler' -> 'SchedulerDict' с новыми функциональными возможностями") # Log about compatibility
# # Convert to Storage to StorageDict # # Convert to Storage to StorageDict
if "Storage" in inGSettings: if "Storage" in inGSettings:
# Check if Server is active > convert to ServerDict # Check if Server is active > convert to ServerDict
inGSettings["StorageDict"] = inGSettings["Storage"] inGSettings["StorageDict"] = inGSettings["Storage"]
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.1 to v1.2.2): Convert Storage to StorageDict") # Log about compatibility f"Обратная совместимость (v1.2.1 -> v1.2.2): Преобразовать 'Storage' -> 'StorageDict'") # Log about compatibility
# Remove old structure Scheduler # Remove old structure Scheduler
del inGSettings["Storage"] del inGSettings["Storage"]
# Add new key WarningExecutionMoreThanSecFloat in ProcessorDict # Add new key WarningExecutionMoreThanSecFloat in ProcessorDict
if "WarningExecutionMoreThanSecFloat" not in inGSettings["ProcessorDict"]: if "WarningExecutionMoreThanSecFloat" not in inGSettings["ProcessorDict"]:
inGSettings["ProcessorDict"]["WarningExecutionMoreThanSecFloat"] = 60.0 inGSettings["ProcessorDict"]["WarningExecutionMoreThanSecFloat"] = 60.0
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.1 to v1.2.2): Add key WarningExecutionMoreThanSecFloat in ProcessorDict") # Log about compatibility f"Обратная совместимость (v1.2.1 -> v1.2.2): Добавить ключ 'WarningExecutionMoreThanSecFloat' -> 'ProcessorDict'") # Log about compatibility
# Add new key AgentActivityLifetimeSecFloat, AgentConnectionLifetimeSecFloat, AgentLoopSleepSecFloat in ProcessorDict > ServerDict # Add new key AgentActivityLifetimeSecFloat, AgentConnectionLifetimeSecFloat, AgentLoopSleepSecFloat in ProcessorDict > ServerDict
if "AgentActivityLifetimeSecFloat" not in inGSettings["ServerDict"]: if "AgentActivityLifetimeSecFloat" not in inGSettings["ServerDict"]:
inGSettings["ServerDict"]["AgentActivityLifetimeSecFloat"] = 1200.0 inGSettings["ServerDict"]["AgentActivityLifetimeSecFloat"] = 1200.0
inGSettings["ServerDict"]["AgentConnectionLifetimeSecFloat"] = 300.0 inGSettings["ServerDict"]["AgentConnectionLifetimeSecFloat"] = 300.0
inGSettings["ServerDict"]["AgentLoopSleepSecFloat"] = 2.0 inGSettings["ServerDict"]["AgentLoopSleepSecFloat"] = 2.0
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.1 to v1.2.2): Add key AgentActivityLifetimeSecFloat, AgentConnectionLifetimeSecFloat, AgentLoopSleepSecFloat in ProcessorDict > ServerDict") # Log about compatibility f"Обратная совместимость (v1.2.1 -> v1.2.2): Добавить ключи: 'AgentActivityLifetimeSecFloat', 'AgentConnectionLifetimeSecFloat', 'AgentLoopSleepSecFloat' -> 'ProcessorDict' > 'ServerDict'") # Log about compatibility
# Add new key RecoveryDict in ProcessorDict > RobotRDPActive # Add new key RecoveryDict in ProcessorDict > RobotRDPActive
if "RecoveryDict" not in inGSettings["RobotRDPActive"]: if "RecoveryDict" not in inGSettings["RobotRDPActive"]:
inGSettings["RobotRDPActive"]["RecoveryDict"] = { inGSettings["RobotRDPActive"]["RecoveryDict"] = {
@ -457,7 +457,7 @@ def Update(inGSettings):
} }
} }
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.1 to v1.2.2): Add new key RecoveryDict in ProcessorDict > RobotRDPActive") # Log about compatibility f"Обратная совместимость (v1.2.1 -> v1.2.2): Добавить ключ 'RecoveryDict' -> 'ProcessorDict' > 'RobotRDPActive'") # Log about compatibility
# Add new key ServerDict > ListenDict # Add new key ServerDict > ListenDict
if "ListenDict" not in inGSettings["ServerDict"]: if "ListenDict" not in inGSettings["ServerDict"]:
lPortInt = inGSettings.get("ServerDict",{}).get("ListenPort",80) lPortInt = inGSettings.get("ServerDict",{}).get("ListenPort",80)
@ -471,7 +471,7 @@ def Update(inGSettings):
} }
} }
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.2 to v1.2.3): Add new key ServerDict > ListenDict. Transfer port from ServerDict > ListenPort") # Log about compatibility f"Обратная совместимость (v1.2.2 -> v1.2.3): Добавить ключ 'ServerDict' > 'ListenDict'. Изменение свойства, отвечающее за прослушиваемый порт 'ServerDict' > 'ListenPort'") # Log about compatibility
# Add new key # Add new key
#"ServerDict": { #"ServerDict": {
# "AgentFileChunkBytesSizeInt": 50000000, # size of the each chunk for the agent transmition # "AgentFileChunkBytesSizeInt": 50000000, # size of the each chunk for the agent transmition
@ -479,24 +479,24 @@ def Update(inGSettings):
if "AgentFileChunkBytesSizeInt" not in inGSettings["ServerDict"]: if "AgentFileChunkBytesSizeInt" not in inGSettings["ServerDict"]:
inGSettings["ServerDict"]["AgentFileChunkBytesSizeInt"]= 50000000 inGSettings["ServerDict"]["AgentFileChunkBytesSizeInt"]= 50000000
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.3 to v1.2.4): Add new key ServerDict > AgentFileChunkBytesSizeInt") # Log about compatibility f"Обратная совместимость (v1.2.3 -> v1.2.4): Добавить ключ ServerDict > AgentFileChunkBytesSizeInt") # Log about compatibility
if "AgentFileChunkCheckIntervalSecFloat" not in inGSettings["ServerDict"]: if "AgentFileChunkCheckIntervalSecFloat" not in inGSettings["ServerDict"]:
inGSettings["ServerDict"]["AgentFileChunkCheckIntervalSecFloat"]= 0.2 inGSettings["ServerDict"]["AgentFileChunkCheckIntervalSecFloat"]= 0.2
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.3 to v1.2.4): Add new key ServerDict > AgentFileChunkCheckIntervalSecFloat") # Log about compatibility f"Обратная совместимость (v1.2.3 -> v1.2.4): Добавить ключ ServerDict > AgentFileChunkCheckIntervalSecFloat") # Log about compatibility
if "ServerThread" not in inGSettings["ServerDict"]: if "ServerThread" not in inGSettings["ServerDict"]:
inGSettings["ServerDict"]["ServerThread"]= None inGSettings["ServerDict"]["ServerThread"]= None
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.3 to v1.2.4): Add new key ServerDict > ServerThread") # Log about compatibility f"Обратная совместимость (v1.2.3 -> v1.2.4): Добавить ключ ServerDict > ServerThread") # Log about compatibility
if "AgentLimitLogSizeBytesInt" not in inGSettings["ServerDict"]: if "AgentLimitLogSizeBytesInt" not in inGSettings["ServerDict"]:
inGSettings["ServerDict"]["AgentLimitLogSizeBytesInt"] = 300 inGSettings["ServerDict"]["AgentLimitLogSizeBytesInt"] = 300
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.3 to v1.2.4): Add new key ServerDict > AgentLimitLogSizeBytesInt") # Log about compatibility f"Обратная совместимость (v1.2.3 -> v1.2.4): Добавить ключ ServerDict > AgentLimitLogSizeBytesInt") # Log about compatibility
# Remove ControlPanelDict and CPDict > go to ServerDict > ControlPanelDict # Remove ControlPanelDict and CPDict > go to ServerDict > ControlPanelDict
if "ControlPanelDict" in inGSettings: if "ControlPanelDict" in inGSettings:
del inGSettings["ControlPanelDict"] del inGSettings["ControlPanelDict"]
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.4 to v1.2.7): Remove old key: ControlPanelDict") # Log about compatibility f"Обратная совместимость (v1.2.4 -> v1.2.7): Удалить ключ ControlPanelDict") # Log about compatibility
if "CPDict" in inGSettings: if "CPDict" in inGSettings:
for lCPKeyStr in inGSettings["CPDict"]: for lCPKeyStr in inGSettings["CPDict"]:
lCPItemDict = inGSettings["CPDict"][lCPKeyStr] lCPItemDict = inGSettings["CPDict"][lCPKeyStr]
@ -505,40 +505,40 @@ def Update(inGSettings):
inJSInitGeneratorDef=lCPItemDict["JSInitGeneratorDef"]) inJSInitGeneratorDef=lCPItemDict["JSInitGeneratorDef"])
del inGSettings["CPDict"] del inGSettings["CPDict"]
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.4 to v1.2.7): Remove old key: CPDict") # Log about compatibility f"Обратная совместимость (v1.2.4 -> v1.2.7): Удалить ключ: CPDict") # Log about compatibility
if "ControlPanelDict" not in inGSettings["ServerDict"]: if "ControlPanelDict" not in inGSettings["ServerDict"]:
inGSettings["ServerDict"]["ControlPanelDict"]={} inGSettings["ServerDict"]["ControlPanelDict"]={}
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.4 to v1.2.7): Create new key: ServerDict > ControlPanelDict") # Log about compatibility f"Обратная совместимость (v1.2.4 -> v1.2.7): Добавить ключ: ServerDict > ControlPanelDict") # Log about compatibility
# ManagersProcessDict # ManagersProcessDict
if "ManagersProcessDict" not in inGSettings: if "ManagersProcessDict" not in inGSettings:
inGSettings["ManagersProcessDict"]={} inGSettings["ManagersProcessDict"]={}
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.4 to v1.2.7): Create new key: ManagersProcessDict") # Log about compatibility f"Обратная совместимость (v1.2.4 -> v1.2.7): Добавить ключ: ManagersProcessDict") # Log about compatibility
# Check "SchedulerDict": { "Schedule": schedule, # https://schedule.readthedocs.io/en/stable/examples.html # Check "SchedulerDict": { "Schedule": schedule, # https://schedule.readthedocs.io/en/stable/examples.html
if inGSettings.get("SchedulerDict",{}).get("Schedule",None) is None: if inGSettings.get("SchedulerDict",{}).get("Schedule",None) is None:
inGSettings["SchedulerDict"]["Schedule"] = schedule inGSettings["SchedulerDict"]["Schedule"] = schedule
if lL: lL.warning(f"Backward compatibility (v1.2.4 to v1.2.7): Create new module schedule (schedule.readthedocs.io)") # Log about compatibility if lL: lL.warning(f"Backward compatibility (v1.2.4 to v1.2.7): Подключить новый модуль расписания (см. schedule.readthedocs.io)") # Log about compatibility
# ManagersGitDict # ManagersGitDict
if "ManagersGitDict" not in inGSettings: if "ManagersGitDict" not in inGSettings:
inGSettings["ManagersGitDict"]={} inGSettings["ManagersGitDict"]={}
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.4 to v1.2.7): Create new key: ManagersGitDict") # Log about compatibility f"Обратная совместимость (v1.2.4 -> v1.2.7): Добавить ключ: ManagersGitDict") # Log about compatibility
# ProcessorDict > ActivityItemNowDict # ProcessorDict > ActivityItemNowDict
if "ActivityItemNowDict" not in inGSettings["ProcessorDict"]: if "ActivityItemNowDict" not in inGSettings["ProcessorDict"]:
inGSettings["ProcessorDict"]["ActivityItemNowDict"]=None inGSettings["ProcessorDict"]["ActivityItemNowDict"]=None
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.4 to v1.2.7): Create new key: ProcessorDict > ActivityItemNowDict") # Log about compatibility f"Обратная совместимость (v1.2.4 -> v1.2.7): Добавить ключ: ProcessorDict > ActivityItemNowDict") # Log about compatibility
# # "UACBool": True # True - check user access before do this URL item # # "UACBool": True # True - check user access before do this URL item
for lURLItemDict in inGSettings["ServerDict"]["URLList"]: for lURLItemDict in inGSettings["ServerDict"]["URLList"]:
if "UACBool" not in lURLItemDict: if "UACBool" not in lURLItemDict:
lURLItemDict["UACBool"]=None lURLItemDict["UACBool"]=None
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.4 to v1.2.7): ServerDict > URLList > item: add UACBool = None") # Log about compatibility f"Обратная совместимость (v1.2.4 -> v1.2.7): ServerDict > URLList > item и UACBool = None") # Log about compatibility
# "URLIndexStr" # "URLIndexStr"
if "URLIndexStr" not in inGSettings["ServerDict"]: if "URLIndexStr" not in inGSettings["ServerDict"]:
inGSettings["ServerDict"]["URLIndexStr"] = "/" inGSettings["ServerDict"]["URLIndexStr"] = "/"
if lL: lL.warning( if lL: lL.warning(
f"Backward compatibility (v1.2.11 to v1.2.12): ServerDict > URLIndexStr: add URLIndexStr = /") # Log about compatibility f"Обратная совместимость (v1.2.11 -> v1.2.12): ServerDict > URLIndexStr и URLIndexStr = /") # Log about compatibility

@ -84,7 +84,7 @@ class ControlPanel():
""" """
# Connect self witch pyOpenRPA via ControlPanelNameStr # Connect self witch pyOpenRPA via ControlPanelNameStr
if inControlPanelNameStr in Orchestrator.GSettingsGet()["ServerDict"]["ControlPanelDict"]: if inControlPanelNameStr in Orchestrator.GSettingsGet()["ServerDict"]["ControlPanelDict"]:
raise Exception(f"Another control panel with name {inControlPanelNameStr} is already exists. Please resolve the error and restart") raise Exception(f"Ошибка: Ранее уже была инициализирована панель управления с идентификатором: {inControlPanelNameStr}. Устраните ошибку и перезапустите оркестратор")
Orchestrator.GSettingsGet()["ServerDict"]["ControlPanelDict"][inControlPanelNameStr] = self Orchestrator.GSettingsGet()["ServerDict"]["ControlPanelDict"][inControlPanelNameStr] = self
self.RefreshHTMLJinja2TemplatePathSet(inJinja2TemplatePathStr = inRefreshHTMLJinja2TemplatePathStr) self.RefreshHTMLJinja2TemplatePathSet(inJinja2TemplatePathStr = inRefreshHTMLJinja2TemplatePathStr)
self.mJinja2TemplateRefreshBool = inJinja2TemplateRefreshBool self.mJinja2TemplateRefreshBool = inJinja2TemplateRefreshBool
@ -116,7 +116,7 @@ class ControlPanel():
self.mRefreshHTMLJinja2Env = jinja2.Environment(loader=self.mRefreshHTMLJinja2Loader, trim_blocks=True) self.mRefreshHTMLJinja2Env = jinja2.Environment(loader=self.mRefreshHTMLJinja2Loader, trim_blocks=True)
self.mRefreshHTMLJinja2Template = self.mRefreshHTMLJinja2Env.get_template(lTemplateFileNameStr) self.mRefreshHTMLJinja2Template = self.mRefreshHTMLJinja2Env.get_template(lTemplateFileNameStr)
except Exception as e: except Exception as e:
Orchestrator.OrchestratorLoggerGet().exception("EXCEPTION WHEN INIT Jinja2") Orchestrator.OrchestratorLoggerGet().exception("Ошибка при инициализации Jinja2")
def RefreshHTMLJinja2StrGenerate(self, inDataDict): def RefreshHTMLJinja2StrGenerate(self, inDataDict):
""" """
@ -145,7 +145,7 @@ class ControlPanel():
self.mInitJSJinja2Env = jinja2.Environment(loader=self.mInitJSJinja2Loader, trim_blocks=True) self.mInitJSJinja2Env = jinja2.Environment(loader=self.mInitJSJinja2Loader, trim_blocks=True)
self.mInitJSJinja2Template = self.mInitJSJinja2Env.get_template(lTemplateFileNameStr) self.mInitJSJinja2Template = self.mInitJSJinja2Env.get_template(lTemplateFileNameStr)
except Exception as e: except Exception as e:
Orchestrator.OrchestratorLoggerGet().exception("EXCEPTION WHEN INIT Jinja2") Orchestrator.OrchestratorLoggerGet().exception("Ошибка при инициализации Jinja2")
def InitJSJinja2StrGenerate(self, inDataDict): def InitJSJinja2StrGenerate(self, inDataDict):
""" """
@ -290,7 +290,7 @@ class ControlPanel():
# Call backward compatibility HTML generator # Call backward compatibility HTML generator
lResultStr = Basic.HTMLControlPanelBC(inCPDict=lHTMLResult) lResultStr = Basic.HTMLControlPanelBC(inCPDict=lHTMLResult)
except Exception as e: except Exception as e:
if lL: lL.exception(f"Error in control panel HTMLRenderDef. CP Key {self.mControlPanelNameStr}. Exception are below") if lL: lL.exception(f"Ошибка в функции генерации HTML контента (HTMLRenderDef). Идентификатор панели управления: {self.mControlPanelNameStr}")
return lResultStr return lResultStr
@ -317,10 +317,10 @@ class ControlPanel():
if lType is str or lJSONResult is None or lType is int or lType is list or lType is dict or lType is bool or lType is float: if lType is str or lJSONResult is None or lType is int or lType is list or lType is dict or lType is bool or lType is float:
lResultDict = lJSONResult lResultDict = lJSONResult
else: else:
if lL: lL.warning(f"JSONGenerator return bad type: {str(type(lJSONResult))}, CP Key {self.mControlPanelNameStr}") if lL: lL.warning(f"Функция генерации JSON сформировала некорректную структуру: {str(type(lJSONResult))}, идентификатор панели управления: {self.mControlPanelNameStr}")
except Exception as e: except Exception as e:
if lL: lL.exception( if lL: lL.exception(
f"Error in control panel JSONGeneratorDef. CP Key {self.mControlPanelNameStr}. Exception are below") f"Ошибка при формирвоании JSON (JSONGeneratorDef). Идентификатор панели управления {self.mControlPanelNameStr}")
return lResultDict return lResultDict
def BackwardAdapterJSDef(self,inRequest): def BackwardAdapterJSDef(self,inRequest):
@ -343,8 +343,8 @@ class ControlPanel():
if type(lJSResult) is str: if type(lJSResult) is str:
lResultStr = lJSResult # Add delimiter to some cases lResultStr = lJSResult # Add delimiter to some cases
else: else:
if lL: lL.warning(f"JSInitGenerator return bad type: {str(type(lJSResult))}, CP Key {self.mControlPanelNameStr}") if lL: lL.warning(f"Функция JSInitGenerator вернула неверный формат данных: {str(type(lJSResult))}, идентификатор панели управления {self.mControlPanelNameStr}")
except Exception as e: except Exception as e:
if lL: lL.exception( if lL: lL.exception(
f"Error in control panel JSInitGeneratorDef. CP Key {self.mControlPanelNameStr}. Exception are below") f"Ошибка в функции формирования кода JavaScript (JSInitGeneratorDef). Идентификатор панели управления {self.mControlPanelNameStr}")
return lResultStr return lResultStr

@ -34,7 +34,7 @@ class Git():
self.mAgentHostNameStr = inAgentHostNameStr self.mAgentHostNameStr = inAgentHostNameStr
self.mAgentUserNameStr = inAgentUserNameStr self.mAgentUserNameStr = inAgentUserNameStr
lGS["ManagersGitDict"][(inAgentHostNameStr.upper(), inAgentUserNameStr.upper(), lAbsPathUpperStr)]=self lGS["ManagersGitDict"][(inAgentHostNameStr.upper(), inAgentUserNameStr.upper(), lAbsPathUpperStr)]=self
else: raise Exception(f"Managers.Git ({inAgentHostNameStr}, {inAgentUserNameStr}, {lAbsPathUpperStr}): Can't init the Git instance because it already inited in early") else: raise Exception(f"Модуль Managers.Git ({inAgentHostNameStr}, {inAgentUserNameStr}, {lAbsPathUpperStr}): Невозможно инициализировать экземпляр класса, так как он уже был инициализирован ранее")
def ProcessConnect(self, inProcess: Process): def ProcessConnect(self, inProcess: Process):
""" """

@ -108,7 +108,7 @@ class Process():
__Orchestrator__.ProcessorActivityItemAppend(inActivityItemDict=lActivityDict) __Orchestrator__.ProcessorActivityItemAppend(inActivityItemDict=lActivityDict)
if inStatusCheckIntervalSecFloat is not None: __Orchestrator__.OrchestratorScheduleGet().every(inStatusCheckIntervalSecFloat).seconds.do(Orchestrator.OrchestratorThreadStart,self.StatusCheck) if inStatusCheckIntervalSecFloat is not None: __Orchestrator__.OrchestratorScheduleGet().every(inStatusCheckIntervalSecFloat).seconds.do(Orchestrator.OrchestratorThreadStart,self.StatusCheck)
self.mStatusCheckIntervalSecFloat = inStatusCheckIntervalSecFloat self.mStatusCheckIntervalSecFloat = inStatusCheckIntervalSecFloat
else: raise Exception(f"Managers.Process ({inAgentHostNameStr}, {inAgentUserNameStr}, {inProcessNameWOExeStr}): Can't init the Process instance because it already inited in early (see ProcessInitSafe)") else: raise Exception(f"Модуль Managers.Process ({inAgentHostNameStr}, {inAgentUserNameStr}, {inProcessNameWOExeStr}): Невозможно инициализировать процесс, так как он был инициализирован ранее (см. ProcessInitSafe)")
def ManualStopTriggerSet(self, inMSTdTSecFloat: float, inMSTdNInt: int) -> None: def ManualStopTriggerSet(self, inMSTdTSecFloat: float, inMSTdNInt: int) -> None:
""" """
@ -350,7 +350,7 @@ class Process():
if self.mStatusStr == "2_STOP_SAFE": self.mStatusSavedStr = "0_STOPPED" if self.mStatusStr == "2_STOP_SAFE": self.mStatusSavedStr = "0_STOPPED"
elif self.mStatusStr == "3_STOP_SAFE_MANUAL": self.mStatusSavedStr = "1_STOPPED_MANUAL" elif self.mStatusStr == "3_STOP_SAFE_MANUAL": self.mStatusSavedStr = "1_STOPPED_MANUAL"
else: self.mStatusSavedStr = self.mStatusStr; lWarnSafeBool = False else: self.mStatusSavedStr = self.mStatusStr; lWarnSafeBool = False
if lWarnSafeBool==True: __Orchestrator__.OrchestratorLoggerGet().warning(f"Managers.Process ({self.mAgentHostNameStr}, {self.mAgentUserNameStr}, {self.mProcessNameWOExeStr}): Safe status has been catched when safe > change saved status to stopped.") if lWarnSafeBool==True: __Orchestrator__.OrchestratorLoggerGet().warning(f"Модуль Managers.Process ({self.mAgentHostNameStr}, {self.mAgentUserNameStr}, {self.mProcessNameWOExeStr}): Состояние безопасной остановки было обнаружено при попытке сохранить состояние > зафиксировать состояние как остановленное")
return self.mStatusStr return self.mStatusStr
@ -358,7 +358,7 @@ class Process():
"""Call from orchestrator when init """Call from orchestrator when init
""" """
if self.mStatusCheckIntervalSecFloat is not None: if self.mStatusCheckIntervalSecFloat is not None:
__Orchestrator__.OrchestratorLoggerGet().info(f"Managers.Process ({self.mAgentHostNameStr}, {self.mAgentUserNameStr}, {self.mProcessNameWOExeStr}): Restore schedule to StatusCheck in interval of {self.mStatusCheckIntervalSecFloat} sec.") __Orchestrator__.OrchestratorLoggerGet().info(f"Модуль Managers.Process ({self.mAgentHostNameStr}, {self.mAgentUserNameStr}, {self.mProcessNameWOExeStr}): Восстановить периодическую проверку состояния с интервалом в {self.mStatusCheckIntervalSecFloat} сек.")
__Orchestrator__.OrchestratorScheduleGet().every(self.mStatusCheckIntervalSecFloat).seconds.do(Orchestrator.OrchestratorThreadStart,self.StatusCheck) __Orchestrator__.OrchestratorScheduleGet().every(self.mStatusCheckIntervalSecFloat).seconds.do(Orchestrator.OrchestratorThreadStart,self.StatusCheck)
def StatusRestore(self): def StatusRestore(self):
@ -377,7 +377,7 @@ class Process():
self.StopSafe(inIsManualBool=True) self.StopSafe(inIsManualBool=True)
if "STARTED" in self.mStatusSavedStr and "STARTED" not in self.mStatusStr: if "STARTED" in self.mStatusSavedStr and "STARTED" not in self.mStatusStr:
self.Start(inIsManualBool=True) self.Start(inIsManualBool=True)
Orchestrator.OrchestratorLoggerGet().info(f"Managers.Process ({self.mAgentHostNameStr}, {self.mAgentUserNameStr}, {self.mProcessNameWOExeStr}): Status has been restored to {self.mStatusSavedStr}") Orchestrator.OrchestratorLoggerGet().info(f"Модуль Managers.Process ({self.mAgentHostNameStr}, {self.mAgentUserNameStr}, {self.mProcessNameWOExeStr}): Статус процесса был восстановлен на: {self.mStatusSavedStr}")
self.mStatusStr = self.mStatusSavedStr self.mStatusStr = self.mStatusSavedStr
self.mStatusSavedStr = None self.mStatusSavedStr = None
return self.mStatusStr return self.mStatusStr

Loading…
Cancel
Save