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:13:38 UTC

ambari git commit: AMBARI-9376. NodeManager start failed in secure cluster (container-executor permissions 0050 rather than 6050) (aonishuk)

Repository: ambari
Updated Branches:
  refs/heads/trunk dad9c2bc9 -> 2919506e4


AMBARI-9376. NodeManager start failed in secure cluster (container-executor permissions 0050 rather than 6050) (aonishuk)


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

Branch: refs/heads/trunk
Commit: 2919506e4bfd2d019d7409c7b22d6ff4841749b4
Parents: dad9c2b
Author: Andrew Onishuk <ao...@hortonworks.com>
Authored: Wed Jan 28 20:13:26 2015 +0200
Committer: Andrew Onishuk <ao...@hortonworks.com>
Committed: Wed Jan 28 20:13:26 2015 +0200

----------------------------------------------------------------------
 .../resource_management/core/providers/system.py     | 15 +++++++--------
 1 file changed, 7 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/2919506e/ambari-common/src/main/python/resource_management/core/providers/system.py
----------------------------------------------------------------------
diff --git a/ambari-common/src/main/python/resource_management/core/providers/system.py b/ambari-common/src/main/python/resource_management/core/providers/system.py
index 6023e60..ac63b21 100644
--- a/ambari-common/src/main/python/resource_management/core/providers/system.py
+++ b/ambari-common/src/main/python/resource_management/core/providers/system.py
@@ -61,13 +61,6 @@ def _coerce_gid(group):
 def _ensure_metadata(path, user, group, mode=None, cd_access=None):
   stat = os.stat(path)
   
-  if mode:
-    existing_mode = stat.st_mode & 07777
-    if existing_mode != mode:
-      Logger.info("Changing permission for %s from %o to %o" % (
-      path, existing_mode, mode))
-      sudo.chmod(path, mode)
-  
   if user:
     uid = _coerce_uid(user)
     if stat.st_uid != uid:
@@ -76,7 +69,6 @@ def _ensure_metadata(path, user, group, mode=None, cd_access=None):
       
       sudo.chown(path, user, None)
       
-
   if group:
     gid = _coerce_gid(group)
     if stat.st_gid != gid:
@@ -84,6 +76,13 @@ def _ensure_metadata(path, user, group, mode=None, cd_access=None):
         "Changing group for %s from %d to %s" % (path, stat.st_gid, group))
       sudo.chown(path, None, group)
       
+  if mode:
+    existing_mode = stat.st_mode & 07777
+    if existing_mode != mode:
+      Logger.info("Changing permission for %s from %o to %o" % (
+      path, existing_mode, mode))
+      sudo.chmod(path, mode)
+      
   if cd_access:
     if not re.match("^[ugoa]+$", cd_access):
       raise Fail("'cd_acess' value '%s' is not valid" % (cd_access))