Add openflow-port-mapping CLI command
[osm/openvim.git] / openvimd.py
index be5d46e..b9d9d82 100755 (executable)
@@ -28,11 +28,9 @@ and launches the rest of threads: http clients, openflow controller
 and host controllers  
 '''
 
-__author__="Alfonso Tierno"
-__date__ ="$10-jul-2014 12:07:15$"
-__version__="0.5.3-r520"
-version_date="Jan 2017"
-database_version="0.10"      #expected database schema version
+__author__ = "Alfonso Tierno"
+__date__ = "$10-jul-2014 12:07:15$"
+
 
 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"):
@@ -171,6 +169,9 @@ if __name__=="__main__":
 
     
     engine = None
+    http_thread = None
+    http_thread_admin = None
+
     try:
         #Load configuration file
         r, config_dic = load_configuration(config_file)
@@ -216,9 +217,7 @@ if __name__=="__main__":
             print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
             print "!! Warning, openvimd in TEST mode '%s'" % config_dic['mode']
             print '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!'
-        config_dic['version'] = __version__
-
-        config_dic["database_version"] = database_version
+        config_dic['version'] = ovim.ovim.get_version()
         config_dic["logger_name"] = "openvim"
 
         engine = ovim.ovim(config_dic)
@@ -269,6 +268,10 @@ if __name__=="__main__":
     logger.info('Exiting openvimd')
     if engine:
         engine.stop_service()
+    if http_thread:
+        http_thread.join(1)
+    if http_thread_admin:
+        http_thread_admin.join(1)
 
     logger.debug( "bye!")
     exit()