You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by ao...@apache.org on 2015/01/28 19:12:43 UTC
ambari git commit: AMBARI-9381. Check Kerberos fails on non-root
agent (aonishuk)
Repository: ambari
Updated Branches:
refs/heads/trunk 6b0e4a90c -> dad9c2bc9
AMBARI-9381. Check Kerberos fails on non-root agent (aonishuk)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/dad9c2bc
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/dad9c2bc
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/dad9c2bc
Branch: refs/heads/trunk
Commit: dad9c2bc95835a7c85211e148a02362ace15ccdd
Parents: 6b0e4a9
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Jan 28 20:12:28 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Jan 28 20:12:28 2015 +0200
----------------------------------------------------------------------
.../KERBEROS/1.10.3-10/package/scripts/kerberos_common.py | 10 +++++++---
.../KERBEROS/1.10.3-10/package/scripts/params.py | 2 ++
.../KERBEROS/1.10.3-10/package/scripts/service_check.py | 4 ++--
3 files changed, 11 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ambari/blob/dad9c2bc/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/kerberos_common.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/kerberos_common.py b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/kerberos_common.py
index 54b7411..b000c04 100644
--- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/kerberos_common.py
+++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/kerberos_common.py
@@ -301,7 +301,7 @@ class KerberosScript(Script):
KerberosScript.create_principal(admin_identity)
@staticmethod
- def test_kinit(identity):
+ def test_kinit(identity, user=None):
principal = get_property_value(identity, 'principal')
if principal is not None:
@@ -312,7 +312,9 @@ class KerberosScript(Script):
# If a test keytab file is available, simply use it
if (keytab_file is not None) and (os.path.isfile(keytab_file)):
command = 'kinit -k -t %s %s' % (keytab_file, principal)
- Execute(command)
+ Execute(command,
+ user = user,
+ )
return shell.checked_call('kdestroy')
# If base64-encoded test keytab data is available; then decode it, write it to a temporary file
@@ -324,7 +326,9 @@ class KerberosScript(Script):
try:
command = 'kinit -k -t %s %s' % (test_keytab_file, principal)
- Execute(command)
+ Execute(command,
+ user = user,
+ )
return shell.checked_call('kdestroy')
except:
raise
http://git-wip-us.apache.org/repos/asf/ambari/blob/dad9c2bc/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py
index b3337cf..c624dd5 100644
--- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/params.py
@@ -57,6 +57,8 @@ krb5kdc_pid_path = '/var/run/krb5kdc.pid'
smoke_test_principal = None
smoke_test_keytab_file = None
+smoke_user = config['configurations']['cluster-env']['smokeuser']
+
# If a test keytab file is available, simply use it
http://git-wip-us.apache.org/repos/asf/ambari/blob/dad9c2bc/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/service_check.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/service_check.py b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/service_check.py
index 13d4975..02b2ce2 100644
--- a/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/service_check.py
+++ b/ambari-server/src/main/resources/common-services/KERBEROS/1.10.3-10/package/scripts/service_check.py
@@ -34,7 +34,7 @@ class KerberosServiceCheck(KerberosScript):
code, out = self.test_kinit({
'principal': params.smoke_test_principal,
'keytab_file': params.smoke_test_keytab_file
- })
+ }, user=params.smoke_user)
test_performed = True
# Else if a test credentials is specified, try to test using that
@@ -45,7 +45,7 @@ class KerberosServiceCheck(KerberosScript):
'keytab_file': params.test_keytab_file,
'keytab': params.test_keytab,
'password': params.test_password
- })
+ }, user=params.smoke_user)
test_performed = True
else: