From 47ae9883fc95c1bd502b369f4d76e4cb49985577 Mon Sep 17 00:00:00 2001 From: Andrew Jorgensen Date: Sat, 31 Mar 2018 20:27:26 -0400 Subject: [PATCH] Fix bug in dry-run argument for update command (#2831) 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 --- heron/tools/cli/src/python/update.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/heron/tools/cli/src/python/update.py b/heron/tools/cli/src/python/update.py index ba3557f0cb8..180eaea042f 100644 --- a/heron/tools/cli/src/python/update.py +++ b/heron/tools/cli/src/python/update.py @@ -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 @@ -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']]