Skip to content

Commit

Permalink
Merge branch 'fix__submit_request_id_return' of https://github.com/ma…
Browse files Browse the repository at this point in the history
…rcus-h/osc

Only return request ids in Osc._submit_request in order to avoid a
TypeError in the caller when processing the results.
  • Loading branch information
marcus-h committed Dec 22, 2020
2 parents 745dc11 + 0926e37 commit e06c633
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions osc/commandline.py
Original file line number Diff line number Diff line change
Expand Up @@ -1623,10 +1623,11 @@ def _submit_request(self, args, opts, options_block):
reqs = get_request_list(apiurl, dst_project, dst_package, req_type='submit', req_state=['new', 'review'])
user = conf.get_apiurl_usr(apiurl)
myreqs = [ i for i in reqs if i.state.who == user and i.reqid != opts.supersede ]
myreq_ids = [r.reqid for r in myreqs]
repl = 'y'
if len(myreqs) > 0 and not opts.yes:
print('You already created the following submit request: %s.' % \
', '.join([i.reqid for i in myreqs ]))
', '.join(myreq_ids))
repl = raw_input('Supersede the old requests? (y/n/c) ')
if repl.lower() == 'c':
print('Aborting', file=sys.stderr)
Expand All @@ -1637,10 +1638,10 @@ def _submit_request(self, args, opts, options_block):
actionxml = """<action type="submit"> <source project="%s" package="%s" rev="%s"/> <target project="%s" package="%s"/> %s </action>""" % \
(src_project, src_package, opts.revision or show_upstream_rev(apiurl, src_project, src_package), dst_project, dst_package, options_block)
if opts.supersede:
myreqs.append(opts.supersede)
myreq_ids.append(opts.supersede)

#print 'created request id', result
return actionxml, myreqs
return actionxml, myreq_ids

def _delete_request(self, args, opts):
if len(args) < 1:
Expand Down

0 comments on commit e06c633

Please sign in to comment.