Fix E722 do not use bare 'except'

Related: https://pagure.io/freeipa/issue/8306
Signed-off-by: Christian Heimes <cheimes@redhat.com>
Reviewed-By: Florence Blanc-Renaud <frenaud@redhat.com>
This commit is contained in:
Christian Heimes 2020-04-30 15:17:52 +02:00
parent 31fa527e1b
commit 186d739d7f
5 changed files with 6 additions and 6 deletions

View File

@ -538,7 +538,7 @@ def run(args, stdin=None, raiseonerr=True, nolog=(), env=None,
logger.debug('Process interrupted')
p.wait()
raise
except:
except BaseException:
logger.debug('Process execution failed')
raise
finally:

View File

@ -216,7 +216,7 @@ class KRAInstaller(KRAInstall):
try:
kra.install(api, config, self.options, custodia=custodia)
except:
except BaseException:
logger.error('%s', dedent(self.FAIL_MESSAGE))
raise

View File

@ -159,7 +159,7 @@ def set_service_entry_config(name, fqdn, config_values,
"service %s has already enabled config values %s", name,
config_values)
return
except:
except BaseException:
logger.debug("failed to set service %s config values", name)
raise
@ -699,7 +699,7 @@ class Service:
api.Backend.ldap2.update_entry(entry)
except errors.EmptyModlist:
pass
except:
except BaseException:
logger.debug("failed to disable service %s startup entry", name)
raise

View File

@ -268,7 +268,7 @@ class certprofile_import(LDAPCreate):
with self.api.Backend.ra_certprofile as profile_api:
profile_api.create_profile(context.profile)
profile_api.enable_profile(keys[0])
except:
except BaseException:
# something went wrong ; delete entry
ldap.delete_entry(dn)
raise

View File

@ -720,7 +720,7 @@ class stageuser_activate(LDAPQuery):
# Now delete the Staging entry
try:
self._exc_wrapper(args, options, ldap.delete_entry)(staging_dn)
except:
except BaseException:
try:
logger.error("Fail to delete the Staging user after "
"activating it %s ", staging_dn)