Skip to content
Snippets Groups Projects
Commit c39e1458 authored by Henning Glawe's avatar Henning Glawe
Browse files

catch only Exception and subclasses (ruff suggestion)

parent d1910551
No related branches found
No related tags found
No related merge requests found
...@@ -60,7 +60,7 @@ def df_ceph(path: pathlib.Path) -> Tuple[int, int, int]: ...@@ -60,7 +60,7 @@ def df_ceph(path: pathlib.Path) -> Tuple[int, int, int]:
try: try:
used = get_ceph_attribute(path, "ceph.dir.rbytes") used = get_ceph_attribute(path, "ceph.dir.rbytes")
size = get_ceph_attribute(path, "ceph.quota.max_bytes") size = get_ceph_attribute(path, "ceph.quota.max_bytes")
except: except Exception:
used, size, avail = None, None, None used, size, avail = None, None, None
else: else:
avail = size - used avail = size - used
...@@ -83,7 +83,7 @@ def df_mountpoint(path: pathlib.Path) -> Tuple[int, int, int]: ...@@ -83,7 +83,7 @@ def df_mountpoint(path: pathlib.Path) -> Tuple[int, int, int]:
cmd = ["df", "--block-size=1", path] cmd = ["df", "--block-size=1", path]
try: try:
output = subprocess.check_output(cmd).decode() output = subprocess.check_output(cmd).decode()
except: except Exception:
return None, None, None return None, None, None
for line in output.splitlines(): for line in output.splitlines():
df_fields = line.split() df_fields = line.split()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment