@staticmethod
def get_mgmt_vdu(vnfd: dict):
- if 'cp' in vnfd['mgmt-interface']:
- for vdu in vnfd['vdu']:
- for interface in vdu['interface']:
- if 'external-connection-point-ref' in interface:
- if interface['external-connection-point-ref'] == vnfd['mgmt-interface']['cp']:
- return vdu
- elif 'vdu-id' in vnfd['mgmt-interface']:
- for vdu in vnfd['vdu']:
- if vdu['id'] == vnfd['mgmt-interface']['vdu-id']:
+ if 'mgmt-cp' in vnfd:
+ mgmt_cp = vnfd['mgmt-cp']
+ mgmt_cp_vdu_id = None
+ for cpd in vnfd.get('ext-cpd', ()):
+ if cpd.get('id') == mgmt_cp:
+ mgmt_cp_vdu_id = cpd.get('int-cpd', {}).get('vdu-id')
+ for vdu in vnfd.get('vdu', ()):
+ if vdu.get('id') == mgmt_cp_vdu_id:
return vdu
- raise ManagementVduNotFound("Management vdu not founr in vnfd %s", vnfd['id'])
+ raise ManagementVduNotFound("Management vdu not found in vnfd %s", vnfd['id'])