1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-28 10:46:15 +01:00

- minor fix in get_submit_request_list()

This commit is contained in:
Marcus Hüwe 2008-08-17 18:53:54 +00:00
parent 5aaaa3572a
commit f4e4c91376
2 changed files with 17 additions and 1 deletions

View File

@ -562,6 +562,22 @@ of the package %s primarily takes place.
Please submit there instead, or use --nodevelproject to force direct submission.""" \
% (devloc, dst_package)
sys.exit(1)
reqs = get_submit_request_list(apiurl, dst_project, dst_package)
oreqs = []
myreqs = []
for req in reqs:
if req.state.who == conf.get_apiurl_usr(apiurl):
myreqs.append(req)
else:
oreqs.append(req)
if len(myreqs) > 0:
print 'You already created the following submitrequests: %s.' % \
', '.join([str(i.reqid) for i in myreqs ])
repl = raw_input('Revoke the old requests? (y/N) ')
if repl == 'y':
for req in myreqs:
change_submit_request_state(apiurl, str(req.reqid), 'revoked',
'obsoleted by request: %s' % req.reqid)
result = create_submit_request(apiurl,
src_project, src_package,

View File

@ -1958,7 +1958,7 @@ def get_submit_request_list(apiurl, project, package, req_state=('new')):
for root in collection.findall('request'):
r = SubmitReq()
r.read(root)
if (r.state.name in req_state) or ('' in req_state):
if (r.state.name in req_state) or not len(req_state):
requests.append(r)
return requests