summaryrefslogtreecommitdiff
blob: 94b79a0f39e3f8da955f53a916541cd86459d6ea (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import fever
import xmlrpclib

statuses=['NEW', 'VERIFIED', 'ASSIGNED', 'REOPENED', 'CLOSED', 'NEEDINFO', 'MODIFIED', 'ON_DEV', 'UNCONFIRMED', 'ON_QA', 'FAILS_QA', 'NEEDINFO_REPORTER', 'RELEASE_PENDING', 'POST']

username="a@b.pl"
password="adf"

Summary="""%s-%s is available"""
Comment="""%s-%s is already available. Repo version is %s.
Please update the package.

If you have any questions or suggestions related to Fever,
feel free to write them in this bug or have a look at
http://fedoraproject.org/wiki/PackageMaintainers/FEver

Don't send any messages to fevapp at o2.pl please.

"""

url='http://bugzilla.redhat.com/bugzilla/xmlrpc.cgi'

fev=fever.Fever(2)
fev.checkAllPackages()
x=fev.listNotUpToDate()
notuptodate=[]
for elem in x:
	elem=elem.items()
	notuptodate.append( (elem[0][0],False,elem[0][1]['sitever'],elem[0][1]['kojiver']))

print notuptodate

server=xmlrpclib.Server(url)
fevbugs=server.bugzilla.runQuery({'emailreporter2': 1, 'email2': username, 'bug_status': statuses})
descriptions=[elem['short_short_desc'] for elem in fevbugs['bugs']]
for (name, uptodate, aversion, rversion) in notuptodate:
	summary=Summary % (name,aversion)
	if summary in descriptions:
		print "New version of %s has been already submitted" % name
		continue
	comment=Comment % (name, aversion, rversion)
	res = server.bugzilla.createBug({"comment": comment, "short_desc": summary,
					'product': 'Fedora', 'component': name,
					'rep_platform':'All', 'bug_severity': "medium",
					'version': 'devel','op_sys':'Linux',
					'priority': 'normal', 'bug_file_loc': 'http://fedoraproject.org/wiki/Micha%C5%82Bentkowski/FEver' }, username, password)
	print "Bug %s created!" % res[0]