community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1837944 - /comdev/reporter.apache.org/trunk/scripts/scandist.py
Date Mon, 13 Aug 2018 13:15:15 GMT
Author: sebb
Date: Mon Aug 13 13:15:15 2018
New Revision: 1837944

URL: http://svn.apache.org/viewvc?rev=1837944&view=rev
Log:
localise variable; only override URL if non-empty

Modified:
    comdev/reporter.apache.org/trunk/scripts/scandist.py

Modified: comdev/reporter.apache.org/trunk/scripts/scandist.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/scandist.py?rev=1837944&r1=1837943&r2=1837944&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/scandist.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/scandist.py Mon Aug 13 13:15:15 2018
@@ -455,6 +455,7 @@ class MyDaemon(daemon):
         main()
  
 if __name__ == "__main__":
+        PID_FILE = '/tmp/scandist.pid'
         logger = logging.getLogger('scandist')
         logger.setLevel(logging.INFO)
         formatter = logging.Formatter('%(asctime)s %(levelname)s: %(message)s')
@@ -463,14 +464,16 @@ if __name__ == "__main__":
         logger.addHandler(ch)
         logfile = os.environ.get('LOGFILE')
         logger.info("LOGFILE=%s", logfile)
-        daemon = MyDaemon('/tmp/scandist.pid', logfile)
         if len(sys.argv) >= 2:
                 if 'start' == sys.argv[1]:
-                    daemon.start()
+                    my_daemon = MyDaemon(PID_FILE, logfile)
+                    my_daemon.start()
                 elif 'stop' == sys.argv[1]:
-                    daemon.stop()
+                    my_daemon = MyDaemon(PID_FILE, logfile)
+                    my_daemon.stop()
                 elif 'restart' == sys.argv[1]:
-                    daemon.restart()
+                    my_daemon = MyDaemon(PID_FILE, logfile)
+                    my_daemon.restart()
                 elif 'foreground' == sys.argv[1]:
                     debug = True
                     interactive = True
@@ -480,7 +483,7 @@ if __name__ == "__main__":
                     sendEmail = False
                     trace = True
                     interactive = True
-                    if len(sys.argv) > 2:
+                    if len(sys.argv) > 2 and len(sys.argv[2]) > 0: # only override
if non-empty
                         DEFAULT_URL = sys.argv[2]
                     if len(sys.argv) > 3:
                         RELEASE_MATCH = sys.argv[3]



Mime
View raw message