ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] ambari git commit: AMBARI-14289. Rebalance HDFS fails with Operation not permitted error on an HA cluster (aonishuk)
Date Wed, 09 Dec 2015 13:10:21 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.2 d2501c8a1 -> 0a213f70f
  refs/heads/trunk 1e6d80f3c -> b5b876826


AMBARI-14289. Rebalance HDFS fails with Operation not permitted error on an HA cluster (aonishuk)


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

Branch: refs/heads/trunk
Commit: b5b87682646e55ec102ffcf978814ff27d0a60d4
Parents: 1e6d80f
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Wed Dec 9 15:10:10 2015 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Wed Dec 9 15:10:10 2015 +0200

----------------------------------------------------------------------
 .../HDFS/2.1.0.2.0/package/scripts/namenode.py               | 8 +++++---
 .../src/test/python/stacks/2.0.6/HDFS/test_namenode.py       | 3 +++
 2 files changed, 8 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/b5b87682/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
index 3e43e96..598d9ce 100644
--- a/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
+++ b/ambari-server/src/main/resources/common-services/HDFS/2.1.0.2.0/package/scripts/namenode.py
@@ -26,7 +26,7 @@ from datetime import datetime
 import ambari_simplejson as json # simplejson is much faster comparing to Python 2.6 json
module and has the same functions set.
 
 from resource_management import Script
-from resource_management.core.resources.system import Execute
+from resource_management.core.resources.system import Execute, File
 from resource_management.core import shell
 from resource_management.libraries.functions import conf_select
 from resource_management.libraries.functions import hdp_select
@@ -369,9 +369,11 @@ class NameNodeDefault(NameNode):
             logoutput = False,
     )
 
-    if params.security_enabled and os.path.exists(ccache_file_path):
+    if params.security_enabled:
       # Delete the kerberos credentials cache (ccache) file
-      os.remove(ccache_file_path)
+      File(ccache_file_path,
+           action = "delete",
+      )
 
 @OsFamilyImpl(os_family=OSConst.WINSRV_FAMILY)
 class NameNodeWindows(NameNode):

http://git-wip-us.apache.org/repos/asf/ambari/blob/b5b87682/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 17c574b..0c2f046 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
@@ -1231,6 +1231,9 @@ class TestNamenode(RMFTestCase):
                               logoutput = False,
                               on_new_line = FunctionMock('handle_new_line'),
                               )
+    self.assertResourceCalled('File', ccache_path,
+                              action = ['delete'],
+                              )
     self.assertNoMoreResources()
 
   @patch("os.path.isfile")


Mime
View raw message