mirror of
https://github.com/openSUSE/osc.git
synced 2024-12-24 00:56:15 +01:00
- fix set bugowner command
This commit is contained in:
parent
9e07851310
commit
7fcb1bbe3e
@ -7120,7 +7120,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if opts.set_bugowner:
|
||||
for role in roles:
|
||||
try:
|
||||
setBugowner(apiurl, result.get('project'), result.get('package'), bugowner)
|
||||
setBugowner(apiurl, result.get('project'), result.get('package'), opts.set_bugowner)
|
||||
except HTTPError as e:
|
||||
if e.code == 403:
|
||||
print("No write permission in", result.get('project'), end=' ')
|
||||
@ -7144,7 +7144,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
||||
if opts.set_bugowner:
|
||||
for role in roles:
|
||||
try:
|
||||
setBugowner(apiurl, prj, pac, opts.delete, role)
|
||||
setBugowner(apiurl, prj, pac, opts.set_bugowner)
|
||||
except HTTPError as e:
|
||||
if e.code == 403:
|
||||
print("No write permission in" + result.get('project'), end=' ')
|
||||
|
12
osc/core.py
12
osc/core.py
@ -6088,12 +6088,12 @@ def setBugowner(apiurl, prj, pac, user=None, group=None):
|
||||
create_new=False)
|
||||
if data:
|
||||
root = ET.fromstring(''.join(data))
|
||||
for group in root.getiterator('group'):
|
||||
if group.get('role') == "bugowner":
|
||||
root.remove(group)
|
||||
for person in root.getiterator('person'):
|
||||
if person.get('role') == "bugowner":
|
||||
root.remove(person)
|
||||
for group_element in root.getiterator('group'):
|
||||
if group_element.get('role') == "bugowner":
|
||||
root.remove(group_element)
|
||||
for person_element in root.getiterator('person'):
|
||||
if person_element.get('role') == "bugowner":
|
||||
root.remove(person_element)
|
||||
if user:
|
||||
root.insert(2, ET.Element('person', role='bugowner', userid=user))
|
||||
elif group:
|
||||
|
Loading…
Reference in New Issue
Block a user