Skip to content

Commit

Permalink
- fallback to set_bugowner request when writing to specified containe…
Browse files Browse the repository at this point in the history
…r is not permitted
  • Loading branch information
adrianschroeter committed Feb 21, 2013
1 parent 14f6986 commit 3e88c3c
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion osc/commandline.py
Expand Up @@ -6889,7 +6889,26 @@ def do_maintainer(self, subcmd, opts, *args):

else:
for role in roles:
setBugowner(apiurl, prj, pac, opts.delete, role)
try:
setBugowner(apiurl, prj, pac, opts.delete, role)
except urllib2.HTTPError, e:
if e.code == 403:
print "No write permission in", result.get('project'),
if result.get('package'):
print "/", result.get('package'),
print
repl = raw_input('\nCreating a request instead? (y/n) ')
if repl.lower() == 'y':
opts.set_bugowner_request = opts.set_bugowner
opts.set_bugowner = None
break

if opts.set_bugowner_request:
for role in roles:
args = [bugowner, prj]
if pac:
args = args + [pac]
requestactionsxml += self._set_bugowner(args,opts)

if requestactionsxml != "":
message = edit_message()
Expand Down

0 comments on commit 3e88c3c

Please sign in to comment.