summaryrefslogtreecommitdiffstats
path: root/src/utils/fs.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/utils/fs.py')
-rw-r--r--src/utils/fs.py12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/utils/fs.py b/src/utils/fs.py
index 69b4789..1015754 100644
--- a/src/utils/fs.py
+++ b/src/utils/fs.py
@@ -150,14 +150,12 @@ def mkfs(fs, disk, partition, label=None):
}
if fs not in fsdict:
- logging.error(f'mkfs fails, unsupported target filesystem {fs}')
- raise ValueError(f'Unsupported target filesystem {fs}')
+ raise ValueError(f'mkfs failed, unsupported target filesystem {fs}')
try:
partdev = get_partition_device(disk, partition)
except ValueError as e:
- logging.error(f'mkfs aborted, invalid partition.')
- raise e
+ raise ValueError(f'mkfs aborted: {e}') from e
fsdict[fs](partdev, label)
@@ -253,13 +251,11 @@ def _reduce_ntfsresize(partdev):
data_split = output_data.split(pattern)
# If we fail to match pattern in the split then data_split will contain [output_data]
if len(data_split) == 1:
- logging.error(f'nfsresize: failed to find: "{pattern}"')
- raise ValueError(f'nfsresize: failed to find: "{pattern}"')
+ raise ValueError(f'nfsresize: failed to find: {pattern}')
value_str = data_split[1].split(' ')[0]
if not value_str.isdigit() or value_str.startswith('-'):
- logging.error(f'nfsresize: failed to parse numeric value at "{pattern}"')
- raise ValueError(f'nfsresize: failed to parse numeric value at "{pattern}"')
+ raise ValueError(f'nfsresize: failed to parse numeric value at {pattern}')
return int(value_str)
try: