1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-09 22:36:14 +01:00

- change_request_state: manual xml parsing is error-prone

This commit is contained in:
Marcus Huewe 2015-04-07 15:27:40 +02:00
parent eda2e75655
commit 40f4a61cbc

View File

@ -4044,12 +4044,8 @@ def change_request_state(apiurl, reqid, newstate, message='', supersed=None, for
['request', reqid], query=query)
f = http_POST(u, data=message)
r = f.read()
if r.startswith('<status code="'):
r = r.split('<status code="')[1]
r = r.split('" />')[0]
return r
root = ET.parse(f).getroot()
return root.get('code', 'unknown')
def change_request_state_template(req, newstate):
if not len(req.actions):