IMPALA-5514: Throw an error when --ldap_password_cmd is used without LDAP auth
When only with ldap_password_cmd option, impala-shell runs successfully. I solved this problem by throwing an error when --ldap_password_cmd is used without LDAP auth, that is, ldap_password_cmd option will only take effect if ldap option presents. Change-Id: I3711d8a0eca2fa8612e2943fa9121945db6b012e Reviewed-on: http://gerrit.cloudera.org:8080/7188 Reviewed-by: Bharath Vissapragada <[email protected]> Tested-by: Impala Public Jenkins Project: http://git-wip-us.apache.org/repos/asf/incubator-impala/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-impala/commit/bd3b95e3 Tree: http://git-wip-us.apache.org/repos/asf/incubator-impala/tree/bd3b95e3 Diff: http://git-wip-us.apache.org/repos/asf/incubator-impala/diff/bd3b95e3 Branch: refs/heads/master Commit: bd3b95e3a9ac0df329d523e3ef4dac9812d39399 Parents: dbdab4a Author: davidxdh <[email protected]> Authored: Tue Jul 11 09:56:34 2017 +0800 Committer: Impala Public Jenkins <[email protected]> Committed: Tue Jul 11 08:43:11 2017 +0000 ---------------------------------------------------------------------- shell/impala_shell.py | 5 +++++ 1 file changed, 5 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-impala/blob/bd3b95e3/shell/impala_shell.py ---------------------------------------------------------------------- diff --git a/shell/impala_shell.py b/shell/impala_shell.py index cbfa8a5..d71b9ad 100755 --- a/shell/impala_shell.py +++ b/shell/impala_shell.py @@ -1332,6 +1332,11 @@ if __name__ == "__main__": "connections. Enable SSL or set --auth_creds_ok_in_clear") sys.exit(1) + if not options.use_ldap and options.ldap_password_cmd: + print_to_stderr("Option --ldap_password_cmd requires using LDAP authentication " + + "mechanism (-l)") + sys.exit(1) + if options.use_kerberos: print_to_stderr("Starting Impala Shell using Kerberos authentication") print_to_stderr("Using service name '%s'" % options.kerberos_service_name)
