'''
__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.46-r485"
+version_date="Aug 2016"
+database_version="0.12" #expected database schema version
import httpserver
import time
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',
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:
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"]);