'Create OVS ports associated to the logical subports.'

def wire_subports_for_trunk(self, context, trunk_id, subports, trunk_bridge=None, parent_port=None):

    subport_bindings = self.trunk_rpc.update_subport_bindings(context, subports)
    subport_bindings = subport_bindings.get(trunk_id, [])
    subports_mac = {p['id']: p['mac_address'] for p in subport_bindings}
    subport_ids = []
    for subport in subports:
        try:
            self.trunk_manager.add_sub_port(trunk_id, subport.port_id, subports_mac[subport.port_id], subport.segmentation_id)
        except tman.TrunkManagerError as te:
            LOG.error(_LE('Failed    to    add    subport    with    port    ID    %(subport_port_id)s    to    trunk    with    ID    %(trunk_id)s:    %(err)s'), {'subport_port_id': subport.port_id, 'trunk_id': trunk_id, 'err': te})
        else:
            subport_ids.append(subport.port_id)
    try:
        self._update_trunk_metadata(trunk_bridge, parent_port, trunk_id, subport_ids)
    except (RuntimeError, exceptions.ParentPortNotFound) as e:
        LOG.error(_LE('Failed    to    store    metadata    for    trunk    %(trunk_id)s:    %(reason)s'), {'trunk_id': trunk_id, 'reason': e})
        return constants.DEGRADED_STATUS
    LOG.debug('Added    trunk:    %s', trunk_id)
    return self._get_current_status(subports, subport_ids)
