Allow ovim parameters at config file. Fix an issue at network deletion

Change-Id: I1b3d5e0e024e776aa763cb50db3189e584120434
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
diff --git a/nfvo.py b/nfvo.py
index 724766b..3ea5107 100644
--- a/nfvo.py
+++ b/nfvo.py
@@ -43,7 +43,7 @@
 import nfvo_db
 from threading import Lock
 from time import time
-import openvim.ovim as Ovim
+import ovim as ovim_module
 
 global global_config
 global vimconn_imported
@@ -115,23 +115,20 @@
     # TODO: Avoid static configuration by adding new parameters to openmanod.cfg
     # TODO: review ovim.py to delete not needed configuration
     ovim_configuration = {
-        'logger_name': 'openvim',
+        'logger_name': 'openmano.ovim',
         'network_vlan_range_start': 1000,
         'network_vlan_range_end': 4096,
-        'log_level_db': 'DEBUG',
-        'db_name': 'mano_vim_db',
-        'db_host': 'localhost',
-        'db_user': 'vim',
-        'db_passwd': 'vimpw',
-        'database_version': '0.15',
+        'db_name': global_config["db_ovim_name"],
+        'db_host': global_config["db_ovim_host"],
+        'db_user': global_config["db_ovim_user"],
+        'db_passwd': global_config["db_ovim_passwd"],
         'bridge_ifaces': {},
         'mode': 'normal',
-        'of_controller_nets_with_same_vlan': True,
         'network_type': 'bridge',
         #TODO: log_level_of should not be needed. To be modified in ovim
         'log_level_of': 'DEBUG'
     }
-    ovim = Ovim.ovim(ovim_configuration)
+    ovim = ovim_module.ovim(ovim_configuration)
     ovim.start_service()
 
     from_= 'tenants_datacenters as td join datacenters as d on td.datacenter_id=d.uuid join datacenter_tenants as dt on td.datacenter_tenant_id=dt.uuid'
@@ -3260,4 +3257,4 @@
     return result
 
 def datacenter_sdn_port_mapping_delete(mydb, tenant_id, datacenter_id):
-    return ovim.clear_of_port_mapping(db_filter={"region":datacenter_id})
\ No newline at end of file
+    return ovim.clear_of_port_mapping(db_filter={"region":datacenter_id})