Change-Id: I69414b3f0d1073d9d88fdea22daa7a2ce9fa77d8
Signed-off-by: tierno <alfonso.tiernosepulveda@telefonica.com>
__author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes"
__date__ = "$26-aug-2014 11:09:29$"
__author__ = "Alfonso Tierno, Gerardo Garcia, Pablo Montes"
__date__ = "$26-aug-2014 11:09:29$"
-__version__ = "0.5.66-r576"
+__version__ = "0.5.67-r577"
version_date = "May 2018"
database_version = 31 # expected database schema version
version_date = "May 2018"
database_version = 31 # expected database schema version
def get_vim(mydb, nfvo_tenant=None, datacenter_id=None, datacenter_name=None, datacenter_tenant_id=None,
def get_vim(mydb, nfvo_tenant=None, datacenter_id=None, datacenter_name=None, datacenter_tenant_id=None,
- vim_tenant=None, vim_tenant_name=None, vim_user=None, vim_passwd=None):
+ vim_tenant=None, vim_tenant_name=None, vim_user=None, vim_passwd=None, ignore_errors=False):
'''Obtain a dictionary of VIM (datacenter) classes with some of the input parameters
return dictionary with {datacenter_id: vim_class, ... }. vim_class contain:
'nfvo_tenant_id','datacenter_id','vim_tenant_id','vim_url','vim_url_admin','datacenter_name','type','user','passwd'
'''Obtain a dictionary of VIM (datacenter) classes with some of the input parameters
return dictionary with {datacenter_id: vim_class, ... }. vim_class contain:
'nfvo_tenant_id','datacenter_id','vim_tenant_id','vim_url','vim_url_admin','datacenter_name','type','user','passwd'
except (IOError, ImportError) as e:
# if module_info and module_info[0]:
# file.close(module_info[0])
except (IOError, ImportError) as e:
# if module_info and module_info[0]:
# file.close(module_info[0])
+ if ignore_errors:
+ logger.error("Unknown vim type '{}'. Can not open file '{}.py'; {}: {}".format(
+ vim["type"], module, type(e).__name__, str(e)))
+ continue
raise NfvoException("Unknown vim type '{}'. Can not open file '{}.py'; {}: {}".format(
vim["type"], module, type(e).__name__, str(e)), HTTP_Bad_Request)
raise NfvoException("Unknown vim type '{}'. Can not open file '{}.py'; {}: {}".format(
vim["type"], module, type(e).__name__, str(e)), HTTP_Bad_Request)
config=extra, persistent_info=persistent_info
)
except Exception as e:
config=extra, persistent_info=persistent_info
)
except Exception as e:
+ if ignore_errors:
+ logger.error("Error at VIM {}; {}: {}".format(vim["type"], type(e).__name__, str(e)))
+ continue
http_code = HTTP_Internal_Server_Error
if isinstance(e, vimconn.vimconnException):
http_code = e.http_code
http_code = HTTP_Internal_Server_Error
if isinstance(e, vimconn.vimconnException):
http_code = e.http_code
vnf_descriptor['vnf']['tenant_id'] = tenant_id
# Step 3. Get the URL of the VIM from the nfvo_tenant and the datacenter
if global_config["auto_push_VNF_to_VIMs"]:
vnf_descriptor['vnf']['tenant_id'] = tenant_id
# Step 3. Get the URL of the VIM from the nfvo_tenant and the datacenter
if global_config["auto_push_VNF_to_VIMs"]:
- vims = get_vim(mydb, tenant_id)
+ vims = get_vim(mydb, tenant_id, ignore_errors=True)
# Step 4. Review the descriptor and add missing fields
#print vnf_descriptor
# Step 4. Review the descriptor and add missing fields
#print vnf_descriptor
vnf_descriptor['vnf']['tenant_id'] = tenant_id
# Step 3. Get the URL of the VIM from the nfvo_tenant and the datacenter
if global_config["auto_push_VNF_to_VIMs"]:
vnf_descriptor['vnf']['tenant_id'] = tenant_id
# Step 3. Get the URL of the VIM from the nfvo_tenant and the datacenter
if global_config["auto_push_VNF_to_VIMs"]:
- vims = get_vim(mydb, tenant_id)
+ vims = get_vim(mydb, tenant_id, ignore_errors=True)
# Step 4. Review the descriptor and add missing fields
#print vnf_descriptor
# Step 4. Review the descriptor and add missing fields
#print vnf_descriptor
if tenant_id != "any":
check_tenant(mydb, tenant_id)
# Get the URL of the VIM from the nfvo_tenant and the datacenter
if tenant_id != "any":
check_tenant(mydb, tenant_id)
# Get the URL of the VIM from the nfvo_tenant and the datacenter
- vims = get_vim(mydb, tenant_id)
+ vims = get_vim(mydb, tenant_id, ignore_errors=True)
#log_file: /var/log/openmano/openmano.log
#individual logging settings
#log_file: /var/log/openmano/openmano.log
#individual logging settings
-#log_level_db: DEBUG #database log levels
+log_level_db: ERROR #database log levels
#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_db: /opt/openmano/logs/openmano_db.log
#log_level_vim: DEBUG #VIM connection log levels
#log_file_vim: /opt/openmano/logs/openmano_vimconn.log