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-9979. Oozie server start fails in non-root (aonishuk)
Date Sun, 08 Mar 2015 14:46:23 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.0.0 d2625abb6 -> 71c919360
  refs/heads/trunk 78c2de2c2 -> 29d301099


AMBARI-9979. Oozie server start fails in non-root (aonishuk)


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

Branch: refs/heads/trunk
Commit: 29d3010991237b804e859f5776c574aec6cdea5e
Parents: 78c2de2
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Sun Mar 8 16:46:02 2015 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Sun Mar 8 16:46:02 2015 +0200

----------------------------------------------------------------------
 .../python/resource_management/TestUserResource.py     |  2 +-
 .../OOZIE/4.0.0.2.0/package/scripts/oozie.py           |  4 +++-
 .../python/stacks/2.0.6/OOZIE/test_oozie_server.py     | 13 +++++++++----
 3 files changed, 13 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/29d30109/ambari-agent/src/test/python/resource_management/TestUserResource.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/test/python/resource_management/TestUserResource.py b/ambari-agent/src/test/python/resource_management/TestUserResource.py
index 3062881..c946fed 100644
--- a/ambari-agent/src/test/python/resource_management/TestUserResource.py
+++ b/ambari-agent/src/test/python/resource_management/TestUserResource.py
@@ -183,7 +183,7 @@ class TestUserResource(TestCase):
       user = User("mapred", action = "create", groups = ['1','2','3'], 
           shell = "/bin/bash")
 
-    popen_mock.assert_called_with(['/bin/bash', '--login', '--noprofile', '-c', 'ambari-sudo.sh
 PATH=/bin -H -E usermod -G 1,2,3,hadoop -s /bin/bash mapred'], shell=False, preexec_fn=None,
stderr=-2, stdout=5, env={'PATH': '/bin'}, bufsize=1, cwd=None)
+    popen_mock.assert_called_with(['/bin/bash', '--login', '--noprofile', '-c', 'ambari-sudo.sh
 PATH=/bin -H -E usermod -G 1,2,3 -s /bin/bash mapred'], shell=False, preexec_fn=None, stderr=-2,
stdout=5, env={'PATH': '/bin'}, bufsize=1, cwd=None)
     self.assertEqual(popen_mock.call_count, 1)
 
   @patch.object(subprocess, "Popen")

http://git-wip-us.apache.org/repos/asf/ambari/blob/29d30109/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
index 13026c3..82a76aa 100644
--- a/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
+++ b/ambari-server/src/main/resources/common-services/OOZIE/4.0.0.2.0/package/scripts/oozie.py
@@ -218,4 +218,6 @@ def oozie_server_specific():
         group = params.user_group,
         mode = 0664
     )
-  Execute (format("chown -R {oozie_user}:{user_group} {oozie_server_dir}"))
+  Execute(('chown', '-R', params.oozie_user, params.user_group, params.oozie_server_dir),

+          sudo=True
+  )

http://git-wip-us.apache.org/repos/asf/ambari/blob/29d30109/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
index 8cd2f11..4ae5112 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/OOZIE/test_oozie_server.py
@@ -217,8 +217,9 @@ class TestOozieServer(RMFTestCase):
                               not_if = 'ls /var/run/oozie/oozie.pid >/dev/null 2>&1
&& ps -p `cat /var/run/oozie/oozie.pid` >/dev/null 2>&1',
                               user = 'oozie',
                               )
-    self.assertResourceCalled('Execute', 'chown -R oozie:hadoop /var/lib/oozie/oozie-server',)
-    self.assertNoMoreResources()
+    self.assertResourceCalled('Execute', ('chown', '-R', u'oozie', u'hadoop', '/var/lib/oozie/oozie-server'),
+        sudo = True,
+    )
 
   @patch("os.path.isfile")
   def test_start_default(self, isfile_mock):
@@ -473,7 +474,9 @@ class TestOozieServer(RMFTestCase):
         not_if = 'ls /var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p
`cat /var/run/oozie/oozie.pid` >/dev/null 2>&1',
         user = 'oozie',
     )
-    self.assertResourceCalled('Execute', 'chown -R oozie:hadoop /var/lib/oozie/oozie-server',)
+    self.assertResourceCalled('Execute', ('chown', '-R', u'oozie', u'hadoop', '/var/lib/oozie/oozie-server'),
+        sudo = True,
+    )
 
 
   def assert_configure_secured(self):
@@ -627,7 +630,9 @@ class TestOozieServer(RMFTestCase):
         not_if = 'ls /var/run/oozie/oozie.pid >/dev/null 2>&1 && ps -p
`cat /var/run/oozie/oozie.pid` >/dev/null 2>&1',
         user = 'oozie',
     )
-    self.assertResourceCalled('Execute', 'chown -R oozie:hadoop /var/lib/oozie/oozie-server',)
+    self.assertResourceCalled('Execute', ('chown', '-R', u'oozie', u'hadoop', '/var/lib/oozie/oozie-server'),
+        sudo = True,
+    )
 
     def test_configure_default_hdp22(self):
       config_file = "stacks/2.0.6/configs/default.json"


Mime
View raw message