Skip to content

Commit

Permalink
Add support for custom parameters
Browse files Browse the repository at this point in the history
This adds support for custom parameters in bugzilla modify.
This needs to be given in form:
key1=val:key2=val:...
  • Loading branch information
SridharIyer committed Aug 4, 2020
1 parent a502f9a commit 2d8da16
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
9 changes: 9 additions & 0 deletions bugz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,15 @@ def modify(settings):
params['version'] = settings.version
if hasattr(settings, 'whiteboard'):
params['whiteboard'] = settings.whiteboard
if hasattr(settings, 'custom'):
custom_options = settings.custom.split(':')
for custom_option in custom_options:
try:
key,value = custom_option.split('=',1)
params[key] = value
except:
print("Badly formatted option :{}".format(custom_option))
pass

if hasattr(settings, 'fixed'):
params['status'] = 'RESOLVED'
Expand Down
2 changes: 2 additions & 0 deletions bugz/cli_argparser.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,8 @@ def make_arg_parser():
help='change the priority for this bug')
modify_parser.add_argument('--product',
help='change the product for this bug')
modify_parser.add_argument('--custom',
help='change custom parameters for this bug')
modify_parser.add_argument('-r', '--resolution',
help='set new resolution '
'(if status = RESOLVED)')
Expand Down

0 comments on commit 2d8da16

Please sign in to comment.