mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
Enable pylint unnecessary-pass check
Enables check and removes extra pass statement from code. Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
ded70b6c6e
commit
00fd28e026
@ -472,7 +472,6 @@ class automountlocation_import(LDAPQuery):
|
|||||||
pass
|
pass
|
||||||
elif options.get('continue', False):
|
elif options.get('continue', False):
|
||||||
result['duplicatekeys'].append(am[0])
|
result['duplicatekeys'].append(am[0])
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
raise errors.DuplicateEntry(
|
raise errors.DuplicateEntry(
|
||||||
message=_('key %(key)s already exists') % dict(
|
message=_('key %(key)s already exists') % dict(
|
||||||
@ -488,7 +487,6 @@ class automountlocation_import(LDAPQuery):
|
|||||||
pass
|
pass
|
||||||
elif options.get('continue', False):
|
elif options.get('continue', False):
|
||||||
result['duplicatemaps'].append(am[0])
|
result['duplicatemaps'].append(am[0])
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
raise errors.DuplicateEntry(
|
raise errors.DuplicateEntry(
|
||||||
message=_('map %(map)s already exists') % dict(
|
message=_('map %(map)s already exists') % dict(
|
||||||
@ -531,7 +529,6 @@ class automountlocation_import(LDAPQuery):
|
|||||||
except errors.DuplicateEntry as e:
|
except errors.DuplicateEntry as e:
|
||||||
if options.get('continue', False):
|
if options.get('continue', False):
|
||||||
result['duplicatekeys'].append(am[0])
|
result['duplicatekeys'].append(am[0])
|
||||||
pass
|
|
||||||
else:
|
else:
|
||||||
raise e
|
raise e
|
||||||
|
|
||||||
|
@ -569,7 +569,6 @@ class stageuser_activate(LDAPQuery):
|
|||||||
self.log.debug("merge: %s:%r wiped" % (attr, v))
|
self.log.debug("merge: %s:%r wiped" % (attr, v))
|
||||||
except:
|
except:
|
||||||
self.log.debug("merge %s: [no_print %s]" % (attr, v.__class__.__name__))
|
self.log.debug("merge %s: [no_print %s]" % (attr, v.__class__.__name__))
|
||||||
pass
|
|
||||||
if isinstance(entry_to[attr], (list, tuple)):
|
if isinstance(entry_to[attr], (list, tuple)):
|
||||||
# multi value attribute
|
# multi value attribute
|
||||||
if v not in entry_to[attr]:
|
if v not in entry_to[attr]:
|
||||||
@ -586,7 +585,7 @@ class stageuser_activate(LDAPQuery):
|
|||||||
self.log.debug("Add: %s:%r" % (attr, v))
|
self.log.debug("Add: %s:%r" % (attr, v))
|
||||||
except:
|
except:
|
||||||
self.log.debug("Add %s: [no_print %s]" % (attr, v.__class__.__name__))
|
self.log.debug("Add %s: [no_print %s]" % (attr, v.__class__.__name__))
|
||||||
pass
|
|
||||||
if isinstance(entry_to[attr], (list, tuple)):
|
if isinstance(entry_to[attr], (list, tuple)):
|
||||||
# multi value attribute
|
# multi value attribute
|
||||||
if attr.lower() == 'objectclass':
|
if attr.lower() == 'objectclass':
|
||||||
@ -697,7 +696,6 @@ class stageuser_activate(LDAPQuery):
|
|||||||
self._exc_wrapper(args, options, ldap.delete_entry)(active_dn)
|
self._exc_wrapper(args, options, ldap.delete_entry)(active_dn)
|
||||||
except:
|
except:
|
||||||
self.log.error("Fail to cleanup activation. The user remains active %s" % (active_dn))
|
self.log.error("Fail to cleanup activation. The user remains active %s" % (active_dn))
|
||||||
pass
|
|
||||||
raise
|
raise
|
||||||
|
|
||||||
# add the user we just created into the default primary group
|
# add the user we just created into the default primary group
|
||||||
|
@ -1066,7 +1066,6 @@ class user_status(LDAPQuery):
|
|||||||
except errors.NotFound:
|
except errors.NotFound:
|
||||||
# If this happens we have some pretty serious problems
|
# If this happens we have some pretty serious problems
|
||||||
self.error('No IPA masters found!')
|
self.error('No IPA masters found!')
|
||||||
pass
|
|
||||||
|
|
||||||
entries = []
|
entries = []
|
||||||
count = 0
|
count = 0
|
||||||
@ -1100,7 +1099,6 @@ class user_status(LDAPQuery):
|
|||||||
newresult[attr][0] = unicode(time.strftime('%Y-%m-%dT%H:%M:%SZ', newtime))
|
newresult[attr][0] = unicode(time.strftime('%Y-%m-%dT%H:%M:%SZ', newtime))
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.debug("time conversion failed with %s" % str(e))
|
self.debug("time conversion failed with %s" % str(e))
|
||||||
pass
|
|
||||||
newresult['server'] = host
|
newresult['server'] = host
|
||||||
if options.get('raw', False):
|
if options.get('raw', False):
|
||||||
time_format = '%Y%m%d%H%M%SZ'
|
time_format = '%Y%m%d%H%M%SZ'
|
||||||
|
@ -1104,7 +1104,7 @@ class TrustDomainInstance(object):
|
|||||||
self._pipe.SetInformationTrustedDomain(trustdom_handle, lsa.LSA_TRUSTED_DOMAIN_INFO_INFO_EX, info)
|
self._pipe.SetInformationTrustedDomain(trustdom_handle, lsa.LSA_TRUSTED_DOMAIN_INFO_INFO_EX, info)
|
||||||
except RuntimeError as e:
|
except RuntimeError as e:
|
||||||
root_logger.error('unable to set trust to transitive: %s' % (str(e)))
|
root_logger.error('unable to set trust to transitive: %s' % (str(e)))
|
||||||
pass
|
|
||||||
if self.info['is_pdc']:
|
if self.info['is_pdc']:
|
||||||
self.update_ftinfo(another_domain)
|
self.update_ftinfo(another_domain)
|
||||||
|
|
||||||
|
@ -1240,7 +1240,6 @@ class BindInstance(service.Service):
|
|||||||
self.fstore.restore_file(f)
|
self.fstore.restore_file(f)
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
root_logger.debug(error)
|
root_logger.debug(error)
|
||||||
pass
|
|
||||||
|
|
||||||
# disabled by default, by ldap_enable()
|
# disabled by default, by ldap_enable()
|
||||||
if enabled:
|
if enabled:
|
||||||
|
@ -491,7 +491,6 @@ class DNSKeySyncInstance(service.Service):
|
|||||||
self.fstore.restore_file(f)
|
self.fstore.restore_file(f)
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
self.logger.debug(error)
|
self.logger.debug(error)
|
||||||
pass
|
|
||||||
|
|
||||||
# remove softhsm pin, to make sure new installation will generate
|
# remove softhsm pin, to make sure new installation will generate
|
||||||
# new token database
|
# new token database
|
||||||
|
@ -922,7 +922,6 @@ class DsInstance(service.Service):
|
|||||||
self.fstore.restore_file(paths.SYSCONFIG_DIRSRV)
|
self.fstore.restore_file(paths.SYSCONFIG_DIRSRV)
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
root_logger.debug(error)
|
root_logger.debug(error)
|
||||||
pass
|
|
||||||
|
|
||||||
# disabled during IPA installation
|
# disabled during IPA installation
|
||||||
if enabled:
|
if enabled:
|
||||||
|
@ -503,7 +503,6 @@ class HTTPInstance(service.Service):
|
|||||||
self.fstore.restore_file(f)
|
self.fstore.restore_file(f)
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
root_logger.debug(error)
|
root_logger.debug(error)
|
||||||
pass
|
|
||||||
|
|
||||||
installutils.remove_keytab(paths.IPA_KEYTAB)
|
installutils.remove_keytab(paths.IPA_KEYTAB)
|
||||||
installutils.remove_ccache(ccache_path=paths.KRB5CC_HTTPD,
|
installutils.remove_ccache(ccache_path=paths.KRB5CC_HTTPD,
|
||||||
|
@ -394,7 +394,6 @@ class KrbInstance(service.Service):
|
|||||||
self.fstore.restore_file(f)
|
self.fstore.restore_file(f)
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
root_logger.debug(error)
|
root_logger.debug(error)
|
||||||
pass
|
|
||||||
|
|
||||||
# disabled by default, by ldap_enable()
|
# disabled by default, by ldap_enable()
|
||||||
if enabled:
|
if enabled:
|
||||||
|
@ -178,7 +178,6 @@ class NTPInstance(service.Service):
|
|||||||
self.fstore.restore_file(paths.NTP_CONF)
|
self.fstore.restore_file(paths.NTP_CONF)
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
root_logger.debug(error)
|
root_logger.debug(error)
|
||||||
pass
|
|
||||||
|
|
||||||
if enabled:
|
if enabled:
|
||||||
self.enable()
|
self.enable()
|
||||||
|
@ -376,7 +376,6 @@ class OpenDNSSECInstance(service.Service):
|
|||||||
self.fstore.restore_file(f)
|
self.fstore.restore_file(f)
|
||||||
except ValueError as error:
|
except ValueError as error:
|
||||||
root_logger.debug(error)
|
root_logger.debug(error)
|
||||||
pass
|
|
||||||
|
|
||||||
self.restore_state("KASP_DB_configured") # just eat state
|
self.restore_state("KASP_DB_configured") # just eat state
|
||||||
|
|
||||||
|
@ -407,7 +407,6 @@ class ReplicationManager(object):
|
|||||||
conn.add_entry(ent)
|
conn.add_entry(ent)
|
||||||
except errors.DuplicateEntry:
|
except errors.DuplicateEntry:
|
||||||
conn.modify_s(dn, [(ldap.MOD_REPLACE, "userpassword", pw)])
|
conn.modify_s(dn, [(ldap.MOD_REPLACE, "userpassword", pw)])
|
||||||
pass
|
|
||||||
|
|
||||||
def delete_replication_manager(self, conn, dn=REPL_MAN_DN):
|
def delete_replication_manager(self, conn, dn=REPL_MAN_DN):
|
||||||
assert isinstance(dn, DN)
|
assert isinstance(dn, DN)
|
||||||
|
@ -301,7 +301,6 @@ class Declarative(XMLRPC_test):
|
|||||||
api.Command[cmd](*args, **options)
|
api.Command[cmd](*args, **options)
|
||||||
except (errors.NotFound, errors.EmptyModlist) as e:
|
except (errors.NotFound, errors.EmptyModlist) as e:
|
||||||
print(e)
|
print(e)
|
||||||
pass
|
|
||||||
|
|
||||||
def test_command(self, index, declarative_test_definition):
|
def test_command(self, index, declarative_test_definition):
|
||||||
"""Run an individual test
|
"""Run an individual test
|
||||||
|
@ -275,7 +275,6 @@ def main():
|
|||||||
linter.set_option('disable', 'super-init-not-called')
|
linter.set_option('disable', 'super-init-not-called')
|
||||||
linter.set_option('disable', 'undefined-loop-variable')
|
linter.set_option('disable', 'undefined-loop-variable')
|
||||||
linter.set_option('disable', 'unnecessary-lambda')
|
linter.set_option('disable', 'unnecessary-lambda')
|
||||||
linter.set_option('disable', 'unnecessary-pass')
|
|
||||||
linter.set_option('disable', 'unnecessary-semicolon')
|
linter.set_option('disable', 'unnecessary-semicolon')
|
||||||
linter.set_option('disable', 'unused-argument')
|
linter.set_option('disable', 'unused-argument')
|
||||||
linter.set_option('disable', 'unused-variable')
|
linter.set_option('disable', 'unused-variable')
|
||||||
|
Loading…
Reference in New Issue
Block a user