Added more debug output for get_mount_info()
This commit is contained in:
parent
fd904ca787
commit
960c4e6a3d
|
|
@ -121,7 +121,7 @@ def harddrive(size=None, model=None, fuzzy=False):
|
||||||
def get_mount_info(path :Union[pathlib.Path, str], traverse=False, return_real_path=False) -> dict:
|
def get_mount_info(path :Union[pathlib.Path, str], traverse=False, return_real_path=False) -> dict:
|
||||||
for traversal in list(map(str, [str(path)] + list(pathlib.Path(str(path)).parents))):
|
for traversal in list(map(str, [str(path)] + list(pathlib.Path(str(path)).parents))):
|
||||||
try:
|
try:
|
||||||
log(f"Getting mount information at location {traversal}", level=logging.INFO)
|
log(f"Getting mount information for device path {traversal}", level=logging.INFO)
|
||||||
output = SysCommand(f'/usr/bin/findmnt --json {traversal}').decode('UTF-8')
|
output = SysCommand(f'/usr/bin/findmnt --json {traversal}').decode('UTF-8')
|
||||||
if output:
|
if output:
|
||||||
break
|
break
|
||||||
|
|
@ -132,6 +132,7 @@ def get_mount_info(path :Union[pathlib.Path, str], traverse=False, return_real_p
|
||||||
break
|
break
|
||||||
|
|
||||||
if not output:
|
if not output:
|
||||||
|
log(f"Could not get mount information for device path {path}: {output}", fg="yellow", level=logging.WARNING)
|
||||||
if return_real_path:
|
if return_real_path:
|
||||||
return {}, None
|
return {}, None
|
||||||
else:
|
else:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue