if self.vim_account['_admin']['projects_read']:
vim_project_id = self.vim_account['_admin']['projects_read'][0]
else:
- vim_project_id = None
+ vim_project_id = ''
vim_tags = {
'vim_account_id': self.vim_account['_id'],
'project_id': vim_project_id
if vnfr['_admin']['projects_read']:
vnfr_project_id = vnfr['_admin']['projects_read'][0]
else:
- vnfr_project_id = None
+ vnfr_project_id = ''
for vdur in vnfr['vdur']:
if 'vim-id' not in vdur:
log.debug("Field vim-id is not present in vdur")
if self.sdnc['_admin']['projects_read']:
sdnc_project_id = self.sdnc['_admin']['projects_read'][0]
else:
- sdnc_project_id = None
+ sdnc_project_id = ''
sdnc_tags = {
'sdnc_id': self.sdnc['_id'],
'project_id': sdnc_project_id
vim_account['vim_url'] = vim_account_info['vim_url']
vim_account['org_user'] = vim_account_info['vim_user']
vim_account['vim_uuid'] = vim_account_info['_id']
- vim_account['project_id'] = vim_account_info['_admin']['projects_read'][0]
+ if vim_account_info['_admin']['projects_read']:
+ vim_account['project_id'] = vim_account_info['_admin']['projects_read'][0]
+ else:
+ vim_account['project_id'] = ''
vim_config = vim_account_info['config']
vim_account['admin_username'] = vim_config['admin_username']
nsr_id = vnfr['nsr-id-ref']
ns_name = self.common_db.get_nsr(nsr_id)['name']
vnf_member_index = vnfr['member-vnf-index-ref']
- vnfr_project_id = vnfr['_admin']['projects_read'][0]
+ if vnfr['_admin']['projects_read']:
+ vnfr_project_id = vnfr['_admin']['projects_read'][0]
+ else:
+ vnfr_project_id = ''
for vdur in vnfr['vdur']:
resource_uuid = vdur['vim-id']
tags = {
if vnfr['_admin']['projects_read']:
tags['project_id'] = vnfr['_admin']['projects_read'][0]
else:
- tags['project_id'] = None
+ tags['project_id'] = ''
metrics = []
for vdur in vnfr['vdur']:
if vnfr['_admin']['projects_read']:
tags['project_id'] = vnfr['_admin']['projects_read'][0]
else:
- tags['project_id'] = None
+ tags['project_id'] = ''
metrics = []
for vdur in vnfr['vdur']:
if vnfr['_admin']['projects_read']:
tags['project_id'] = vnfr['_admin']['projects_read'][0]
else:
- tags['project_id'] = None
+ tags['project_id'] = ''
# Fetch the list of all known resources from vROPS.
resource_list = self.vrops.get_vm_resource_list_from_vrops()
if vnfr['_admin']['projects_read']:
tags['project_id'] = vnfr['_admin']['projects_read'][0]
else:
- tags['project_id'] = None
+ tags['project_id'] = ''
# Fetch the list of all known resources from vROPS.
resource_list = self.vrops.get_vm_resource_list_from_vrops()