diff options
author | Magnus Granberg <zorry@gentoo.org> | 2017-01-06 18:50:49 +0100 |
---|---|---|
committer | Magnus Granberg <zorry@gentoo.org> | 2017-01-06 18:50:49 +0100 |
commit | 9f7bd0adcc9d549f97f421a3d3b589e7ec39fd10 (patch) | |
tree | 27e9eaefae9e051346a8bc976c335777211fae6d | |
parent | Redone the layout (diff) | |
download | tinderbox-cluster-www-9f7bd0adcc9d549f97f421a3d3b589e7ec39fd10.tar.gz tinderbox-cluster-www-9f7bd0adcc9d549f97f421a3d3b589e7ec39fd10.tar.bz2 tinderbox-cluster-www-9f7bd0adcc9d549f97f421a3d3b589e7ec39fd10.zip |
add utils
-rw-r--r-- | python/tbc_www/utils/__init__.py | 0 | ||||
-rw-r--r-- | python/tbc_www/utils/bugzillasubmit.py | 27 |
2 files changed, 27 insertions, 0 deletions
diff --git a/python/tbc_www/utils/__init__.py b/python/tbc_www/utils/__init__.py new file mode 100644 index 0000000..e69de29 --- /dev/null +++ b/python/tbc_www/utils/__init__.py diff --git a/python/tbc_www/utils/bugzillasubmit.py b/python/tbc_www/utils/bugzillasubmit.py new file mode 100644 index 0000000..d8160dc --- /dev/null +++ b/python/tbc_www/utils/bugzillasubmit.py @@ -0,0 +1,27 @@ +from __future__ import print_function + +import bugzilla + +URL = "https://bugs.gentoo.org/xmlrpc.cgi" +def addnewbug(args): + bzapi = bugzilla.Bugzilla(URL) + print(args['username']) + print(args['password']) + bzapi.login(user=args['username'], password=args['password']) + createinfo = bzapi.build_createbug( + product=args['product'], + version=args['version'], + component=args['component'], + summary=args['summary'], + description=args['description'], + assigned_to=args['assigned_to']) + newbug = bzapi.createbug(createinfo) + print("Created new bug id=%s url=%s" % (newbug.id, newbug.weburl)) + update = bzapi.build_update(comment=args['comment']) + bzapi.update_bugs(newbug.id, update) + kwards = { + 'contenttype': args['content_type'], + } + attchment_id = bzapi.attachfile(newbug.id, args['filename'], args['comment_attach'], **kwards) + bzapi.logout() + return newbug |