Repository: ambari Updated Branches: refs/heads/branch-2.0.0 d83e10b1e -> 375c6908f
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/375c6908 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/375c6908 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/375c6908 Branch: refs/heads/branch-2.0.0 Commit: 375c6908fb5dc5575b8e917fc39edf466648ce52 Parents: d83e10b Author: Vitaly Brodetskyi <vbrodets...@hortonworks.com> Authored: Tue Mar 3 17:20:32 2015 +0200 Committer: Vitaly Brodetskyi <vbrodets...@hortonworks.com> Committed: Tue Mar 3 17:20:32 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/375c6908/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/375c6908/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