mirror of
https://github.com/openSUSE/osc.git
synced 2025-02-08 20:15:47 +01:00
- support bugowner set of groups
This commit is contained in:
parent
cb14b06a74
commit
0557fecd02
@ -1554,11 +1554,18 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
if len(args) > 2:
|
if len(args) > 2:
|
||||||
package = """package="%s" """ % (args[2])
|
package = """package="%s" """ % (args[2])
|
||||||
|
|
||||||
|
if user.startswith('group:'):
|
||||||
|
group = user.replace('group:','')
|
||||||
|
actionxml = """ <action type="set_bugowner"> <target project="%s" %s /> <group name="%s" /> </action> """ % \
|
||||||
|
(project, package, group)
|
||||||
|
if get_group(apiurl, group) == None:
|
||||||
|
raise oscerr.WrongArgs('osc: an error occured.')
|
||||||
|
else:
|
||||||
|
actionxml = """ <action type="set_bugowner"> <target project="%s" %s /> <person name="%s" /> </action> """ % \
|
||||||
|
(project, package, user)
|
||||||
if get_user_meta(apiurl, user) == None:
|
if get_user_meta(apiurl, user) == None:
|
||||||
raise oscerr.WrongArgs('osc: an error occured.')
|
raise oscerr.WrongArgs('osc: an error occured.')
|
||||||
|
|
||||||
actionxml = """ <action type="set_bugowner"> <target project="%s" %s /> <person name="%s" /> </action> """ % \
|
|
||||||
(project, package, user)
|
|
||||||
|
|
||||||
return actionxml
|
return actionxml
|
||||||
|
|
||||||
@ -6999,9 +7006,9 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
@cmdln.option('-A', '--all', action='store_true',
|
@cmdln.option('-A', '--all', action='store_true',
|
||||||
help='list all found entries not just the first one')
|
help='list all found entries not just the first one')
|
||||||
@cmdln.option('-s', '--set-bugowner', metavar='user',
|
@cmdln.option('-s', '--set-bugowner', metavar='user',
|
||||||
help='Set the bugowner to specified person')
|
help='Set the bugowner to specified person (or group via group: prefix)')
|
||||||
@cmdln.option('-S', '--set-bugowner-request', metavar='user',
|
@cmdln.option('-S', '--set-bugowner-request', metavar='user',
|
||||||
help='Set the bugowner to specified person via a request')
|
help='Set the bugowner to specified person via a request (or group via group: prefix)')
|
||||||
@cmdln.option('-U', '--user', metavar='USER',
|
@cmdln.option('-U', '--user', metavar='USER',
|
||||||
help='All official maintained instances for the specified USER')
|
help='All official maintained instances for the specified USER')
|
||||||
@cmdln.option('-G', '--group', metavar='GROUP',
|
@cmdln.option('-G', '--group', metavar='GROUP',
|
||||||
@ -7203,7 +7210,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
|
|||||||
print("Following to the development space: %s/%s" % (prj, pac))
|
print("Following to the development space: %s/%s" % (prj, pac))
|
||||||
m = show_package_meta(apiurl, prj, pac)
|
m = show_package_meta(apiurl, prj, pac)
|
||||||
metaroot = ET.fromstring(''.join(m))
|
metaroot = ET.fromstring(''.join(m))
|
||||||
if not metaroot.findall('person'):
|
if not metaroot.findall('person') and not metaroot.findall('group'):
|
||||||
if opts.verbose:
|
if opts.verbose:
|
||||||
print("No dedicated persons in package defined, showing the project persons.")
|
print("No dedicated persons in package defined, showing the project persons.")
|
||||||
pac = None
|
pac = None
|
||||||
|
@ -6086,6 +6086,9 @@ def setBugowner(apiurl, prj, pac, user=None, group=None):
|
|||||||
path_args=path,
|
path_args=path,
|
||||||
template_args=None,
|
template_args=None,
|
||||||
create_new=False)
|
create_new=False)
|
||||||
|
if user.startswith('group:'):
|
||||||
|
group=user.replace('group:','')
|
||||||
|
user=None
|
||||||
if data:
|
if data:
|
||||||
root = ET.fromstring(''.join(data))
|
root = ET.fromstring(''.join(data))
|
||||||
for group_element in root.getiterator('group'):
|
for group_element in root.getiterator('group'):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user