add 'fedmsgs' and 'old_paths' configuration variables

This commit is contained in:
clime 2018-01-13 23:53:30 +01:00
parent d40a3489eb
commit 8f08d577b0
2 changed files with 22 additions and 17 deletions

View file

@ -2,7 +2,11 @@
git_author_name = Fedora Release Engineering
git_author_email = rel-eng@lists.fedoraproject.org
cache_dir = /var/lib/dist-git/cache
gitroot_dir = /var/lib/dist-git/git
gitolite = True
grok = True
cache_dir = /var/lib/dist-git/cache
gitroot_dir = /var/lib/dist-git/git
gitolite = True
grok = True
fedmsgs = True
old_paths = True
nomd5 = True

View file

@ -238,23 +238,24 @@ def main():
hash_type.upper(), checksum)
# Add the file to the old path, where fedpkg is currently looking for it
if hash_type == "md5":
if hash_type == "md5" and config['dist-git'].getboolean('old_paths', fallback=True):
hardlink(dest_file, old_path, username)
# Emit a fedmsg message. Load the config to talk to the fedmsg-relay.
try:
config = fedmsg.config.load_config([], None)
config['active'] = True
config['endpoints']['relay_inbound'] = config['relay_inbound']
fedmsg.init(name="relay_inbound", cert_prefix="lookaside", **config)
if config['dist-git'].getboolean('fedmsgs', fallback=True):
try:
config = fedmsg.config.load_config([], None)
config['active'] = True
config['endpoints']['relay_inbound'] = config['relay_inbound']
fedmsg.init(name="relay_inbound", cert_prefix="lookaside", **config)
topic = "lookaside.new"
msg = dict(name=name, md5sum=checksum,
filename=filename.split('/')[-1], agent=username,
path=msgpath)
fedmsg.publish(modname="git", topic=topic, msg=msg)
except Exception as e:
print "Error with fedmsg", str(e)
topic = "lookaside.new"
msg = dict(name=name, md5sum=checksum,
filename=filename.split('/')[-1], agent=username,
path=msgpath)
fedmsg.publish(modname="git", topic=topic, msg=msg)
except Exception as e:
print "Error with fedmsg", str(e)
if __name__ == '__main__':
try: