[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[PATCH 4/9] Fix efi_product_path regex (#728007)



---
 pyanaconda/bootloader.py |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/pyanaconda/bootloader.py b/pyanaconda/bootloader.py
index 6447c86..44fdb5a 100644
--- a/pyanaconda/bootloader.py
+++ b/pyanaconda/bootloader.py
@@ -1312,15 +1312,11 @@ class EFIGRUB(GRUB):
 
             eg: HD(1,800,64000,faacb4ef-e361-455e-bd97-ca33632550c3)
         """
-        path = ""
         buf = self.efibootmgr("-v", stderr="/dev/tty5", capture=True)
-        matches = re.search(productName + r'\s+HD\(.+?\)', buf)
-        if matches:
-            path = re.sub(productName + r'\s+',
-                          '',
-                          buf[matches[0].start():matches[0].end()])
-
-        return path
+        matches = re.search(productName + r'\s+(HD\(.+?\))', buf)
+        if matches and matches.groups():
+            return matches.group(1)
+        return ""
 
     @property
     def grub_conf_device_line(self):
-- 
1.7.4.4


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]