Converted the raise exception into a log. Whenever blockdevice is unsure of what type it's working on, it will not log it as a debug message.

This commit is contained in:
Anton Hvornum 2021-04-03 15:18:35 +02:00
parent 1c3287bc81
commit 7333fe109c
No known key found for this signature in database
GPG Key ID: F1234C5BA67C59DF
1 changed files with 2 additions and 0 deletions

View File

@ -85,6 +85,8 @@ class BlockDevice():
if 'pkname' not in self.info:
raise DiskError(f'A crypt device ({self.path}) without a parent kernel device name.')
return f"/dev/{self.info['pkname']}"
else:
log(f"Unknown blockdevice type for {self.path}: {self.info['type']}", level=LOG_LEVELS.Debug)
# if not stat.S_ISBLK(os.stat(full_path).st_mode):
# raise DiskError(f'Selected disk "{full_path}" is not a block device.')