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

vpodzime installerbot-noreply at redhat.com
Thu Jun 18 19:51:13 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 a462ffa..07bc171 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/34154037a96de90fc5d3fc894d1e39703857a8d7


More information about the anaconda-patches mailing list