ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject ambari git commit: AMBARI-15300. Ability to customize Server LOG + PID dirs
Date Mon, 21 Mar 2016 15:58:28 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk c78296809 -> e4d955cdf


AMBARI-15300. Ability to customize Server LOG + PID dirs


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

Branch: refs/heads/trunk
Commit: e4d955cdf25442a2bd45c4bba15161402ff2bd4c
Parents: c782968
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Mon Mar 21 17:57:48 2016 +0200
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Mon Mar 21 17:58:22 2016 +0200

----------------------------------------------------------------------
 ambari-server/src/test/python/TestOSCheck.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e4d955cd/ambari-server/src/test/python/TestOSCheck.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/TestOSCheck.py b/ambari-server/src/test/python/TestOSCheck.py
index 5a2e7e7..1be783e 100644
--- a/ambari-server/src/test/python/TestOSCheck.py
+++ b/ambari-server/src/test/python/TestOSCheck.py
@@ -30,18 +30,23 @@ from mock.mock import MagicMock
 
 from only_for_platform import os_distro_value, os_distro_value_linux
 
+from ambari_commons import os_utils
+
 from ambari_commons import OSCheck, OSConst
 import os_check_type
 
+_search_file = os_utils.search_file
+os_utils.search_file = MagicMock(return_value="/tmp/ambari.properties")
 utils = __import__('ambari_server.utils').utils
 # We have to use this import HACK because the filename contains a dash
-with patch("platform.linux_distribution", return_value = os_distro_value_linux):
-  with patch.object(OSCheck, "os_distribution", return_value = os_distro_value):
-    with patch.object(utils, "get_postgre_hba_dir"):
-      os.environ["ROOT"] = ""
-      ambari_server = __import__('ambari-server')
-
-      from ambari_server.serverConfiguration import update_ambari_properties, configDefaults
+with patch.object(os_utils, "parse_log4j_file", return_value={'ambari.log.dir': '/var/log/ambari-server'}):
+  with patch("platform.linux_distribution", return_value = os_distro_value_linux):
+    with patch.object(OSCheck, "os_distribution", return_value = os_distro_value):
+      with patch.object(utils, "get_postgre_hba_dir"):
+        os.environ["ROOT"] = ""
+        ambari_server = __import__('ambari-server')
+  
+        from ambari_server.serverConfiguration import update_ambari_properties, configDefaults
 
 
 class TestOSCheck(TestCase):


Mime
View raw message