Mailinglist Archive: opensuse-buildservice (272 mails)

< Previous Next >
[opensuse-buildservice] osc requestmaintainership
  • From: Anas Nashif <nashif@xxxxxxxxxxxxxxx>
  • Date: Wed, 24 Nov 2010 11:19:56 +0000
  • Message-id: <89E610C9-5048-415D-B75C-2D9E6BE0E652@xxxxxxxxxxxxxxx>
Hi,
Is there a way to do requestownership?
I looked at the code and it seems the value 'maintainer' is hardcoded, can we
set the role type using --role for example and be able to set different roles?

Does the patch below look ok?

Anas

--


diff --git a/osc/commandline.py b/osc/commandline.py
index 2683ae7..089098a 100644
--- a/osc/commandline.py
+++ b/osc/commandline.py
@@ -1356,6 +1356,8 @@ Please submit there instead, or use --nodevelproject to
force direct submission.

@cmdln.option('-m', '--message', metavar='TEXT',
help='specify message TEXT')
+ @cmdln.option('-r', '--role', metavar='role', default='maintainer',
+ help='Specify user role (Default: maintainer)')
@cmdln.alias("reqmaintainership")
@cmdln.alias("reqms")
def do_requestmaintainership(self, subcmd, opts, *args):
@@ -1371,7 +1373,13 @@ Please submit there instead, or use --nodevelproject to
force direct submission.
"""
args = slash_split(args)
apiurl = self.get_api_url()
-
+ available_roles = ['maintainer', 'bugowner']
+ role = 'maintainer'
+ print opts.role
+ if len(opts.role) and opts.role in available_roles:
+ print 'blah'
+ role = opts.role
+ print role
if len(args) < 2:
if is_package_dir(os.getcwd()):
project = store_read_project(os.curdir)
@@ -1393,7 +1401,7 @@ Please submit there instead, or use --nodevelproject to
force direct submission.
else:
raise oscerr.WrongArgs('Wrong number of arguments.')

- arg = [ user, 'maintainer', project, package ]
+ arg = [ user, role, project, package ]

actionsxml = self._add_role(arg, None)--
To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: opensuse-buildservice+help@xxxxxxxxxxxx

< Previous Next >
Follow Ups