From b0dc32fa602e684981242d73342e628c808515ae Mon Sep 17 00:00:00 2001 From: checktheroads Date: Sun, 22 Mar 2020 11:41:51 -0700 Subject: [PATCH] log hyperglass version on startup --- hyperglass/api/events.py | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/hyperglass/api/events.py b/hyperglass/api/events.py index 2ba3d82..37d08df 100644 --- a/hyperglass/api/events.py +++ b/hyperglass/api/events.py @@ -10,7 +10,7 @@ from hyperglass.util import ( build_frontend, clear_redis_cache, ) -from hyperglass.constants import MIN_PYTHON_VERSION +from hyperglass.constants import MIN_PYTHON_VERSION, __version__ from hyperglass.exceptions import HyperglassError from hyperglass.configuration import ( URL_DEV, @@ -22,6 +22,12 @@ from hyperglass.configuration import ( ) +async def log_hyperglass_version(): + """Log the hyperglass version on startup.""" + log.info(f"hyperglass version is {__version__}") + return True + + async def check_python_version(): """Ensure Python version meets minimum requirement. @@ -85,5 +91,10 @@ async def clear_cache(): pass -on_startup = [check_python_version, check_redis_instance, build_ui] +on_startup = [ + log_hyperglass_version, + check_python_version, + check_redis_instance, + build_ui, +] on_shutdown = [clear_cache]