[rhel7/master] Multiple loops shouldn't be fatal (#980510)
Brian C. Lane
bcl at redhat.com
Tue Jan 6 18:25:43 UTC 2015
Backing files can have multiple loops associated with them without
problems. Raising an error here causes a crash when using an iso for
both stage2 and for the repo (eg. boot with
inst.repo=hd:/dev/sdb1:/path-to-dvd.iso).
Instead just use the first loop device in the list as the name.
Resolves: rhbz#980510
---
blivet/devicelibs/loop.py | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/blivet/devicelibs/loop.py b/blivet/devicelibs/loop.py
index 0b374a2..1600ed8 100644
--- a/blivet/devicelibs/loop.py
+++ b/blivet/devicelibs/loop.py
@@ -55,8 +55,9 @@ def get_loop_name(path):
args = ["-j", path]
buf = losetup(args, capture=True)
if len(buf.splitlines()) > 1:
- # there should never be more than one loop device listed
- raise LoopError("multiple loops associated with %s" % path)
+ # If there are multiple loop devices use the first one
+ buf = buf.splitlines()[0]
+ log.warning("multiple loops associated with %s. Using %s" % (path, buf))
name = os.path.basename(buf.split(":")[0])
return name
--
1.9.3
More information about the anaconda-patches
mailing list