Update fedmsg notification hook to use appropriate config.

Signed-off-by: Ralph Bean <rbean@redhat.com>
This commit is contained in:
Ralph Bean 2015-12-08 12:29:12 -05:00
parent 4b374278e4
commit 95761c69e1

View File

@ -3,6 +3,7 @@
import argparse import argparse
import fedmsg import fedmsg
import fedmsg.config
import json import json
import sys import sys
@ -14,7 +15,12 @@ def send(cmd, data):
if __name__ == '__main__': if __name__ == '__main__':
parser = argparse.ArgumentParser() parser = argparse.ArgumentParser()
parser.add_argument('cmd') parser.add_argument('cmd')
opts = parser.parse_args() opts = parser.parse_args()
config = fedmsg.config.load_config()
config['active'] = True # Connect out to a fedmsg-relay instance
config['cert_prefix'] = 'releng' # Use this cert.
fedmsg.init(**config)
data = json.load(sys.stdin) data = json.load(sys.stdin)
send(opts.cmd, data) send(opts.cmd, data)