'Create a new trust.
:returns: a new trust'

def create_trust(self, trust_id, trust, roles, redelegated_trust=None, initiator=None):

    max_redelegation_count = CONF.trust.max_redelegation_count
    requested_count = trust.get('redelegation_count')
    redelegatable = (trust.pop('allow_redelegation', False) and (requested_count != 0))
    if (not redelegatable):
        trust['redelegation_count'] = requested_count = 0
        remaining_uses = trust.get('remaining_uses')
        if ((remaining_uses is not None) and (remaining_uses <= 0)):
            msg = _('remaining_uses    must    be    a    positive    integer    or    null.')
            raise exception.ValidationError(msg)
    else:
        if (requested_count and (requested_count > max_redelegation_count)):
            raise exception.Forbidden((_('Requested    redelegation    depth    of    %(requested_count)d    is    greater    than    allowed    %(max_count)d') % {'requested_count': requested_count, 'max_count': max_redelegation_count}))
        if (trust.get('remaining_uses') is not None):
            raise exception.ValidationError(_('remaining_uses    must    not    be    set    if    redelegation    is    allowed'))
    if redelegated_trust:
        trust['redelegated_trust_id'] = redelegated_trust['id']
        remaining_count = (redelegated_trust['redelegation_count'] - 1)
        if (redelegatable and requested_count and (requested_count != remaining_count)):
            msg = _('Modifying    "redelegation_count"    upon    redelegation    is    forbidden.    Omitting    this    parameter    is    advised.')
            raise exception.Forbidden(msg)
        trust.setdefault('redelegation_count', remaining_count)
        pedigree = self.get_trust_pedigree(redelegated_trust['id'])
        for t in pedigree:
            self._validate_redelegation(t, trust)
    trust.setdefault('redelegation_count', max_redelegation_count)
    ref = self.driver.create_trust(trust_id, trust, roles)
    notifications.Audit.created(self._TRUST, trust_id, initiator=initiator)
    return ref
