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:
Martin Basti 2015-12-17 01:29:29 +01:00 committed by Jan Cholasta
parent ded70b6c6e
commit 00fd28e026
14 changed files with 2 additions and 19 deletions

View File

@ -472,7 +472,6 @@ class automountlocation_import(LDAPQuery):
pass
elif options.get('continue', False):
result['duplicatekeys'].append(am[0])
pass
else:
raise errors.DuplicateEntry(
message=_('key %(key)s already exists') % dict(
@ -488,7 +487,6 @@ class automountlocation_import(LDAPQuery):
pass
elif options.get('continue', False):
result['duplicatemaps'].append(am[0])
pass
else:
raise errors.DuplicateEntry(
message=_('map %(map)s already exists') % dict(
@ -531,7 +529,6 @@ class automountlocation_import(LDAPQuery):
except errors.DuplicateEntry as e:
if options.get('continue', False):
result['duplicatekeys'].append(am[0])
pass
else:
raise e

View File

@ -569,7 +569,6 @@ class stageuser_activate(LDAPQuery):
self.log.debug("merge: %s:%r wiped" % (attr, v))
except:
self.log.debug("merge %s: [no_print %s]" % (attr, v.__class__.__name__))
pass
if isinstance(entry_to[attr], (list, tuple)):
# multi value attribute
if v not in entry_to[attr]:
@ -586,7 +585,7 @@ class stageuser_activate(LDAPQuery):
self.log.debug("Add: %s:%r" % (attr, v))
except:
self.log.debug("Add %s: [no_print %s]" % (attr, v.__class__.__name__))
pass
if isinstance(entry_to[attr], (list, tuple)):
# multi value attribute
if attr.lower() == 'objectclass':
@ -697,7 +696,6 @@ class stageuser_activate(LDAPQuery):
self._exc_wrapper(args, options, ldap.delete_entry)(active_dn)
except:
self.log.error("Fail to cleanup activation. The user remains active %s" % (active_dn))
pass
raise
# add the user we just created into the default primary group

View File

@ -1066,7 +1066,6 @@ class user_status(LDAPQuery):
except errors.NotFound:
# If this happens we have some pretty serious problems
self.error('No IPA masters found!')
pass
entries = []
count = 0
@ -1100,7 +1099,6 @@ class user_status(LDAPQuery):
newresult[attr][0] = unicode(time.strftime('%Y-%m-%dT%H:%M:%SZ', newtime))
except Exception as e:
self.debug("time conversion failed with %s" % str(e))
pass
newresult['server'] = host
if options.get('raw', False):
time_format = '%Y%m%d%H%M%SZ'

View File

@ -1104,7 +1104,7 @@ class TrustDomainInstance(object):
self._pipe.SetInformationTrustedDomain(trustdom_handle, lsa.LSA_TRUSTED_DOMAIN_INFO_INFO_EX, info)
except RuntimeError as e:
root_logger.error('unable to set trust to transitive: %s' % (str(e)))
pass
if self.info['is_pdc']:
self.update_ftinfo(another_domain)

View File

@ -1240,7 +1240,6 @@ class BindInstance(service.Service):
self.fstore.restore_file(f)
except ValueError as error:
root_logger.debug(error)
pass
# disabled by default, by ldap_enable()
if enabled:

View File

@ -491,7 +491,6 @@ class DNSKeySyncInstance(service.Service):
self.fstore.restore_file(f)
except ValueError as error:
self.logger.debug(error)
pass
# remove softhsm pin, to make sure new installation will generate
# new token database

View File

@ -922,7 +922,6 @@ class DsInstance(service.Service):
self.fstore.restore_file(paths.SYSCONFIG_DIRSRV)
except ValueError as error:
root_logger.debug(error)
pass
# disabled during IPA installation
if enabled:

View File

@ -503,7 +503,6 @@ class HTTPInstance(service.Service):
self.fstore.restore_file(f)
except ValueError as error:
root_logger.debug(error)
pass
installutils.remove_keytab(paths.IPA_KEYTAB)
installutils.remove_ccache(ccache_path=paths.KRB5CC_HTTPD,

View File

@ -394,7 +394,6 @@ class KrbInstance(service.Service):
self.fstore.restore_file(f)
except ValueError as error:
root_logger.debug(error)
pass
# disabled by default, by ldap_enable()
if enabled:

View File

@ -178,7 +178,6 @@ class NTPInstance(service.Service):
self.fstore.restore_file(paths.NTP_CONF)
except ValueError as error:
root_logger.debug(error)
pass
if enabled:
self.enable()

View File

@ -376,7 +376,6 @@ class OpenDNSSECInstance(service.Service):
self.fstore.restore_file(f)
except ValueError as error:
root_logger.debug(error)
pass
self.restore_state("KASP_DB_configured") # just eat state

View File

@ -407,7 +407,6 @@ class ReplicationManager(object):
conn.add_entry(ent)
except errors.DuplicateEntry:
conn.modify_s(dn, [(ldap.MOD_REPLACE, "userpassword", pw)])
pass
def delete_replication_manager(self, conn, dn=REPL_MAN_DN):
assert isinstance(dn, DN)

View File

@ -301,7 +301,6 @@ class Declarative(XMLRPC_test):
api.Command[cmd](*args, **options)
except (errors.NotFound, errors.EmptyModlist) as e:
print(e)
pass
def test_command(self, index, declarative_test_definition):
"""Run an individual test

View File

@ -275,7 +275,6 @@ def main():
linter.set_option('disable', 'super-init-not-called')
linter.set_option('disable', 'undefined-loop-variable')
linter.set_option('disable', 'unnecessary-lambda')
linter.set_option('disable', 'unnecessary-pass')
linter.set_option('disable', 'unnecessary-semicolon')
linter.set_option('disable', 'unused-argument')
linter.set_option('disable', 'unused-variable')