]> TLD Linux GIT Repositories - tld-builder.git/blobdiff - TLD_Builder/messagebus.py
- merged PLD changes, now it works with python 3.x
[tld-builder.git] / TLD_Builder / messagebus.py
diff --git a/TLD_Builder/messagebus.py b/TLD_Builder/messagebus.py
new file mode 100644 (file)
index 0000000..06ca365
--- /dev/null
@@ -0,0 +1,18 @@
+#!/usr/bin/python3
+# I would name this file as fedmsg,
+# but don't know how to import 'fedmsg' from system dir and from local dir
+
+import fedmsg
+import fedmsg.config
+
+config = fedmsg.config.load_config([], None)
+config['active'] = True
+config['endpoints']['relay_inbound'] = config['relay_inbound']
+fedmsg.init(name='relay_inbound', cert_prefix='builder', **config)
+
+def notify(topic, **kwargs):
+    fedmsg.publish(
+        topic=topic,
+        msg=dict(kwargs),
+        modname="builder",
+    )