mirror of
https://github.com/openSUSE/osc.git
synced 2024-11-10 06:46:15 +01:00
- clone_request: return the "targetproject"
This commit is contained in:
parent
919c347c7f
commit
dd1237218c
@ -1772,7 +1772,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
# clone all packages from a given request
|
||||
if cmd in ['clone']:
|
||||
# should we force a message?
|
||||
print clone_request(apiurl, reqid, opts.message)
|
||||
print 'Cloned packages are available in project: %s' % clone_request(apiurl, reqid, opts.message)
|
||||
|
||||
# add new reviewer to existing request
|
||||
elif cmd in ['add'] and subcmd == 'review':
|
||||
|
@ -3473,7 +3473,14 @@ def clone_request(apiurl, reqid, msg=None):
|
||||
query = {'cmd': 'branch', 'request': reqid}
|
||||
url = makeurl(apiurl, ['source'], query)
|
||||
r = http_POST(url, data=msg)
|
||||
return r.read()
|
||||
root = ET.fromstring(r.read())
|
||||
project = None
|
||||
for i in root.findall('data'):
|
||||
if i.get('name') == 'targetproject':
|
||||
project = i.text.strip()
|
||||
if not project:
|
||||
raise oscerr.APIError('invalid data from clone request:\n%s\n' % ET.tostring(root))
|
||||
return project
|
||||
|
||||
# This creates an old style submit request for server api 1.0
|
||||
def create_submit_request(apiurl,
|
||||
|
Loading…
Reference in New Issue
Block a user