You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by jo...@apache.org on 2015/01/15 17:20:57 UTC

ambari git commit: AMBARI-9147 - Ambari-agent errors out, but starts (Yurii Shylov via jonathanhurley)

Repository: ambari
Updated Branches:
  refs/heads/trunk 261f04b7d -> e2b3f4deb


AMBARI-9147 - Ambari-agent errors out, but starts (Yurii Shylov via jonathanhurley)


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

Branch: refs/heads/trunk
Commit: e2b3f4deb6175f8f3291a5bddfbe09330414dadd
Parents: 261f04b
Author: Jonathan Hurley <jh...@hortonworks.com>
Authored: Thu Jan 15 11:20:50 2015 -0500
Committer: Jonathan Hurley <jh...@hortonworks.com>
Committed: Thu Jan 15 11:20:50 2015 -0500

----------------------------------------------------------------------
 .../src/main/python/ambari_agent/AlertSchedulerHandler.py      | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e2b3f4de/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py b/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
index 11f7de3..66b1758 100644
--- a/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
+++ b/ambari-agent/src/main/python/ambari_agent/AlertSchedulerHandler.py
@@ -224,12 +224,12 @@ class AlertSchedulerHandler():
     definitions = []
     
     all_commands = None
+    alerts_definitions_path = os.path.join(self.cachedir, self.FILENAME)
     try:
-      with open(os.path.join(self.cachedir, self.FILENAME)) as fp:
+      with open(alerts_definitions_path) as fp:
         all_commands = json.load(fp)
     except:
-      if (logger.isEnabledFor(logging.DEBUG)):
-        traceback.print_exc()
+      logger.warning('Alert definitions file was not found under "{0}". No alerts will be scheduled.'.format(alerts_definitions_path))
       return definitions
     
     for command_json in all_commands: