mirror of
https://github.com/openSUSE/osc.git
synced 2025-01-13 09:16:14 +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)
|
['request', reqid], query=query)
|
||||||
f = http_POST(u, data=message)
|
f = http_POST(u, data=message)
|
||||||
|
|
||||||
r = f.read()
|
root = ET.parse(f).getroot()
|
||||||
if r.startswith('<status code="'):
|
return root.get('code', 'unknown')
|
||||||
r = r.split('<status code="')[1]
|
|
||||||
r = r.split('" />')[0]
|
|
||||||
|
|
||||||
return r
|
|
||||||
|
|
||||||
def change_request_state_template(req, newstate):
|
def change_request_state_template(req, newstate):
|
||||||
if not len(req.actions):
|
if not len(req.actions):
|
||||||
|
Loading…
Reference in New Issue
Block a user