Imported outputs from external module to facilitate thread building and consistent runtime operation from various entrypoints
This commit is contained in:
@@ -3,8 +3,11 @@ from core.execution.operation import buildOperation
|
||||
from core.execution.monitor import buildMonitor
|
||||
#from core.runtime import manageFailure
|
||||
from core.execution.recursive import buildRecursive
|
||||
#from core.runtime.createruntime import outputs
|
||||
|
||||
def executeContract(module, outputs):
|
||||
#print(outputs)
|
||||
|
||||
|
||||
if module.kind == "operation":
|
||||
|
||||
|
||||
@@ -6,9 +6,10 @@ from core.apirequest.execute import getSession
|
||||
from core.execution.lifecyclemanager.lifecycleregistry import registerLifecycle
|
||||
|
||||
lifecycles = {}
|
||||
outputs = {}
|
||||
#outputs = {}
|
||||
|
||||
def manageLifecycle(module):
|
||||
from core.runtime.createruntime import outputs
|
||||
lifecycle_log = os.environ.get("LOGS_LIFECYCLE", "false").lower() == "true"
|
||||
|
||||
registerLifecycle (module, lifecycles)
|
||||
|
||||
@@ -8,7 +8,7 @@ from core.runtime.stopsignals import checkDependency
|
||||
from core.execution import processregistry
|
||||
from core.console import console
|
||||
|
||||
outputs = {}
|
||||
#outputs = {}
|
||||
|
||||
def buildOperation(definition, outputs):
|
||||
process_log = True
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
outputs = {}
|
||||
|
||||
def getOuputs():
|
||||
return outputs
|
||||
@@ -3,6 +3,7 @@ import logging
|
||||
|
||||
from core.runtime.outputs import buildOutput
|
||||
from core.runtime.firewall import buildFirewall
|
||||
from core.runtime.createruntime import outputs
|
||||
|
||||
|
||||
def buildListener(listener, self):
|
||||
@@ -24,20 +25,22 @@ def buildListener(listener, self):
|
||||
data = self.rfile.read(content_length)
|
||||
request = json.loads(data)
|
||||
|
||||
outputs = {}
|
||||
#outputs = {}
|
||||
|
||||
buildOutput(data, listener, outputs)
|
||||
|
||||
allow, status_code = buildFirewall(listener, outputs)
|
||||
|
||||
if allow:
|
||||
from core.execution.executioncontract import executeContract
|
||||
#from core.execution.executioncontract import executeContract
|
||||
from core.execution.createthread import buildThread
|
||||
|
||||
#Print allowed items for logging purposes
|
||||
logging.info(outputs["firewall_allowed"])
|
||||
|
||||
#Process and forward to RMASS
|
||||
responses = executeContract(listener.execute, outputs)
|
||||
#responses = executeContract(listener.execute, outputs)
|
||||
thread = buildThread(listener.execute)
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user