X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=openmanod.py;h=69e6755b8f3ef66e615ec4fa7b71815f604f29f4;hb=3ae39742402e1cf92cffc98a72a84bc8dac0de24;hp=dbd7737e8f8d6a6a4b8f5fbed13708d9b111d6b3;hpb=205d102de8f7d0bc69aacd323ef2386e71276da6;p=osm%2FRO.git diff --git a/openmanod.py b/openmanod.py index dbd7737e..69e6755b 100755 --- a/openmanod.py +++ b/openmanod.py @@ -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"]);