[PATCH 1/1] Use the path instead of the name for the questionInitialize function. (#517926)

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

 



---
 storage/devicetree.py |   18 ++++++++----------
 1 files changed, 8 insertions(+), 10 deletions(-)

diff --git a/storage/devicetree.py b/storage/devicetree.py
index 83d756b..673ebe3 100644
--- a/storage/devicetree.py
+++ b/storage/devicetree.py
@@ -122,18 +122,16 @@ def getLUKSPassphrase(intf, device, globalPassphrase):
     return (passphrase, isglobal)
 
 # Don't really know where to put this.
-def questionInitializeDisk(intf=None, name=None, description=None):
+def questionInitializeDisk(intf=None, path=None, description=None):
     retVal = False # The less destructive default
-    if not intf or not name:
+    if not intf or not path:
         pass
     else:
-        if not name.startswith('/dev/'):
-            devpath = '/dev/' + name
-        else:
-            devpath = name
+        if not path.startswith('/dev/'):
+            path = '/dev/' + path
 
-        dev = parted.getDevice(devpath)
-        bypath = deviceNameToDiskByPath(name)
+        dev = parted.getDevice(path)
+        bypath = deviceNameToDiskByPath(path)
         details = ""
 
         if description is None:
@@ -147,7 +145,7 @@ def questionInitializeDisk(intf=None, name=None, description=None):
                   "%s\n%-0.fMB\n%s\n\n"
                   "This device may need to be reinitialized.\n\n"
                   "REINITIALIZING WILL CAUSE ALL DATA TO BE LOST!%s")
-                % (name, dev.getSize(), description, details,),
+                % (path, dev.getSize(), description, details,),
                 type="custom",
                 custom_buttons = [ _("_Ignore drive"),
                                    _("_Re-initialize drive") ],
@@ -1291,7 +1289,7 @@ class DeviceTree(object):
         if self.zeroMbr:
             initcb = lambda: True
         else:
-            initcb = lambda: questionInitializeDisk(self.intf, device.name,
+            initcb = lambda: questionInitializeDisk(self.intf, device.path,
                                                     device.description)
 
         try:
-- 
1.6.4

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list

[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux