You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
62 lines
3.2 KiB
62 lines
3.2 KiB
import psutil, datetime, logging, os, sys # stdout from logging
|
|
|
|
# Config settings
|
|
lPyOpenRPASourceFolderPathStr = r"..\Sources" # Path for test pyOpenRPA package
|
|
|
|
# INFO Relative/Absolute import see below - after settings init
|
|
|
|
# Template for import CP - Control Panels
|
|
# ATTENTION - Pay attention to CP names! Orchestrator is one for the all control panels per one machine
|
|
|
|
## !!! For Absolute import !!!
|
|
# sys.path.insert(0,os.path.abspath(os.path.join(r"..\ROBOT\Builds")))
|
|
# import pyRobot_CP
|
|
# pyRobot_CP.SettingsUpdate(inGSettings=gSettings)
|
|
|
|
## !!! For Relative import !!!
|
|
# sys.path.insert(0,os.path.abspath(os.path.join(r"..\ROBOT\Builds")))
|
|
# from pyRobot_CP import ControlPanel
|
|
# ControlPanel.SettingsUpdate(inGSettings=gSettings)
|
|
|
|
# Operations
|
|
if lPyOpenRPASourceFolderPathStr != "": sys.path.insert(0,os.path.abspath(os.path.join(lPyOpenRPASourceFolderPathStr))) # Path for test pyOpenRPA package
|
|
# Start import after config the pyOpenRPA folder
|
|
from pyOpenRPA.Orchestrator import SettingsTemplate # Import functionallity
|
|
|
|
|
|
if __name__ == "__main__": # New init way - allow run as module -m PyOpenRPA.Orchestrator
|
|
from pyOpenRPA.Orchestrator import Orchestrator # Import orchestrator main
|
|
gSettings = SettingsTemplate.Create(inModeStr="BASIC") # Create GSettings with basic configuration
|
|
|
|
# TEST Add User ND - Add Login ND to superuser of the Orchestrator
|
|
lUACClientDict = SettingsTemplate.__UACClientAdminCreate__()
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["LogViewerBool"]
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["CMDInputBool"]
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["ScreenshotViewerBool"]
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["RestartOrchestratorBool"]
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["RestartOrchestratorGITPullBool"]
|
|
# del lUACClientDict["pyOpenRPADict"]["AdminDict"]["RestartPCBool"]
|
|
# del lUACClientDict["pyOpenRPADict"]["RDPKeyDict"]
|
|
# del lUACClientDict["pyOpenRPADict"]["AgentKeyDict"]
|
|
# del lUACClientDict["pyOpenRPADict"]["CPKeyDict"]
|
|
Orchestrator.OrchestratorUACUpdate(inGSettings=gSettings, inADLoginStr="ND", inADStr="", inADIsDefaultBool=True, inURLList=[], inCPAllowKeyList=[], inRoleHierarchyAllowedDict=lUACClientDict)
|
|
# TEST Add User IMaslov - Add Login IMaslov to superuser of the Orchestrator
|
|
Orchestrator.OrchestratorUACUpdate(inGSettings=gSettings, inADLoginStr="IMaslov", inADStr="", inADIsDefaultBool=True, inURLList=[], inCPAllowKeyList=[])
|
|
# TEST Add Supertoken for the all access between robots
|
|
Orchestrator.OrchestratorUACSuperTokenUpdate(inGSettings=gSettings, inSuperTokenStr="1992-04-03-0643-ru-b4ff-openrpa52zzz")
|
|
|
|
## !!! For Relative import !!! CP Version Check
|
|
sys.path.insert(0,os.path.abspath(os.path.join(r"")))
|
|
from ControlPanel import CP_VersionCheck
|
|
CP_VersionCheck.SettingsUpdate(inGSettings=gSettings)
|
|
|
|
from ControlPanel import CP_Test
|
|
CP_Test.SettingsUpdate(inGSettings=gSettings)
|
|
|
|
# Call the orchestrator def
|
|
Orchestrator.Orchestrator(inGSettings=gSettings)
|
|
|
|
else:
|
|
print("!WARNING! Current orchestrator settings do not support old type of the Orchestrator start. Use new Orchestrator type start (see v1.2.0)")
|
|
|