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

Function get_runner_module

st2common/st2common/runners/base.py:85–112  ·  view source on GitHub ↗

Load runner driver and return reference to the runner driver module.

(name)

Source from the content-addressed store, hash-verified

83
84
85def get_runner_module(name):
86 """
87 Load runner driver and return reference to the runner driver module.
88 """
89
90 # NOTE: For backward compatibility we also support "_" in place of "-"
91 from stevedore.exception import NoMatches
92
93 try:
94 module = get_plugin_instance(RUNNERS_NAMESPACE, name, invoke_on_load=False)
95 except NoMatches:
96 name = name.replace("_", "-")
97
98 try:
99 module = get_plugin_instance(RUNNERS_NAMESPACE, name, invoke_on_load=False)
100 except Exception as e:
101 available_runners = get_available_plugins(namespace=RUNNERS_NAMESPACE)
102 available_runners = ", ".join(available_runners)
103 msg = (
104 "Failed to find runner %s. Make sure that the runner is available and installed "
105 "in StackStorm virtual environment. Available runners are: %s"
106 % (name, available_runners)
107 )
108 LOG.exception(msg)
109
110 raise exc.ActionRunnerCreateError("%s\n\n%s" % (msg, six.text_type(e)))
111
112 return module
113
114
115def get_metadata(package_name):

Callers 1

get_runnerFunction · 0.85

Calls 2

get_plugin_instanceFunction · 0.90
get_available_pluginsFunction · 0.90

Tested by

no test coverage detected