[master 12/13] Return a device from addUdevLVDevice if possible.
dwlehman
installerbot-noreply at redhat.com
Thu Mar 19 19:59:34 UTC 2015
From: David Lehman <dlehman at redhat.com>
I can't see any reason not to return it from here since we do so from
all of the other addUdev*Device methods.
---
blivet/populator.py | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/blivet/populator.py b/blivet/populator.py
index a6f09a8..4bdd00d 100644
--- a/blivet/populator.py
+++ b/blivet/populator.py
@@ -227,13 +227,14 @@ def addUdevLVDevice(self, info):
pv_info = udev.get_device(pv_sysfs_path)
self.addUdevDevice(pv_info)
+ # LVM provides no means to resolve conflicts caused by duplicated VG
+ # names, so we're just being optimistic here. Woo!
vg_name = udev.device_get_lv_vg_name(info)
- device = self.getDeviceByName(vg_name)
- if not device:
+ vg_device = self.getDeviceByName(vg_name)
+ if not vg_device:
log.error("failed to find vg '%s' after scanning pvs", vg_name)
- # Don't return the device like we do in the other addUdevFooDevice
- # methods. The device we have here is a vg, not an lv.
+ return self.getDeviceByName(name)
def addUdevDMDevice(self, info):
name = udev.device_get_name(info)
--
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/adfbe4afe37fe0eafac23512dcb347ff5fdfd5fa
More information about the anaconda-patches
mailing list