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-12605. SyntaxWarning: name 'is_logger_setup' is assigned to before global declaration
Date Fri, 31 Jul 2015 10:53:54 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-2.1 056f5c837 -> 3d1b2fe89


AMBARI-12605. SyntaxWarning: name 'is_logger_setup' is assigned to before global declaration


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

Branch: refs/heads/branch-2.1
Commit: 3d1b2fe892d6258245ce0f8de7a087ea30bf8e31
Parents: 056f5c8
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Fri Jul 31 13:52:59 2015 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Fri Jul 31 13:52:59 2015 +0300

----------------------------------------------------------------------
 ambari-agent/src/main/python/ambari_agent/main.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3d1b2fe8/ambari-agent/src/main/python/ambari_agent/main.py
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/python/ambari_agent/main.py b/ambari-agent/src/main/python/ambari_agent/main.py
index 1968996..3c2933e 100644
--- a/ambari-agent/src/main/python/ambari_agent/main.py
+++ b/ambari-agent/src/main/python/ambari_agent/main.py
@@ -47,7 +47,6 @@ from HeartbeatHandlers import bind_signal_handlers
 from ambari_commons.constants import AMBARI_SUDO_BINARY
 logger = logging.getLogger(__name__)
 
-is_logger_setup = False
 formatstr = "%(levelname)s %(asctime)s %(filename)s:%(lineno)d - %(message)s"
 agentPid = os.getpid()
 config = AmbariConfig.AmbariConfig()
@@ -240,7 +239,7 @@ def main(heartbeat_stop_callback=None):
   current_user = getpass.getuser()
 
   setup_logging(options.verbose)
-  
+
   default_cfg = {'agent': {'prefix': '/home/ambari'}}
   config.load(default_cfg)
   bind_signal_handlers(agentPid)
@@ -306,12 +305,12 @@ def main(heartbeat_stop_callback=None):
   logger.info("finished")
 
 if __name__ == "__main__":
+  is_logger_setup = False
   try:
     heartbeat_stop_callback = bind_signal_handlers(agentPid)
   
     main(heartbeat_stop_callback)
   except:
-    global is_logger_setup
     if is_logger_setup:
       logger.exception("Fatal exception occurred:")
     raise


Mime
View raw message