You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by sm...@apache.org on 2015/05/23 02:43:53 UTC

ambari git commit: AMBARI-11349. ambari-agent.out file grows geometrically (aonishuk via smohanty)

Repository: ambari
Updated Branches:
  refs/heads/trunk cf5293a2c -> 48e0f3c72


AMBARI-11349. ambari-agent.out file grows geometrically (aonishuk via smohanty)


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

Branch: refs/heads/trunk
Commit: 48e0f3c723927d5d49160ac7ed3c5275f8eb66f2
Parents: cf5293a
Author: Sumit Mohanty <sm...@hortonworks.com>
Authored: Fri May 22 17:43:01 2015 -0700
Committer: Sumit Mohanty <sm...@hortonworks.com>
Committed: Fri May 22 17:43:01 2015 -0700

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/alerts/script_alert.py         | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/48e0f3c7/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py b/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
index b8b4daf..f0f5276 100644
--- a/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
+++ b/ambari-agent/src/main/python/ambari_agent/alerts/script_alert.py
@@ -24,6 +24,7 @@ import os
 import re
 from alerts.base_alert import BaseAlert
 from resource_management.core.environment import Environment
+from resource_management.core.logger import Logger
 
 logger = logging.getLogger()
 
@@ -98,7 +99,9 @@ class ScriptAlert(BaseAlert):
       matchObj = re.match( r'((.*)services\/(.*)\/package\/)', self.path_to_script)
       if matchObj:
         basedir = matchObj.group(1)
-        with Environment(basedir, tmp_dir=self.config.get('agent', 'tmp_dir')) as env:
+        Logger.logger = logging.getLogger()
+        Logger.logger.setLevel(logging.ERROR)
+        with Environment(basedir, tmp_dir=self.config.get('agent', 'tmp_dir'), logging_level=logging.ERROR) as env:
           return cmd_module.execute(configurations, self.parameters, self.host_name)
       else:
         return cmd_module.execute(configurations, self.parameters, self.host_name)