This is an automated email from the ASF dual-hosted git repository.

karthikz pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-heron.git


The following commit(s) were added to refs/heads/master by this push:
     new 47ae988  Fix bug in dry-run argument for update command (#2831)
47ae988 is described below

commit 47ae9883fc95c1bd502b369f4d76e4cb49985577
Author: Andrew Jorgensen <ajorgen...@users.noreply.github.com>
AuthorDate: Sat Mar 31 20:27:26 2018 -0400

    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 ba3557f..180eaea 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']]
 

-- 
To stop receiving notification emails like this one, please contact
karth...@apache.org.

Reply via email to