[master 6/9] Accept both list and ParentList when checking LVs parents

vpodzime installerbot-noreply at redhat.com
Thu Jun 18 20:00:35 UTC 2015


From: Vratislav Podzimek <vpodzime at redhat.com>

These are both valid types for the self.parents attribute.
---
 blivet/devices/lvm.py | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/blivet/devices/lvm.py b/blivet/devices/lvm.py
index bb77cb5..6c929c2 100644
--- a/blivet/devices/lvm.py
+++ b/blivet/devices/lvm.py
@@ -41,7 +41,7 @@
 import logging
 log = logging.getLogger("blivet")
 
-from .lib import LINUX_SECTOR_SIZE
+from .lib import LINUX_SECTOR_SIZE, ParentList
 from .device import Device
 from .storage import StorageDevice
 from .container import ContainerDevice
@@ -529,7 +529,7 @@ def __init__(self, name, parents=None, size=None, uuid=None, segType=None,
     def _check_parents(self):
         """Check that this device has parents as expected"""
 
-        if isinstance(self.parents, list):
+        if isinstance(self.parents, (list, ParentList)):
             if len(self.parents) != 1:
                 raise ValueError("constructor requires a single %s instance" % self._containerClass.__name__)
 


-- 
To view this commit on github, visit https://github.com/rhinstaller/blivet/commit/f468d8b25975e2fb8e52d7be1b80350f0d37e0d7


More information about the anaconda-patches mailing list