From dce5c8b4fc5077c33aeb4986c24b982da6d3fea6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Adrian=20Schr=C3=B6ter?= Date: Tue, 19 Jul 2011 18:05:07 +0200 Subject: [PATCH] - show created incident project --- osc/commandline.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/osc/commandline.py b/osc/commandline.py index 08021de2..506bfd1c 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2561,7 +2561,15 @@ Please submit there instead, or use --nodevelproject to force direct submission. query["noaccess"] = 1 url = makeurl(apiurl, ['source', target_project], query=query) r = http_POST(url, data=opts.message) - print ET.parse(r).getroot().get('code') + project = None + for i in ET.fromstring(r.read()).findall('data'): + if i.get('name') == 'targetproject': + project = i.text.strip() + if project: + print "Incident project created: ", project + else: + print ET.parse(r).getroot().get('code') + print ET.parse(r).getroot().get('error') @cmdln.option('-a', '--attribute', metavar='ATTRIBUTE',