Skip to content
This repository has been archived by the owner on Mar 3, 2023. It is now read-only.

Commit

Permalink
Fix bug in dry-run argument for update command (#2831)
Browse files Browse the repository at this point in the history
Since list_extra_args is an array the `+=` operator deconstructs a
string and add each character as an individual array element. This made
it so when the update command it would not detect if it was in dry-run
mode and always run the update command. By encapsulating the `--dry-run`
string in an list it is properly added as an argument and runs with the
expected behavior.

This also fixes an issue with the way the `dry_run_format` argument was
being updated in the extra args dictionary
  • Loading branch information
ajorgensen authored and kramasamy committed Apr 1, 2018
1 parent 7705f87 commit c4724d9
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions heron/tools/cli/src/python/update.py
Expand Up @@ -102,7 +102,7 @@ def build_extra_args_dict(cl_args):
if cl_args['dry_run']:
dict_extra_args.update({'dry_run': True})
if 'dry_run_format' in cl_args:
dict_extra_args.update({'dry_run_format', cl_args["dry_run_format"]})
dict_extra_args.update({'dry_run_format': cl_args["dry_run_format"]})

return dict_extra_args

Expand All @@ -117,7 +117,7 @@ def convert_args_dict_to_list(dict_extra_args):
list_extra_args += ["--runtime_config",
','.join(dict_extra_args['runtime_config'])]
if 'dry_run' in dict_extra_args and dict_extra_args['dry_run']:
list_extra_args += '--dry_run'
list_extra_args += ['--dry_run']
if 'dry_run_format' in dict_extra_args:
list_extra_args += ['--dry_run_format', dict_extra_args['dry_run_format']]

Expand Down

0 comments on commit c4724d9

Please sign in to comment.