WIP match loop5p5 from instead of loop5 from loop5p1
authorŁukasz Stelmach <l.stelmach@samsung.com>
Tue, 3 Oct 2023 15:50:19 +0000 (17:50 +0200)
committerŁukasz Stelmach <l.stelmach@samsung.com>
Tue, 3 Oct 2023 15:50:19 +0000 (17:50 +0200)
Change-Id: I9796e8abf7b8999f4ceefd34f365aa3f6bb4d1e9
Signed-off-by: Łukasz Stelmach <l.stelmach@samsung.com>
scripts/tizen/sd_fusing.py

index f103544..f14bd40 100755 (executable)
@@ -542,8 +542,12 @@ def get_partition_device(device, idx):
     logging.debug(" ".join(argv))
     proc = subprocess.run(argv,
                           stdout=subprocess.PIPE)
+    if proc.returncode != 0:
+        logging.error("lsblk has failed")
+        return None
+    part_re = re.compile(f"^part\s+(.*[^0-9]{idx})$")
     for l in proc.stdout.decode('utf-8').splitlines():
-        match = re.search(f"^part\s+(.*[^0-9]{idx})", l)
+        match = part_re.match(l)
         if match:
             return match[1]
     return None