mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
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>
This commit is contained in:
committed by
Tomas Babej
parent
8b88caa110
commit
6a741b51da
@@ -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'])
|
||||
|
||||
Reference in New Issue
Block a user