Skip to content

Commit

Permalink
Accept both list and ParentList when checking LVs parents
Browse files Browse the repository at this point in the history
These are both valid types for the self.parents attribute.
  • Loading branch information
vpodzime committed Jun 18, 2015
1 parent 1f07ec0 commit 3415403
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blivet/devices/lvm.py
Expand Up @@ -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
Expand Down Expand Up @@ -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__)

Expand Down

0 comments on commit 3415403

Please sign in to comment.