--- a/src/pyams_scheduler/include.py Thu Feb 08 08:54:58 2018 +0100
+++ b/src/pyams_scheduler/include.py Sun Feb 18 12:50:18 2018 +0100
@@ -18,6 +18,7 @@
import logging
logger = logging.getLogger('PyAMS (scheduler')
+import os.path
import sys
# import interfaces
@@ -54,8 +55,9 @@
def handle_new_application(event):
"""Start scheduler process when application is created"""
- # Check for upgrade mode
- if sys.argv[0].endswith('pyams_upgrade'):
+ # Check for PyAMS command line script
+ cmdline = os.path.split(sys.argv[0])[-1]
+ if cmdline.startswith('pyams_'):
return
registry = get_global_registry()
@@ -68,10 +70,10 @@
# get application
application_name = settings.get(PYAMS_APPLICATION_SETTINGS_KEY, PYAMS_APPLICATION_DEFAULT_NAME)
application = root.get(application_name)
- process = None
if application is not None:
sm = application.getSiteManager()
set_local_registry(sm)
+ process = None
try:
scheduler_util = sm.get(SCHEDULER_NAME)
try: