summaryrefslogtreecommitdiffstats
path: root/ipalib/session.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2015-07-30 17:29:39 +0200
committerTomas Babej <tbabej@redhat.com>2015-08-12 18:17:23 +0200
commit6a741b51dac6efd650f2427604bd54cbf300f761 (patch)
tree2a1ebde55d64a6e2f3c33d1cc8c1ce64f73570f7 /ipalib/session.py
parent8b88caa110e83b42b1e43189c06b6cb3de712353 (diff)
downloadfreeipa-6a741b51dac6efd650f2427604bd54cbf300f761.tar.gz
freeipa-6a741b51dac6efd650f2427604bd54cbf300f761.tar.xz
freeipa-6a741b51dac6efd650f2427604bd54cbf300f761.zip
Replace dict.has_key with the 'in' operator
The deprecated has_key method will be removed from dicts in Python 3. For custom dict-like classes, has_key() is kept on Python 2, but disabled for Python 3. Reviewed-By: Tomas Babej <tbabej@redhat.com>
Diffstat (limited to 'ipalib/session.py')
-rw-r--r--ipalib/session.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/ipalib/session.py b/ipalib/session.py
index a124fe027..d7c6ce828 100644
--- a/ipalib/session.py
+++ b/ipalib/session.py
@@ -692,7 +692,7 @@ class SessionAuthManager(object):
def unregister(self, name):
self.debug('SessionAuthManager.unregister: name=%s', name)
- if not self.auth_managers.has_key(name):
+ if name not in self.auth_managers:
raise KeyError('cannot unregister auth manager named "%s", does not exist',
name)
del self.auth_managers[name]
@@ -1259,7 +1259,7 @@ def release_ipa_ccache(ccache_name):
do we'll remove them.
'''
- if os.environ.has_key('KRB5CCNAME'):
+ if 'KRB5CCNAME' in os.environ:
if ccache_name != os.environ['KRB5CCNAME']:
root_logger.error('release_ipa_ccache: ccache_name (%s) != KRB5CCNAME environment variable (%s)',
ccache_name, os.environ['KRB5CCNAME'])