ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jonathanhur...@apache.org
Subject ambari git commit: AMBARI-11941 - RU: Pre Upgrade HDFS Fails Due To Kerberos Security Exception (jonathanhurley)
Date Tue, 16 Jun 2015 20:29:00 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 a03011c7d -> 22e421d05


AMBARI-11941 - RU: Pre Upgrade HDFS Fails Due To Kerberos Security Exception (jonathanhurley)


Project: http://git-wip-us.apache.org/repos/asf/ambari/repo
Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/22e421d0
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/22e421d0
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/22e421d0

Branch: refs/heads/branch-2.1
Commit: 22e421d05987930fb32d8344e6ea184780325215
Parents: a03011c
Author: Jonathan Hurley <jhurley@hortonworks.com>
Authored: Tue Jun 16 13:59:55 2015 -0400
Committer: Jonathan Hurley <jhurley@hortonworks.com>
Committed: Tue Jun 16 16:28:56 2015 -0400

----------------------------------------------------------------------
 .../package/scripts/namenode_upgrade.py         |  6 ++-
 .../python/stacks/2.0.6/HDFS/test_namenode.py   | 43 +++++++++++---------
 2 files changed, 28 insertions(+), 21 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/22e421d0/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
index bc1e3ad..59fef7d 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode_upgrade.py
@@ -91,7 +91,8 @@ def prepare_rolling_upgrade():
   Logger.info(format("Performing a(n) {params.upgrade_direction} of HDFS"))
 
   if params.security_enabled:
-    Execute(format("{params.kinit_path_local} -kt {params.hdfs_user_keytab} {params.hdfs_principal_name}"))
+    kinit_command = format("{params.kinit_path_local} -kt {params.hdfs_user_keytab} {params.hdfs_principal_name}")

+    Execute(kinit_command, user=params.hdfs_user, logoutput=True)
 
 
   if params.upgrade_direction == Direction.UPGRADE:
@@ -118,7 +119,8 @@ def finalize_rolling_upgrade():
   import params
 
   if params.security_enabled:
-    Execute(format("{params.kinit_path_local} -kt {params.hdfs_user_keytab} {params.hdfs_principal_name}"))
+    kinit_command = format("{params.kinit_path_local} -kt {params.hdfs_user_keytab} {params.hdfs_principal_name}")

+    Execute(kinit_command, user=params.hdfs_user, logoutput=True)
 
   finalize_cmd = "hdfs dfsadmin -rollingUpgrade finalize"
   query_cmd = "hdfs dfsadmin -rollingUpgrade query"

http://git-wip-us.apache.org/repos/asf/ambari/blob/22e421d0/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
index f6c3b1a..f88d51e 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/HDFS/test_namenode.py
@@ -1211,21 +1211,22 @@ class TestNamenode(RMFTestCase):
     json_content['commandParams']['upgrade_direction'] = 'upgrade'
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/namenode.py",
-                       classname = "NameNode",
-                       command = "prepare_rolling_upgrade",
-                       config_dict = json_content,
-                       hdp_stack_version = self.STACK_VERSION,
-                       target = RMFTestCase.TARGET_COMMON_SERVICES,
-                       call_mocks = [(0, "Safe mode is OFF in c6401.ambari.apache.org")])
-    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/hdfs.headless.keytab
hdfs',)
+      classname = "NameNode",
+      command = "prepare_rolling_upgrade",
+      config_dict = json_content,
+      hdp_stack_version = self.STACK_VERSION,
+      target = RMFTestCase.TARGET_COMMON_SERVICES,
+      call_mocks = [(0, "Safe mode is OFF in c6401.ambari.apache.org")])
+    
+    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/hdfs.headless.keytab
hdfs',
+      logoutput = True, user = 'hdfs')
+    
     self.assertResourceCalled('Execute', 'hdfs dfsadmin -rollingUpgrade prepare',
-                              logoutput = True,
-                              user = 'hdfs',
-                              )
+      logoutput = True, user = 'hdfs')
+
     self.assertResourceCalled('Execute', 'hdfs dfsadmin -rollingUpgrade query',
-                              logoutput = True,
-                              user = 'hdfs',
-                              )
+      logoutput = True, user = 'hdfs')
+    
     self.assertNoMoreResources()
   
 
@@ -1241,12 +1242,16 @@ class TestNamenode(RMFTestCase):
     shell_call_mock.return_value = 0, "Safe mode is OFF in c6401.ambari.apache.org"
 
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/namenode.py",
-                       classname = "NameNode",
-                       command = "prepare_rolling_upgrade",
-                       config_dict = json_content,
-                       hdp_stack_version = self.STACK_VERSION,
-                       target = RMFTestCase.TARGET_COMMON_SERVICES)
-    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/hdfs.headless.keytab
hdfs',)
+      classname = "NameNode",
+      command = "prepare_rolling_upgrade",
+      config_dict = json_content,
+      hdp_stack_version = self.STACK_VERSION,
+      target = RMFTestCase.TARGET_COMMON_SERVICES)
+    
+    self.assertResourceCalled('Execute', 
+        '/usr/bin/kinit -kt /etc/security/keytabs/hdfs.headless.keytab hdfs',
+        logoutput = True, user = 'hdfs')
+        
     self.assertNoMoreResources()
 
 


Mime
View raw message