1
0
mirror of https://github.com/openSUSE/osc.git synced 2024-12-27 02:16:12 +01:00

Merge branch 'rename_get_group' of https://github.com/lethliel/osc

Rename core.get_group to core.get_group_meta (keep core.get_group
for backward compatibility reasons (plugins)).
This commit is contained in:
Marcus Huewe 2017-08-21 10:53:32 +02:00
commit 54ee1cdba2
2 changed files with 9 additions and 4 deletions

View File

@ -909,7 +909,7 @@ class Osc(cmdln.Cmdln):
if r:
sys.stdout.write(''.join(r))
elif cmd == 'group':
r = get_group(apiurl, group)
r = get_group_meta(apiurl, group)
if r:
sys.stdout.write(''.join(r))
elif cmd == 'pattern':
@ -1659,7 +1659,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
actionxml = """ <action type="add_role"> <target project="%s" package="%s" /> <group name="%s" role="%s" /> </action> """ % \
(project, package, group, role)
if get_group(apiurl, group) == None:
if get_group_meta(apiurl, group) == None:
raise oscerr.WrongArgs('osc: an error occured.')
return actionxml
@ -1682,7 +1682,7 @@ Please submit there instead, or use --nodevelproject to force direct submission.
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:
if get_group_meta(apiurl, group) == None:
raise oscerr.WrongArgs('osc: an error occured.')
else:
actionxml = """ <action type="set_bugowner"> <target project="%s" %s /> <person name="%s" /> </action> """ % \

View File

@ -4478,7 +4478,12 @@ def check_existing_maintenance_requests(apiurl, src_project, src_packages, dst_p
raise oscerr.UserAbort()
return repl == 'y', reqs
# old function for compat reasons. Some plugins may call this function.
# and we do not want to break the plugins.
def get_group(apiurl, group):
return get_group_meta(apiurl, group)
def get_group_meta(apiurl, group):
u = makeurl(apiurl, ['group', quote_plus(group)])
try:
f = http_GET(u)
@ -4516,7 +4521,7 @@ def get_user_data(apiurl, user, *tags):
def get_group_data(apiurl, group, *tags):
meta = get_group(apiurl, group)
meta = get_group_meta(apiurl, group)
return _get_xml_data(meta, *tags)