pungi/bin/pungi-fedmsg-notification

21 lines
426 B
Plaintext
Raw Normal View History

#!/usr/bin/env python
# -*- coding: utf-8 -*-
import argparse
import fedmsg
import json
import sys
def send(cmd, data):
topic = 'compose.%s' % cmd.replace('-', '.').lower()
fedmsg.publish(topic=topic, modname='pungi', msg=data)
if __name__ == '__main__':
parser = argparse.ArgumentParser()
parser.add_argument('cmd')
opts = parser.parse_args()
data = json.load(sys.stdin)
send(opts.cmd, data)