MCPcopy Create free account
hub / github.com/StackStorm/st2 / op_resolver

Function op_resolver

st2common/st2common/router.py:59–74  ·  view source on GitHub ↗

Return controller class instance and controller method callbacle for the provided operation id. :rtype: ``tuple``

(op_id)

Source from the content-addressed store, hash-verified

57
58
59def op_resolver(op_id):
60 """
61 Return controller class instance and controller method callbacle for the provided operation id.
62
63 :rtype: ``tuple``
64 """
65 module_name, func_name = op_id.split(":", 1)
66 controller_name = func_name.split(".")[0]
67
68 __import__(module_name)
69 module = sys.modules[module_name]
70
71 controller_instance = getattr(module, controller_name)
72 method_callable = functools.reduce(getattr, func_name.split("."), module)
73
74 return controller_instance, method_callable
75
76
77def abort(status_code=exc.HTTPInternalServerError.code, message="Unhandled exception"):

Callers 2

set_additional_checkFunction · 0.85
__call__Method · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected