def tenant_present(name, description=None, enabled=True, profile=None,
                   **connection_args):
    ret = {'name': name,
           'changes': {},
           'result': True,
           'comment': 'Tenant "{0}" already exists'.format(name)}

    # Check if tenant is already present
    tenant = __salt__['keystone.tenant_get'](name=name,
                                             profile=profile,
                                             **connection_args)

    if 'Error' not in tenant:
        if tenant[name]['description'] != description:
            if __opts__['test']:
                ret['result'] = None
                ret['comment'] = 'Tenant "{0}" will be updated'.format(name)
                ret['changes']['Description'] = 'Will be updated'
                return ret
            __salt__['keystone.tenant_update'](name=name,
                                               description=description,
                                               enabled=enabled,
                                               profile=profile,
                                               **connection_args)
            ret['comment'] = 'Tenant "{0}" has been updated'.format(name)
            ret['changes']['Description'] = 'Updated'
        if tenant[name]['enabled'] != enabled:
            if __opts__['test']:
                ret['result'] = None
                ret['comment'] = 'Tenant "{0}" will be updated'.format(name)
                ret['changes']['Enabled'] = 'Will be {0}'.format(enabled)
                return ret
            __salt__['keystone.tenant_update'](name=name,
                                               description=description,
                                               enabled=enabled,
                                               profile=profile,
                                               **connection_args)
            ret['comment'] = 'Tenant "{0}" has been updated'.format(name)
            ret['changes']['Enabled'] = 'Now {0}'.format(enabled)
    else:
        if __opts__['test']:
            ret['result'] = None
            ret['comment'] = 'Tenant "{0}" will be added'.format(name)
            ret['changes']['Tenant'] = 'Will be created'
            return ret
        # Create tenant
        __salt__['keystone.tenant_create'](name, description, enabled,
                                           profile=profile,
                                           **connection_args)
        ret['comment'] = 'Tenant "{0}" has been added'.format(name)
        ret['changes']['Tenant'] = 'Created'
    return ret
Manually overwrite the superclass method.
dataset/ETHPy150Open saltstack/salt/salt/states/keystone.py/tenant_present--crossover with--dataset/ETHPy150Open oppia/oppia/core/storage/file/gae_models.py/FileModel._reconstitute