def tenant_absent(name, profile=None, **connection_args):
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Tenant "{0}" is already absent'.format(name)}

    # Check if tenant is present
    tenant = __salt__['keystone.tenant_get'](name=name,
                                             profile=profile,
                                             **connection_args)
    if 'Error' not in tenant:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'Tenant "{0}" will be deleted'.format(name)
            ret['changes']['Tenant'] = 'Will be deleted'
            return ret
        # Delete tenant
        __salt__['keystone.tenant_delete'](name=name, profile=profile,
                                           **connection_args)
        ret['comment'] = 'Tenant "{0}" has been deleted'.format(name)
        ret['changes']['Tenant'] = 'Deleted'

    return ret
Ensure that the keystone tenant is absent.
dataset/ETHPy150Open saltstack/salt/salt/states/keystone.py/tenant_absent