v0.4.51 checks datacenter-create type. Upon datacenter-attach, propagates vim credent...
[osm/RO.git] / openmanod.py
index dbd7737..69e6755 100755 (executable)
@@ -33,9 +33,9 @@ It loads the configuration file and launches the http_server thread that will li
 '''
 __author__="Alfonso Tierno, Gerardo Garcia, Pablo Montes"
 __date__ ="$26-aug-2014 11:09:29$"
-__version__="0.4.44-r482"
-version_date="Jul 2016"
-database_version="0.11"      #expected database schema version
+__version__="0.4.51-r493"
+version_date="Sep 2016"
+database_version="0.13"      #expected database schema version
 
 import httpserver
 import time
@@ -59,6 +59,8 @@ class LoadConfigurationException(Exception):
 def load_configuration(configuration_file):
     default_tokens ={'http_port':9090,
                      'http_host':'localhost',
+                     'http_console_proxy': True,
+                     'http_console_host': None,
                      'log_level': 'DEBUG',
                      'log_level_db': 'ERROR',
                      'log_level_vimconn': 'DEBUG',
@@ -211,6 +213,10 @@ if __name__=="__main__":
         global_config["console_port_iterator"] = console_port_iterator
         global_config["console_thread"]={}
         global_config["console_ports"]={}
+        if not global_config["http_console_host"]:
+            global_config["http_console_host"] = global_config["http_host"]
+            if global_config["http_host"]=="0.0.0.0":
+                global_config["http_console_host"] = socket.gethostname()
         
         #Configure logging STEP 2
         if "log_host" in global_config:
@@ -225,13 +231,15 @@ if __name__=="__main__":
                 file_handler= logging.handlers.RotatingFileHandler(global_config["log_file"], maxBytes=100e6, backupCount=9, delay=0)
                 file_handler.setFormatter(log_formatter_simple)
                 logger.addHandler(file_handler)
-                logger.debug("moving logs to '%s'", global_config["log_file"])
-                #remove initial strema handler
+                #logger.debug("moving logs to '%s'", global_config["log_file"])
+                #remove initial stream handler
                 logging.root.removeHandler(logging.root.handlers[0])
+                print ("logging on '{}'".format(global_config["log_file"]))
             except IOError as e:
                 raise LoadConfigurationException("Cannot open logging file '{}': {}. Check folder exist and permissions".format(global_config["log_file"], str(e)) ) 
         #logging.basicConfig(level = getattr(logging, global_config.get('log_level',"debug")))
         logger.setLevel(getattr(logging, global_config['log_level']))
+        logger.critical("Starting openmano server command: '%s'", sys.argv[0])
         
         # Initialize DB connection
         mydb = nfvo_db.nfvo_db(log_level=global_config["log_level_db"]);