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-13120 - Restart Of NodeManager During Rolling Upgrade Runs Command As the Wrong User (jonathanhurley)
Date Thu, 17 Sep 2015 15:08:23 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk b99ba4d24 -> f08a40f84


AMBARI-13120 - Restart Of NodeManager During Rolling Upgrade Runs Command As the Wrong User
(jonathanhurley)


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

Branch: refs/heads/trunk
Commit: f08a40f845421e13b01187590c4d630d7345374c
Parents: b99ba4d
Author: Jonathan Hurley <jhurley@hortonworks.com>
Authored: Wed Sep 16 21:18:14 2015 -0400
Committer: Jonathan Hurley <jhurley@hortonworks.com>
Committed: Thu Sep 17 11:07:59 2015 -0400

----------------------------------------------------------------------
 .../package/scripts/nodemanager_upgrade.py      |  4 ++--
 .../stacks/2.0.6/YARN/test_nodemanager.py       | 22 +++++++++++++-------
 2 files changed, 16 insertions(+), 10 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/f08a40f8/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager_upgrade.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager_upgrade.py
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager_upgrade.py
index 54e0fae..9ac2d63 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager_upgrade.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/nodemanager_upgrade.py
@@ -36,7 +36,7 @@ def post_upgrade_check():
 
   Logger.info('NodeManager executing "yarn node -list -states=RUNNING" to verify the node
has rejoined the cluster...')
   if params.security_enabled and params.nodemanager_kinit_cmd:
-    Execute(params.nodemanager_kinit_cmd, user = params.yarn_user)
+    Execute(params.nodemanager_kinit_cmd, user=params.yarn_user)
 
   _check_nodemanager_startup()
 
@@ -56,7 +56,7 @@ def _check_nodemanager_startup():
 
   try:
     # 'su - yarn -c "yarn node -status c6401.ambari.apache.org:45454"'
-    return_code, yarn_output = shell.call(command, user=params.hdfs_user)
+    return_code, yarn_output = shell.call(command, user=params.yarn_user)
   except:
     raise Fail('Unable to determine if the NodeManager has started after upgrade.')
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/f08a40f8/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
index 6794097..2692420 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/YARN/test_nodemanager.py
@@ -520,20 +520,26 @@ class TestNodeManager(RMFTestCase):
       c6401.ambari.apache.org:45454  RUNNING  c6401.ambari.apache.org:8042  0
     """
     mocks_dict = {}
-    
+
     self.executeScript(self.COMMON_SERVICES_PACKAGE_DIR + "/scripts/nodemanager.py",
-                       classname="Nodemanager",
-                       command = "post_rolling_restart",
-                       config_file="default.json",
-                       hdp_stack_version = self.STACK_VERSION,
-                       target = RMFTestCase.TARGET_COMMON_SERVICES,
-                       call_mocks = [(0, process_output)],
-                       mocks_dict = mocks_dict
+      classname = "Nodemanager",
+      command = "post_rolling_restart",
+      config_file = "default.json",
+      hdp_stack_version = self.STACK_VERSION,
+      target = RMFTestCase.TARGET_COMMON_SERVICES,
+      call_mocks = [(0, process_output)],
+      mocks_dict = mocks_dict
     )
 
     self.assertTrue(mocks_dict['call'].called)
     self.assertEqual(mocks_dict['call'].call_count,1)
 
+    self.assertEquals(
+      "yarn node -list -states=RUNNING",
+       mocks_dict['call'].call_args_list[0][0][0])
+
+    self.assertEquals( {'user': u'yarn'}, mocks_dict['call'].call_args_list[0][1])
+
 
   @patch('time.sleep')
   def test_post_rolling_restart_nodemanager_not_ready(self, time_mock):


Mime
View raw message