Modernize function and method attribute names

Python 3 uses double-underscored names for internal function attributes.
In Python 2.7, these names exist as aliases to the old 'func_*' and
'im_*' names.

Reviewed-By: Tomas Babej <tbabej@redhat.com>
This commit is contained in:
Petr Viktorin
2015-07-30 17:03:06 +02:00
committed by Tomas Babej
parent 27dabb4528
commit 8b88caa110
6 changed files with 9 additions and 9 deletions

View File

@@ -3682,7 +3682,7 @@ class dnsrecord_add(LDAPCreate):
return dn
def exc_callback(self, keys, options, exc, call_func, *call_args, **call_kwargs):
if call_func.func_name == 'add_entry':
if call_func.__name__ == 'add_entry':
if isinstance(exc, errors.DuplicateEntry):
# A new record is being added to existing LDAP DNS object
# Update can be safely run as old record values has been

View File

@@ -397,7 +397,7 @@ class group_mod(LDAPUpdate):
def exc_callback(self, keys, options, exc, call_func, *call_args, **call_kwargs):
# Check again for GID requirement in case someone tried to clear it
# using --setattr.
if call_func.func_name == 'update_entry':
if call_func.__name__ == 'update_entry':
if isinstance(exc, errors.ObjectclassViolation):
if 'gidNumber' in exc.message and 'posixGroup' in exc.message:
raise errors.RequirementError(name='gid')

View File

@@ -1194,7 +1194,7 @@ class permission_mod(baseldap.LDAPUpdate):
return dn
def exc_callback(self, keys, options, exc, call_func, *call_args, **call_kwargs):
if call_func.func_name == 'update_entry':
if call_func.__name__ == 'update_entry':
self._revert_aci()
raise exc

View File

@@ -506,7 +506,7 @@ class pwpolicy_mod(LDAPUpdate):
return dn
def exc_callback(self, keys, options, exc, call_func, *call_args, **call_kwargs):
if call_func.func_name == 'update_entry':
if call_func.__name__ == 'update_entry':
if isinstance(exc, errors.EmptyModlist):
entry_attrs = call_args[0]
cosupdate = getattr(context, 'cosupdate')