Minor fix when test after rename

dev-linux
Ivan Maslov 4 years ago
parent fcb839d97c
commit 242a466944

@ -168,7 +168,7 @@ def v1_2_0_Monitor_ControlPanelDictGet(inRequest,inGlobalDict):
return bytes(message, "utf8") return bytes(message, "utf8")
from . import Orchestrator # For user defs from . import __Orchestrator__ # For user defs
@ -177,7 +177,7 @@ from . import Orchestrator # For user defs
def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld): def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
if inActivityOld["Type"] == "WindowsLogon": if inActivityOld["Type"] == "WindowsLogon":
lResult = { lResult = {
"Def": Orchestrator.OSCredentialsVerify, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.OSCredentialsVerify, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList":[], # Args list "ArgList":[], # Args list
"ArgDict":{"inUserStr": inActivityOld["User"],"inPasswordStr":inActivityOld["Password"],"inDomainStr":inActivityOld["Domain"]}, # Args dictionary "ArgDict":{"inUserStr": inActivityOld["User"],"inPasswordStr":inActivityOld["Password"],"inDomainStr":inActivityOld["Domain"]}, # Args dictionary
"ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -185,7 +185,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "GlobalDictKeyListValueGet": elif inActivityOld["Type"] == "GlobalDictKeyListValueGet":
lResult = { lResult = {
"Def": Orchestrator.GSettingsKeyListValueGet, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.GSettingsKeyListValueGet, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList":[], # Args list "ArgList":[], # Args list
"ArgDict":{"inKeyList": inActivityOld["KeyList"]}, # Args dictionary "ArgDict":{"inKeyList": inActivityOld["KeyList"]}, # Args dictionary
"ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -193,7 +193,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "CMDStart": elif inActivityOld["Type"] == "CMDStart":
lResult = { lResult = {
"Def": Orchestrator.OSCMD, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.OSCMD, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {"inCMDStr": inActivityOld["Command"]}, # Args dictionary "ArgDict": {"inCMDStr": inActivityOld["Command"]}, # Args dictionary
"ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -201,7 +201,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "OrchestratorRestart": elif inActivityOld["Type"] == "OrchestratorRestart":
lResult = { lResult = {
"Def": Orchestrator.OrchestratorRestart, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.OrchestratorRestart, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {}, # Args dictionary "ArgDict": {}, # Args dictionary
"ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -209,7 +209,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "OrchestratorSessionSave": elif inActivityOld["Type"] == "OrchestratorSessionSave":
lResult = { lResult = {
"Def": Orchestrator.OrchestratorSessionSave, "Def": __Orchestrator__.OrchestratorSessionSave,
# def link or def alias (look gSettings["Processor"]["AliasDefDict"]) # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {}, # Args dictionary "ArgDict": {}, # Args dictionary
@ -218,7 +218,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "GlobalDictKeyListValueSet": elif inActivityOld["Type"] == "GlobalDictKeyListValueSet":
lResult = { lResult = {
"Def": Orchestrator.GSettingsKeyListValueSet, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.GSettingsKeyListValueSet, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {"inKeyList": inActivityOld["KeyList"], "inValue": inActivityOld["Value"]}, # Args dictionary "ArgDict": {"inKeyList": inActivityOld["KeyList"], "inValue": inActivityOld["Value"]}, # Args dictionary
"ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -226,7 +226,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "GlobalDictKeyListValueAppend": elif inActivityOld["Type"] == "GlobalDictKeyListValueAppend":
lResult = { lResult = {
"Def": Orchestrator.GSettingsKeyListValueAppend, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.GSettingsKeyListValueAppend, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {"inKeyList": inActivityOld["KeyList"], "inValue": inActivityOld["Value"]}, # Args dictionary "ArgDict": {"inKeyList": inActivityOld["KeyList"], "inValue": inActivityOld["Value"]}, # Args dictionary
"ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": "inGSettings", # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -234,7 +234,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "GlobalDictKeyListValueOperator+": elif inActivityOld["Type"] == "GlobalDictKeyListValueOperator+":
lResult = { lResult = {
"Def": Orchestrator.GSettingsKeyListValueOperatorPlus, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.GSettingsKeyListValueOperatorPlus, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {"inKeyList": inActivityOld["KeyList"], "inValue": inActivityOld["Value"]}, # Args dictionary "ArgDict": {"inKeyList": inActivityOld["KeyList"], "inValue": inActivityOld["Value"]}, # Args dictionary
"ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -242,7 +242,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "ProcessStart": elif inActivityOld["Type"] == "ProcessStart":
lResult = { lResult = {
"Def": Orchestrator.ProcessStart, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.ProcessStart, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {"inPathStr": inActivityOld["Path"], "inArgList": inActivityOld["ArgList"]}, # Args dictionary "ArgDict": {"inPathStr": inActivityOld["Path"], "inArgList": inActivityOld["ArgList"]}, # Args dictionary
"ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -250,7 +250,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "ProcessStartIfTurnedOff": elif inActivityOld["Type"] == "ProcessStartIfTurnedOff":
lResult = { lResult = {
"Def": Orchestrator.ProcessStart, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.ProcessStart, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {"inPathStr": inActivityOld["Path"], "inArgList": inActivityOld["ArgList"], "inStopProcessNameWOExeStr": inActivityOld["CheckTaskName"]}, # Args dictionary "ArgDict": {"inPathStr": inActivityOld["Path"], "inArgList": inActivityOld["ArgList"], "inStopProcessNameWOExeStr": inActivityOld["CheckTaskName"]}, # Args dictionary
"ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -258,7 +258,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "ProcessStop": elif inActivityOld["Type"] == "ProcessStop":
lResult = { lResult = {
"Def": Orchestrator.ProcessStop, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.ProcessStop, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {"inProcessNameWOExeStr": inActivityOld["Name"], "inCloseForceBool": inActivityOld["FlagForce"], "inUserNameStr": inActivityOld["User"]}, # Args dictionary "ArgDict": {"inProcessNameWOExeStr": inActivityOld["Name"], "inCloseForceBool": inActivityOld["FlagForce"], "inUserNameStr": inActivityOld["User"]}, # Args dictionary
"ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList) "ArgGSettings": None, # Name of GSettings attribute: str (ArgDict) or index (for ArgList)
@ -266,7 +266,7 @@ def v1_2_0_ProcessorOld2NewActivityDict(inActivityOld):
} }
elif inActivityOld["Type"] == "PythonStart": elif inActivityOld["Type"] == "PythonStart":
lResult = { lResult = {
"Def": Orchestrator.PythonStart, # def link or def alias (look gSettings["Processor"]["AliasDefDict"]) "Def": __Orchestrator__.PythonStart, # def link or def alias (look gSettings["Processor"]["AliasDefDict"])
"ArgList": [], # Args list "ArgList": [], # Args list
"ArgDict": {"inModulePathStr": inActivityOld["ModuleName"], "inDefNameStr": inActivityOld["FunctionName"], "inArgList": inActivityOld["ArgList"], "ArgDict": {"inModulePathStr": inActivityOld["ModuleName"], "inDefNameStr": inActivityOld["FunctionName"], "inArgList": inActivityOld["ArgList"],
"inArgDict": inActivityOld["ArgDict"] }, # Args dictionary "inArgDict": inActivityOld["ArgDict"] }, # Args dictionary
@ -316,7 +316,7 @@ 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"Backward compatibility (v1.1.13 to v1.1.14): Add default 'Client' structure") # Log about compatibility
if "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
@ -366,24 +366,25 @@ def Update(inGSettings):
# 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())]
# if len(lUserRights["ControlPanelKeyAllowedList"]) > 0 and lItem["KeyStr"] not in lUserRights["ControlPanelKeyAllowedList"]: # if len(lUserRights["ControlPanelKeyAllowedList"]) > 0 and lItem["KeyStr"] not in lUserRights["ControlPanelKeyAllowedList"]:
# lUACBool = False # UAC Check is not passed - False for user # lUACBool = False # UAC Check is not passed - False for user
lShowWarnBool = False
# # Convert to UACClient dict # # Convert to UACClient dict
lRuleDomainUserDeepCopyDict = copy.deepcopy(inGSettings["Server"]["AccessUsers"]["RuleDomainUserDict"]) if "Server" in inGSettings:
for lItemKeyTurple in lRuleDomainUserDeepCopyDict: lShowWarnBool = False
lDomainUpperStr = lItemKeyTurple[0] lRuleDomainUserDeepCopyDict = copy.deepcopy(inGSettings["Server"]["AccessUsers"]["RuleDomainUserDict"])
lUserUpperStr = lItemKeyTurple[1] for lItemKeyTurple in lRuleDomainUserDeepCopyDict:
lItemDict = lRuleDomainUserDeepCopyDict[lItemKeyTurple] lDomainUpperStr = lItemKeyTurple[0]
if "ControlPanelKeyAllowedList" in lItemDict: lUserUpperStr = lItemKeyTurple[1]
lShowWarnBool = True lItemDict = lRuleDomainUserDeepCopyDict[lItemKeyTurple]
lUACClientDict = {"pyOpenRPADict":{"CPKeyDict":{}}} if "ControlPanelKeyAllowedList" in lItemDict:
for lAllowedKeyItemStr in lItemDict["ControlPanelKeyAllowedList"]: lShowWarnBool = True
lUACClientDict["pyOpenRPADict"]["CPKeyDict"][lAllowedKeyItemStr]=True # Convert lUACClientDict = {"pyOpenRPADict":{"CPKeyDict":{}}}
# Send update UACDict for user by the list for lAllowedKeyItemStr in lItemDict["ControlPanelKeyAllowedList"]:
Orchestrator.OrchestratorUACUpdate(inGSettings=inGSettings,inADLoginStr=lUserUpperStr, inADStr=lDomainUpperStr, inRoleHierarchyAllowedDict=lUACClientDict) lUACClientDict["pyOpenRPADict"]["CPKeyDict"][lAllowedKeyItemStr]=True # Convert
# remove "ControlPanelKeyAllowedList" # Send update UACDict for user by the list
del inGSettings["Server"]["AccessUsers"]["RuleDomainUserDict"][lItemKeyTurple]["ControlPanelKeyAllowedList"] __Orchestrator__.OrchestratorUACUpdate(inGSettings=inGSettings,inADLoginStr=lUserUpperStr, inADStr=lDomainUpperStr, inRoleHierarchyAllowedDict=lUACClientDict)
if lShowWarnBool: # Show only 1 warning per all run # remove "ControlPanelKeyAllowedList"
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 del inGSettings["Server"]["AccessUsers"]["RuleDomainUserDict"][lItemKeyTurple]["ControlPanelKeyAllowedList"]
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
# 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"]={}

@ -4,6 +4,6 @@ The pyOpenRPA package (from UnicodeLabs)
""" """
from .Web import Basic from .Web import Basic
from .Orchestrator import * from .__Orchestrator__ import *
__all__ = [] __all__ = []
__author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>' __author__ = 'Ivan Maslov <ivan.maslov@unicodelabs.ru>'
Loading…
Cancel
Save