You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by wu...@apache.org on 2022/10/17 02:00:56 UTC
[ambari] branch trunk updated: AMBARI-25399: Add hive PAM support for service check and alerts (#3407)
This is an automated email from the ASF dual-hosted git repository.
wuzhiguo pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/ambari.git
The following commit(s) were added to refs/heads/trunk by this push:
new 63521eb7a5 AMBARI-25399: Add hive PAM support for service check and alerts (#3407)
63521eb7a5 is described below
commit 63521eb7a5dbb6072a775159f02f1ac8b711cf9c
Author: Zhiguo Wu <wu...@apache.org>
AuthorDate: Mon Oct 17 10:00:50 2022 +0800
AMBARI-25399: Add hive PAM support for service check and alerts (#3407)
---
.../python/resource_management/libraries/functions/hive_check.py | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py b/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
index fa3eb7e00a..ad4612cde2 100644
--- a/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
+++ b/ambari-common/src/main/python/resource_management/libraries/functions/hive_check.py
@@ -28,7 +28,7 @@ from resource_management.core.shell import quote_bash_args
def check_thrift_port_sasl(address, port, hive_auth="NOSASL", key=None, kinitcmd=None, smokeuser='ambari-qa',
hive_user='hive', transport_mode="binary", http_endpoint="cliservice",
ssl=False, ssl_keystore=None, ssl_password=None, check_command_timeout=30,
- ldap_username="", ldap_password=""):
+ ldap_username="", ldap_password="", pam_username="", pam_password=""):
"""
Hive thrift SASL port check
"""
@@ -60,6 +60,12 @@ def check_thrift_port_sasl(address, port, hive_auth="NOSASL", key=None, kinitcmd
quoted_ldap_password = quote_bash_args(ldap_password)
credential_str = "-n {ldap_username} -p {quoted_ldap_password!p}"
+ # append username and password for PAM
+ if hive_auth == "PAM":
+ # password might contain special characters that need to be escaped
+ quoted_pam_password = quote_bash_args(pam_password)
+ credential_str = "-n '{pam_username}' -p '{quoted_pam_password!p}'"
+
# append url according to ssl configuration
if ssl and ssl_keystore is not None and ssl_password is not None:
beeline_url.extend(['ssl={ssl_str}', 'sslTrustStore={ssl_keystore}', 'trustStorePassword={ssl_password!p}'])
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@ambari.apache.org
For additional commands, e-mail: commits-help@ambari.apache.org