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 Jul 31, 2020
1 parent a502f9a commit ef36aef
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
11 changes: 11 additions & 0 deletions bugz/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -513,6 +513,17 @@ def modify(settings):
params['version'] = settings.version
if hasattr(settings, 'whiteboard'):
params['whiteboard'] = settings.whiteboard
if hasattr(settings, 'custom'):
custom_options = settings.custom.split(':')
import pdb
pdb.set_trace()
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 ef36aef

Please sign in to comment.