stdout=subprocess.PIPE)
if proc.returncode != 0:
logging.error("lsblk has failed")
- return None
+ sys.exit(1)
part_re = re.compile(f"^part\s+(.*[^0-9]{idx})$")
for l in proc.stdout.decode('utf-8').splitlines():
match = part_re.match(l)
if match:
return match[1]
- return None
+ logging.error("device entry not found")
+ sys.exit(1)
def get_device_kname(device):
argv = ['lsblk', device, '-o', 'TYPE,KNAME']
logging.debug(" ".join(argv))
proc = subprocess.run(argv,
stdout=subprocess.PIPE)
+ if proc.returncode != 0:
+ logging.error("lsblk has failed")
+ sys.exit(1)
for l in proc.stdout.decode('utf-8').splitlines():
match = re.search(f"^(disk|loop)\s+(.*)", l)
if match:
return match[2]
- return None
+ logging.error("kname entry not found")
+ sys.exit(1)
def do_fuse_file(f, name, target):
indexes = target.get_partition_index_list(name)