mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-25 17:36:13 +01:00
- change_request_state: manual xml parsing is error-prone
This commit is contained in:
parent
eda2e75655
commit
40f4a61cbc
@ -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):
|
||||
|
Loading…
Reference in New Issue
Block a user