From 2db743baaa4e14e758fbdfdb7a2db0f8d0e91853 Mon Sep 17 00:00:00 2001 From: tierno Date: Tue, 28 Mar 2017 17:23:15 +0200 Subject: [PATCH] fix moving openvim version/date/db_version to ovim Change-Id: If59a7d7d238268c3601e68a5d6feabbf11deed5b Signed-off-by: tierno --- openvimd.py | 4 +--- ovim.py | 7 ++++--- 2 files changed, 5 insertions(+), 6 deletions(-) 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() -- 2.17.1