[blivet:rhel7/master] Don't add None value to req_disks (#981316)

mulhern amulhern at redhat.com
Fri Jan 31 18:02:08 UTC 2014


Resolves: rhbz#981316

If a disk has been removed in the interim it won't be found by a lookup
in the device tree, but we don't want to include None in our copy.

Signed-off-by: mulhern <amulhern at redhat.com>
---
 blivet/__init__.py | 7 ++-----
 1 file changed, 2 insertions(+), 5 deletions(-)

diff --git a/blivet/__init__.py b/blivet/__init__.py
index 1f6637f..1236511 100644
--- a/blivet/__init__.py
+++ b/blivet/__init__.py
@@ -1961,11 +1961,8 @@ class Blivet(object):
                 continue
 
             # update the refs in req_disks as well
-            req_disks = []
-            for disk in partition.req_disks:
-                req_disks.append(new.devicetree.getDeviceByID(disk.id))
-
-            partition.req_disks = req_disks
+            req_disks = (new.devicetree.getDeviceByID(disk.id) for disk in partition.req_disks)
+            partition.req_disks = [disk for disk in req_disks if disk is not None]
 
             p = partition.disk.format.partedDisk.getPartitionByPath(partition.path)
             partition.partedPartition = p
-- 
1.8.3.1



More information about the anaconda-patches mailing list