Repository: incubator-hawq Updated Branches: refs/heads/master 03a3e2069 -> 57b33b49c
HAWQ-717: Use password as fed by the user Project: http://git-wip-us.apache.org/repos/asf/incubator-hawq/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-hawq/commit/57b33b49 Tree: http://git-wip-us.apache.org/repos/asf/incubator-hawq/tree/57b33b49 Diff: http://git-wip-us.apache.org/repos/asf/incubator-hawq/diff/57b33b49 Branch: refs/heads/master Commit: 57b33b49c777c77a7e31381cb06965a4d09ec11a Parents: 03a3e20 Author: Bhuvnesh Chaudhary <[email protected]> Authored: Mon May 9 13:01:59 2016 -0700 Committer: Bhuvnesh Chaudhary <[email protected]> Committed: Mon May 9 13:01:59 2016 -0700 ---------------------------------------------------------------------- tools/bin/hawq | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-hawq/blob/57b33b49/tools/bin/hawq ---------------------------------------------------------------------- diff --git a/tools/bin/hawq b/tools/bin/hawq index be628be..637553b 100755 --- a/tools/bin/hawq +++ b/tools/bin/hawq @@ -18,6 +18,7 @@ try: import os + import json import sys import subprocess from hawqpylib.HAWQ_HELP import * @@ -82,7 +83,13 @@ def main(): if len(sys.argv) > 2: hawq_command = sys.argv[1] second_arg = sys.argv[2] - sub_args = " ".join(sys.argv[2:]) + sub_args_list = sys.argv[2:] + # Password can have special characters like semicolon (;), quotes(", ') etc, convert input password to a string + if hawq_command == 'ssh-exkeys' and '-p' in sub_args_list: + password_index = sub_args_list.index('-p') + 1 + if len(sub_args_list) > password_index: + sub_arg_list[password_index] = json.dumps(sub_args_list[password_index]) + sub_args = " ".join(sub_args_list) elif len(sys.argv) > 1: hawq_command = sys.argv[1] second_arg = ''
