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

Function register_sensors

st2common/st2common/content/bootstrap.py:196–219  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

194
195
196def register_sensors():
197 pack_dir = cfg.CONF.register.pack
198 fail_on_failure = not cfg.CONF.register.no_fail_on_failure
199
200 registered_count = 0
201 overridden_count = 0
202
203 try:
204 LOG.info("=========================================================")
205 LOG.info("############## Registering sensors ######################")
206 LOG.info("=========================================================")
207 with Timer(key="st2.register.sensors"):
208 (registered_count, overridden_count) = sensors_registrar.register_sensors(
209 pack_dir=pack_dir, fail_on_failure=fail_on_failure
210 )
211 except Exception as e:
212 exc_info = not fail_on_failure
213 LOG.warning("Failed to register sensors: %s", e, exc_info=exc_info)
214
215 if fail_on_failure:
216 raise e
217
218 LOG.info("Registered %s sensors." % (registered_count))
219 LOG.info("%s sensors had their metadata overridden." % (overridden_count))
220
221
222def register_runners():

Callers 1

register_contentFunction · 0.70

Calls 1

TimerClass · 0.90

Tested by

no test coverage detected