+# run a Python command asynchronously
+def fire_and_forget(f):
+ def _fire_and_forget():
+ try:
+ f()
+ except Exception as e:
+ logger.critical("fire_and_forget: Got exception out of callback: %s" % str(e))
+ logger.debug(traceback.format_exc())
+ t = threading.Thread(target=_fire_and_forget)
+ t.start()
+