From: tierno Date: Tue, 28 Mar 2017 15:23:15 +0000 (+0200) Subject: fix moving openvim version/date/db_version to ovim X-Git-Tag: v2.0.0~34 X-Git-Url: https://osm.etsi.org/gitweb/?a=commitdiff_plain;h=refs%2Fchanges%2F88%2F1388%2F1;p=osm%2Fopenvim.git fix moving openvim version/date/db_version to ovim Change-Id: If59a7d7d238268c3601e68a5d6feabbf11deed5b Signed-off-by: tierno --- diff --git a/openvimd.py b/openvimd.py index 3acbedf..b9d9d82 100755 --- a/openvimd.py +++ b/openvimd.py @@ -217,9 +217,7 @@ if __name__=="__main__": print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' print "!! Warning, openvimd in TEST mode '%s'" % config_dic['mode'] print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!' - config_dic['version'] = ovim.get_version() - - config_dic["database_version"] = ovim.ovim.get_database_version() + config_dic['version'] = ovim.ovim.get_version() config_dic["logger_name"] = "openvim" engine = ovim.ovim(config_dic) diff --git a/ovim.py b/ovim.py index edd0b4c..f896adc 100644 --- a/ovim.py +++ b/ovim.py @@ -164,15 +164,16 @@ class ovim(): Start ovim services :return: """ + global database_version # if self.running_info: # return #TODO service can be checked and rebuild broken threads r = self.db.get_db_version() if r[0] < 0: raise ovimException("DATABASE is not a VIM one or it is a '0.0' version. Try to upgrade to version '{}' with "\ - "'./database_utils/migrate_vim_db.sh'".format(self.config["database_version"]) ) - elif r[1] != self.config["database_version"]: + "'./database_utils/migrate_vim_db.sh'".format(database_version) ) + elif r[1] != database_version: raise ovimException("DATABASE wrong version '{}'. Try to upgrade/downgrade to version '{}' with "\ - "'./database_utils/migrate_vim_db.sh'".format(r[1], self.config["database_version"]) ) + "'./database_utils/migrate_vim_db.sh'".format(r[1], database_version) ) # create database connection for openflow threads self.db_of = self._create_database_connection()