From: mirabal Date: Mon, 27 Mar 2017 16:08:07 +0000 (+0200) Subject: Move openvim version/date/db_version to ovim X-Git-Tag: v2.0.0~35 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=50a052f5e3c1202e5c787851e8b2dd69d8f20629;p=osm%2Fopenvim.git Move openvim version/date/db_version to ovim Change-Id: Ia4740a7eebb09ab537d099dbd79cf44796a7979e Signed-off-by: mirabal --- diff --git a/openvimd.py b/openvimd.py index 6090741..3acbedf 100755 --- a/openvimd.py +++ b/openvimd.py @@ -30,9 +30,7 @@ and host controllers __author__ = "Alfonso Tierno" __date__ = "$10-jul-2014 12:07:15$" -__version__ = "0.5.8-r524" -version_date = "March 2017" -database_version = "0.15" #expected database schema version + import httpserver import auxiliary_functions as af @@ -150,7 +148,7 @@ if __name__=="__main__": for o, a in opts: if o in ("-v", "--version"): - print "openvimd version", __version__, version_date + print "openvimd version", ovim.ovim.get_version(), ovim.ovim.get_version_date() print "(c) Copyright Telefonica" sys.exit(0) elif o in ("-h", "--help"): @@ -219,9 +217,9 @@ if __name__=="__main__": print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' print "!! Warning, openvimd in TEST mode '%s'" % config_dic['mode'] print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' - config_dic['version'] = __version__ + config_dic['version'] = ovim.get_version() - config_dic["database_version"] = database_version + config_dic["database_version"] = ovim.ovim.get_database_version() config_dic["logger_name"] = "openvim" engine = ovim.ovim(config_dic) diff --git a/ovim.py b/ovim.py index 6e8f8da..edd0b4c 100644 --- a/ovim.py +++ b/ovim.py @@ -28,6 +28,9 @@ Two thread will be launched, with normal and administrative permissions. __author__ = "Alfonso Tierno, Leonardo Mirabal" __date__ = "$06-Feb-2017 12:07:15$" +__version__ = "0.5.8-r524" +version_date = "March 2017" +database_version = "0.15" #expected database schema version import threading import vim_db @@ -109,6 +112,18 @@ class ovim(): self.config['db_host']) ) return db + @staticmethod + def get_version(): + return __version__ + + @staticmethod + def get_version_date(): + return version_date + + @staticmethod + def get_database_version(): + return database_version + @staticmethod def _check_dhcp_data_integrity(network): """