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 4, 2015
1 parent f2cc381 commit d5a9b7d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions blivet/devices/lvm.py
Original file line number Diff line number Diff line change
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 d5a9b7d

Please sign in to comment.