You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vb...@apache.org on 2015/03/03 16:18:58 UTC

ambari git commit: AMBARI-9896. Skip group modification option is not being honored for "usermod".(vbrodetskyi)

Repository: ambari
Updated Branches:
  refs/heads/trunk 954b96e1e -> ba16ce33e


AMBARI-9896. Skip group modification option is not being honored for "usermod".(vbrodetskyi)


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

Branch: refs/heads/trunk
Commit: ba16ce33e8b9ea6c6e44e50140da1ae797e789bc
Parents: 954b96e
Author: Vitaly Brodetskyi <vb...@hortonworks.com>
Authored: Tue Mar 3 17:18:38 2015 +0200
Committer: Vitaly Brodetskyi <vb...@hortonworks.com>
Committed: Tue Mar 3 17:18:38 2015 +0200

----------------------------------------------------------------------
 .../2.0.6/hooks/before-ANY/scripts/shared_initialization.py    | 6 ++++--
 .../python/stacks/2.0.6/hooks/before-ANY/test_before_any.py    | 5 +++--
 2 files changed, 7 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/ba16ce33/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py
index 9045ede..8d67320 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/before-ANY/scripts/shared_initialization.py
@@ -113,7 +113,8 @@ def create_dfs_cluster_admins():
     )
 
   User(params.hdfs_user,
-    groups = params.user_to_groups_dict[params.hdfs_user] + groups_list
+    groups = params.user_to_groups_dict[params.hdfs_user] + groups_list,
+    ignore_failures = params.ignore_groupsusers_create
   )
 
 
@@ -128,8 +129,9 @@ def set_uid(user, user_dirs):
   File(format("{tmp_dir}/changeUid.sh"),
        content=StaticFile("changeToSecureUid.sh"),
        mode=0555)
+  ignore_groupsusers_create_str = str(params.ignore_groupsusers_create).lower()
   Execute(format("{tmp_dir}/changeUid.sh {user} {user_dirs}"),
-          not_if = format("test $(id -u {user}) -gt 1000"))
+          not_if = format("(test $(id -u {user}) -gt 1000) || ({ignore_groupsusers_create_str})"))
     
 def setup_hadoop_env():
   import params

http://git-wip-us.apache.org/repos/asf/ambari/blob/ba16ce33/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py
index 06e78b6..5a750d2 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/before-ANY/test_before_any.py
@@ -125,7 +125,7 @@ class TestHookBeforeInstall(RMFTestCase):
         mode = 0555,
     )
     self.assertResourceCalled('Execute', '/tmp/changeUid.sh ambari-qa /tmp/hadoop-ambari-qa,/tmp/hsperfdata_ambari-qa,/home/ambari-qa,/tmp/ambari-qa,/tmp/sqoop-ambari-qa',
-        not_if = 'test $(id -u ambari-qa) -gt 1000',
+        not_if = '(test $(id -u ambari-qa) -gt 1000) || (false)',
     )
     self.assertResourceCalled('Directory', '/hadoop/hbase',
         owner = 'hbase',
@@ -138,7 +138,7 @@ class TestHookBeforeInstall(RMFTestCase):
         mode = 0555,
     )
     self.assertResourceCalled('Execute', '/tmp/changeUid.sh hbase /home/hbase,/tmp/hbase,/usr/bin/hbase,/var/log/hbase,/hadoop/hbase',
-        not_if = 'test $(id -u hbase) -gt 1000',
+        not_if = '(test $(id -u hbase) -gt 1000) || (false)',
     )
     self.assertResourceCalled('User', 'test_user1',
         ignore_failures = False
@@ -154,6 +154,7 @@ class TestHookBeforeInstall(RMFTestCase):
     )
     self.assertResourceCalled('User', 'hdfs',
         groups = [u'hadoop', u'hdfs', u'test_group'],
+        ignore_failures = False
     )
     self.assertResourceCalled('Directory', '/etc/hadoop',
         mode = 0755