1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-11-10 06:46:15 +01:00

- fix set bugowner command

This commit is contained in:
Adrian Schröter 2014-01-24 10:29:00 +01:00
parent 9e07851310
commit 7fcb1bbe3e
2 changed files with 8 additions and 8 deletions

View File

@ -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=' ')

View File

@ -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: