mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2025-02-25 18:55:28 -06:00
pylint: remove bare except
Bare except should not be used. Reviewed-By: Petr Spacek <pspacek@redhat.com> Reviewed-By: Lukas Slebodnik <lslebodn@redhat.com>
This commit is contained in:
@@ -597,7 +597,7 @@ def clean_dangling_ruvs(realm, host, options):
|
||||
conn = ipaldap.IPAdmin(master_cn, 636, cacert=CACERT)
|
||||
conn.do_simple_bind(bindpw=options.dirman_passwd)
|
||||
master_info['online'] = True
|
||||
except:
|
||||
except Exception:
|
||||
print("The server '{host}' appears to be offline."
|
||||
.format(host=master_cn))
|
||||
offlines.add(master_cn)
|
||||
|
||||
@@ -343,13 +343,13 @@ def ipa_stop(options):
|
||||
try:
|
||||
print("Stopping %s Service" % svc)
|
||||
svchandle.stop(capture_output=False)
|
||||
except:
|
||||
except Exception:
|
||||
emit_err("Failed to stop %s Service" % svc)
|
||||
|
||||
try:
|
||||
print("Stopping Directory Service")
|
||||
dirsrv.stop(capture_output=False)
|
||||
except:
|
||||
except Exception:
|
||||
raise IpactlError("Failed to stop Directory Service")
|
||||
|
||||
# remove file with list of started services
|
||||
@@ -383,7 +383,7 @@ def ipa_restart(options):
|
||||
emit_err("Shutting down")
|
||||
try:
|
||||
dirsrv.stop(capture_output=False)
|
||||
except:
|
||||
except Exception:
|
||||
pass
|
||||
if isinstance(e, IpactlError):
|
||||
# do not display any other error message
|
||||
@@ -421,7 +421,7 @@ def ipa_restart(options):
|
||||
try:
|
||||
print("Stopping %s Service" % svc)
|
||||
svchandle.stop(capture_output=False)
|
||||
except:
|
||||
except Exception:
|
||||
emit_err("Failed to stop %s Service" % svc)
|
||||
|
||||
try:
|
||||
@@ -521,7 +521,7 @@ def ipa_status(options):
|
||||
print("%s Service: RUNNING" % svc)
|
||||
else:
|
||||
print("%s Service: STOPPED" % svc)
|
||||
except:
|
||||
except Exception:
|
||||
emit_err("Failed to get %s Service status" % svc)
|
||||
|
||||
def main():
|
||||
|
||||
Reference in New Issue
Block a user