Log NBI version
Change-Id: I4aa09a66d26d4117e84789cddcb99106a680e232
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
diff --git a/osm_nbi/html_public/version b/osm_nbi/html_public/version
index 4e88043..1c596ef 100644
--- a/osm_nbi/html_public/version
+++ b/osm_nbi/html_public/version
@@ -1,3 +1,2 @@
-0.1.33
-2018-12-21
-
+0.1.34
+2018-01-21
diff --git a/osm_nbi/nbi.py b/osm_nbi/nbi.py
index 46c7c9b..a1e8b50 100644
--- a/osm_nbi/nbi.py
+++ b/osm_nbi/nbi.py
@@ -37,9 +37,8 @@
__author__ = "Alfonso Tierno <alfonso.tiernosepulveda@telefonica.com>"
-# TODO consider to remove and provide version using the static version file
__version__ = "0.1.3"
-version_date = "Apr 2018"
+version_date = "Jan 2019"
database_version = '1.0'
auth_database_version = '1.0'
@@ -898,13 +897,6 @@
# raise cherrypy.HTTPError(e.http_code.value, str(e))
-# def validate_password(realm, username, password):
-# cherrypy.log("realm "+ str(realm))
-# if username == "admin" and password == "admin":
-# return True
-# return False
-
-
def _start_service():
"""
Callback function called when cherrypy.engine starts
@@ -995,7 +987,14 @@
cherrypy.tree.apps['/osm'].root.authenticator.start(engine_config)
cherrypy.tree.apps['/osm'].root.engine.init_db(target_version=database_version)
cherrypy.tree.apps['/osm'].root.authenticator.init_db(target_version=auth_database_version)
- # getenv('OSMOPENMANO_TENANT', None)
+
+ # load and print version. Ignore possible errors, e.g. file not found
+ try:
+ with open("{}/version".format(engine_config["/static"]['tools.staticdir.dir'])) as version_file:
+ version_data = version_file.read()
+ cherrypy.log.error("Starting OSM NBI Version: {}".format(version_data.replace("\n", " ")))
+ except Exception:
+ pass
def _stop_service():