class db_base():
tables_with_created_field=()
- def __init__(self, host=None, user=None, passwd=None, database=None, log_name='db', log_level="ERROR"):
+ def __init__(self, host=None, user=None, passwd=None, database=None, log_name='db', log_level=None):
self.host = host
self.user = user
self.passwd = passwd
self.con = None
self.log_level=log_level
self.logger = logging.getLogger(log_name)
- self.logger.setLevel( getattr(logging, log_level) )
+ if self.log_level:
+ self.logger.setLevel( getattr(logging, log_level) )
def connect(self, host=None, user=None, passwd=None, database=None):
'''Connect to specific data base.
"sce_vnfs","tenants_datacenters","datacenter_tenants","vms","vnfs", "datacenter_nets"]
class nfvo_db(db_base.db_base):
- def __init__(self, host=None, user=None, passwd=None, database=None, log_name='openmano.db', log_level="ERROR"):
+ def __init__(self, host=None, user=None, passwd=None, database=None, log_name='openmano.db', log_level=None):
db_base.db_base.__init__(self, host, user, passwd, database, log_name, log_level)
db_base.db_base.tables_with_created_field=tables_with_createdat_field
return
#vnf_repository: "./vnfrepo" # Use an absolute path to avoid misunderstandings
-#logging parameters for internal file stororage
+#general logging parameters
#choose among: DEBUG, INFO, WARNING, ERROR, CRITICAL
log_level: DEBUG #general log levels for internal logging
#standard output is used unless 'log_file' is specify
#log_file: /var/log/openmano/openmano.log
-#individual loggin settings
+#individual logging settings
#log_level_db: DEBUG #database log levels
-log_file_db: /opt/openmano/logs/openmano_db.log
+#log_file_db: /opt/openmano/logs/openmano_db.log
#log_level_vim: DEBUG #VIM connection log levels
-log_file_vim: /opt/openmano/logs/openmano_vimconn.log
+#log_file_vim: /opt/openmano/logs/openmano_vimconn.log
#log_level_nfvo: DEBUG #Main engine log levels
-log_file_nfvo: /opt/openmano/logs/openmano_nfvo.log
+#log_file_nfvo: /opt/openmano/logs/openmano_nfvo.log
#log_level_http: DEBUG #Main engine log levels
-log_file_http: /opt/openmano/logs/openmano_http.log
+#log_file_http: /opt/openmano/logs/openmano_http.log
#Uncomment to send logs via IP to an external host
#log_socket_host: localhost
'''
__author__="Alfonso Tierno, Gerardo Garcia, Pablo Montes"
__date__ ="$26-aug-2014 11:09:29$"
-__version__="0.4.55-r497"
+__version__="0.4.56-r498"
version_date="Sep 2016"
database_version="0.13" #expected database schema version
'http_console_proxy': True,
'http_console_host': None,
'log_level': 'DEBUG',
- 'log_level_db': 'ERROR',
- 'log_level_vimconn': 'DEBUG',
- 'log_level_nfvo': 'DEBUG',
'log_socket_port': 9022,
}
try:
#nfvo.logger = global_config["logger_nfvo"]
# Initialize DB connection
- mydb = nfvo_db.nfvo_db(log_level=global_config["log_level_db"]);
+ mydb = nfvo_db.nfvo_db();
if mydb.connect(global_config['db_host'], global_config['db_user'], global_config['db_passwd'], global_config['db_name']) == -1:
logger.critical("Cannot connect to database %s at %s@%s", global_config['db_name'], global_config['db_user'], global_config['db_host'])
exit(-1)