summaryrefslogtreecommitdiff
blob: 935660de08a16f5abd7ed1acfaa015929273ee7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
from __future__ import print_function

import bugzilla

URL = "https://bugs.gentoo.org/xmlrpc.cgi"
def addnewbug(args):
	bzapi = bugzilla.Bugzilla(URL)
	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)
	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