# HG changeset patch # User Thierry Florac # Date 1518954307 -3600 # Node ID 4575175f645819a1369624a9c740ad19b90d5913 # Parent 92e1d7b3022e4204c58d166c1eba6a8da2e880e2 Check for PyAMS command line script in application startup diff -r 92e1d7b3022e -r 4575175f6458 src/pyams_content_es/include.py --- a/src/pyams_content_es/include.py Sun Feb 18 12:44:23 2018 +0100 +++ b/src/pyams_content_es/include.py Sun Feb 18 12:45:07 2018 +0100 @@ -18,6 +18,7 @@ import logging logger = logging.getLogger('PyAMS (content.es)') +import os.path import sys # import interfaces @@ -51,8 +52,9 @@ def handle_new_application(event): """Start indexer process when application 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()