1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-25 01:16:14 +01:00

- clone_request: return the "targetproject"

This commit is contained in:
Marcus Huewe 2011-01-29 23:14:19 +01:00
parent 919c347c7f
commit dd1237218c
2 changed files with 9 additions and 2 deletions

View File

@ -1772,7 +1772,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
# clone all packages from a given request # clone all packages from a given request
if cmd in ['clone']: if cmd in ['clone']:
# should we force a message? # 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 # add new reviewer to existing request
elif cmd in ['add'] and subcmd == 'review': elif cmd in ['add'] and subcmd == 'review':

View File

@ -3473,7 +3473,14 @@ def clone_request(apiurl, reqid, msg=None):
query = {'cmd': 'branch', 'request': reqid} query = {'cmd': 'branch', 'request': reqid}
url = makeurl(apiurl, ['source'], query) url = makeurl(apiurl, ['source'], query)
r = http_POST(url, data=msg) 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 # This creates an old style submit request for server api 1.0
def create_submit_request(apiurl, def create_submit_request(apiurl,