def _check_user_entry(user):
    """Fixes wrong format of users."""
    if 'tenant_name' in user:
        keys = set(user.keys())
        if keys == {'username', 'password', 'tenant_name',
            'project_domain_name', 'user_domain_name'}:
            if user['user_domain_name'] == '' and user['project_domain_name'
                ] == '':
                del user['user_domain_name']
                del user['project_domain_name']
                return True
            else:
                user['project_name'] = user.pop('tenant_name')
                return True
