You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by nc...@apache.org on 2017/04/17 20:18:00 UTC

[06/34] ambari git commit: AMBARI-20578 APPENDUM-2 Log Search Configuration API (mgergely)

AMBARI-20578 APPENDUM-2 Log Search Configuration API (mgergely)

Change-Id: I5db7d93c68148d1d65bddf3a1f085fb17dcccbf9


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

Branch: refs/heads/branch-feature-AMBARI-12556
Commit: aca12b7a3387211a51718026215a30877960035d
Parents: 68b7b56
Author: Miklos Gergely <mg...@hortonworks.com>
Authored: Thu Apr 13 01:28:16 2017 +0200
Committer: Miklos Gergely <mg...@hortonworks.com>
Committed: Thu Apr 13 01:28:25 2017 +0200

----------------------------------------------------------------------
 .../2.0.6/hooks/after-INSTALL/scripts/params.py |  2 +-
 .../hooks/after-INSTALL/test_after_install.py   | 25 +++++++++++++++++++-
 2 files changed, 25 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/aca12b7a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
index fbea258..9abd2fe 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/hooks/after-INSTALL/scripts/params.py
@@ -56,7 +56,7 @@ service_package_folder = config['commandParams']['service_package_folder']
 logsearch_service_name = service_name.lower().replace("_", "-")
 logsearch_config_file_name = 'input.config-' + logsearch_service_name + ".json"
 logsearch_config_file_path = agent_cache_dir + "/" + service_package_folder + "/templates/" + logsearch_config_file_name + ".j2"
-logsearch_config_file_exists = os.path.exists(logsearch_config_file_path)
+logsearch_config_file_exists = os.path.isfile(logsearch_config_file_path)
 
 # default hadoop params
 mapreduce_libs_path = "/usr/lib/hadoop-mapreduce/*"

http://git-wip-us.apache.org/repos/asf/ambari/blob/aca12b7a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py b/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
index 1bfa173..19c785c 100644
--- a/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
+++ b/ambari-server/src/test/python/stacks/2.0.6/hooks/after-INSTALL/test_after_install.py
@@ -24,6 +24,7 @@ from stacks.utils.RMFTestCase import *
 from resource_management.libraries.functions import conf_select
 
 @patch("os.path.exists", new = MagicMock(return_value=True))
+@patch("os.path.isfile", new = MagicMock(return_value=False))
 class TestHookAfterInstall(RMFTestCase):
 
   def test_hook_default(self):
@@ -40,7 +41,11 @@ class TestHookAfterInstall(RMFTestCase):
                               configurations = self.getConfig()['configurations']['core-site'],
                               configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
                               only_if="ls /etc/hadoop/conf")
-
+    self.assertResourceCalled('Directory',
+                              '/etc/ambari-logsearch-logfeeder/conf',
+                              mode = 0755,
+                              cd_access = 'a',
+                              create_parents = True)
     self.assertNoMoreResources()
 
 
@@ -81,6 +86,12 @@ class TestHookAfterInstall(RMFTestCase):
       configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
       only_if="ls /usr/hdp/current/hadoop-client/conf")
 
+    self.assertResourceCalled('Directory',
+                              '/etc/ambari-logsearch-logfeeder/conf',
+                              mode = 0755,
+                              cd_access = 'a',
+                              create_parents = True)
+
     package_dirs = conf_select.get_package_dirs();
     for package, dir_defs in package_dirs.iteritems():
       for dir_def in dir_defs:
@@ -148,6 +159,12 @@ class TestHookAfterInstall(RMFTestCase):
       configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
       only_if="ls /usr/hdp/current/hadoop-client/conf")
 
+    self.assertResourceCalled('Directory',
+                              '/etc/ambari-logsearch-logfeeder/conf',
+                              mode = 0755,
+                              cd_access = 'a',
+                              create_parents = True)
+
     package_dirs = conf_select.get_package_dirs();
     for package, dir_defs in package_dirs.iteritems():
       for dir_def in dir_defs:
@@ -248,6 +265,12 @@ class TestHookAfterInstall(RMFTestCase):
       configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],
       only_if="ls /usr/hdp/current/hadoop-client/conf")
 
+    self.assertResourceCalled('Directory',
+                              '/etc/ambari-logsearch-logfeeder/conf',
+                              mode = 0755,
+                              cd_access = 'a',
+                              create_parents = True)
+
     package_dirs = conf_select.get_package_dirs();
     for package, dir_defs in package_dirs.iteritems():
       for dir_def in dir_defs: