[PATCH] Don't create a PartitionDevice for devices that do not exist (#489122).

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

 



This is a strange situation to be in, but there appears to be a corner case
where parted cannot read the disk label despite there being a partition table
on the disk.  anaconda will prompt to create a new disk label.  This means
there's no partitions on the disk, but the list of partitions to probe still
has the old partition list.  So, we should just ignore devices that no longer
exist.
---
 storage/devices.py |    6 ++----
 1 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/storage/devices.py b/storage/devices.py
index ae1ad09..fd98056 100644
--- a/storage/devices.py
+++ b/storage/devices.py
@@ -173,9 +173,7 @@ def PartitionDeviceFactory(*args, **kwargs):
         parents = kwargs["parents"]
         if isinstance(parents, Device):
             parents = [parents]
-        # we receive a list of parents.  look for the disk that contains the name
-        # if we dont find the name we will return PartitionDevice and let it raise
-        # the exception.
+        # we receive a list of parents.  look for the disk that contains the name.
         for root in roots:
             for parent in parents:
                 path = os.path.join(root,norm_name)
@@ -194,7 +192,7 @@ def PartitionDeviceFactory(*args, **kwargs):
                         return PartitionDevice(*args, **kwargs)
 
         # If we get here, we did not find anything.
-        return PartitionDevice(*args, **kwargs)
+        log.warning("unable to find parted device for %s" % norm_name)
 
 class Device(object):
     """ A generic device.
-- 
1.6.1.3

_______________________________________________
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