1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-09-20 01:06:17 +02:00

Merge branch 'print_links_in_mr' of https://github.com/lethliel/osc

Print a link to webui if a new maintenance request is created and
the "print_web_links" config option is enabled.
This commit is contained in:
Marcus Huewe 2020-07-07 17:50:48 +02:00
commit 76eafc92b5

View File

@ -3329,6 +3329,13 @@ Please submit there instead, or use --nodevelproject to force direct submission.
r = create_maintenance_request(apiurl, source_project, source_packages, target_project, release_project, opt_sourceupdate, opts.message, opts.enforce_branching)
print(r.reqid)
if conf.config['print_web_links']:
root = ET.fromstring(b''.join(show_configuration(apiurl)))
node = root.find('obs_url')
if node is None or not node.text:
raise oscerr.APIError('obs_url configuration element expected')
obs_url = node.text
print('%s/request/show/%s' % (obs_url, r.reqid))
if supersede_existing:
for req in reqs: