ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [2/2] ambari git commit: AMBARI-13368. 'chmod -R 755' should be executed against Nodemanager local dirs (aonishuk)
Date Fri, 09 Oct 2015 09:20:57 GMT
AMBARI-13368. 'chmod -R 755' should be executed against Nodemanager local dirs (aonishuk)


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

Branch: refs/heads/branch-2.1
Commit: 4dadeb9fe1c341cec8743cb448289318b74ab009
Parents: d664579
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Oct 9 12:20:41 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Oct 9 12:20:41 2015 +0300

----------------------------------------------------------------------
 .../YARN/2.1.0.2.0/package/scripts/params_linux.py            | 3 +++
 .../common-services/YARN/2.1.0.2.0/package/scripts/yarn.py    | 7 +++++--
 .../src/test/python/stacks/2.0.6/YARN/test_nodemanager.py     | 7 ++++++-
 3 files changed, 14 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/4dadeb9f/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
index 9b242ea..c39e4c4 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/params_linux.py
@@ -171,6 +171,9 @@ if hostname and nm_address and nm_address.startswith("0.0.0.0:"):
 nm_local_dirs = config['configurations']['yarn-site']['yarn.nodemanager.local-dirs']
 nm_log_dirs = config['configurations']['yarn-site']['yarn.nodemanager.log-dirs']
 
+nm_local_dirs_list = nm_local_dirs.split(',')
+nm_log_dirs_list = nm_log_dirs.split(',')
+
 distrAppJarName = "hadoop-yarn-applications-distributedshell-2.*.jar"
 hadoopMapredExamplesJarName = "hadoop-mapreduce-examples-2.*.jar"
 

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dadeb9f/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
index b1b8ded..4307e1d 100644
--- a/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
+++ b/ambari-server/src/main/resources/common-services/YARN/2.1.0.2.0/package/scripts/yarn.py
@@ -104,7 +104,7 @@ def yarn(name = None):
 
     # First start after enabling/disabling security
     if params.toggle_nm_security:
-      Directory(params.nm_local_dirs.split(',') + params.nm_log_dirs.split(','),
+      Directory(params.nm_local_dirs_list + params.nm_log_dirs_list,
                 action='delete'
       )
 
@@ -125,7 +125,7 @@ def yarn(name = None):
 
 
     if not params.security_enabled or params.toggle_nm_security:
-      Directory(params.nm_local_dirs.split(',') + params.nm_log_dirs.split(','),
+      Directory(params.nm_local_dirs_list + params.nm_log_dirs_list,
                 owner=params.yarn_user,
                 group=params.user_group,
                 recursive=True,
@@ -133,6 +133,9 @@ def yarn(name = None):
                 ignore_failures=True,
                 mode=0775
                 )
+      Execute(("chmod", "-R", "755") + tuple(params.nm_local_dirs_list),
+                sudo=True,
+      )
 
   if params.yarn_nodemanager_recovery_dir:
     Directory(InlineTemplate(params.yarn_nodemanager_recovery_dir).get_content(),

http://git-wip-us.apache.org/repos/asf/ambari/blob/4dadeb9f/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 2692420..042797b 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
@@ -167,6 +167,9 @@ class TestNodeManager(RMFTestCase):
                               mode = 0775,
                               cd_access='a'
                               )
+    self.assertResourceCalled('Execute', ('chmod', '-R', '755', u'/hadoop/yarn/local',  u'/hadoop/yarn/local1'),
+        sudo = True,
+    )
     self.assertResourceCalled('Directory', '/var/run/hadoop-yarn',
       owner = 'yarn',
       group = 'hadoop',
@@ -349,7 +352,9 @@ class TestNodeManager(RMFTestCase):
                               mode = 0775,
                               cd_access='a'
                               )
-
+    self.assertResourceCalled('Execute', ('chmod', '-R', '755', u'/hadoop/yarn/local'),
+        sudo = True,
+    )
     self.assertResourceCalled('Directory', '/var/run/hadoop-yarn',
       owner = 'yarn',
       group = 'hadoop',


Mime
View raw message