freeipa/ipaserver/plugins/session.py
Jan Cholasta ffadcb0414 logging: remove object-specific loggers
Remove all object-specific loggers, with the exception of `Plugin.log`,
which is now deprecated. Replace affected logger calls with module-level
logger calls.

Deprecate object-specific loggers in `ipa_log_manager.get_logger`.

Reviewed-By: Martin Basti <mbasti@redhat.com>
2017-07-14 15:55:59 +02:00

33 lines
755 B
Python

#
# Copyright (C) 2015 FreeIPA Contributors see COPYING for license
#
import logging
from ipalib import Command
from ipalib.request import context
from ipalib.plugable import Registry
logger = logging.getLogger(__name__)
register = Registry()
@register()
class session_logout(Command):
'''
RPC command used to log the current user out of their session.
'''
NO_CLI = True
def execute(self, *args, **options):
ccache_name = getattr(context, 'ccache_name', None)
if ccache_name is None:
logger.debug('session logout command: no ccache_name found')
else:
delattr(context, 'ccache_name')
setattr(context, 'logout_cookie', 'MagBearerToken=')
return dict(result=None)