Bug 1017752 - LVMThinPoolDevice is an instance of LVMLogicalVolumeDevice
Summary: LVMThinPoolDevice is an instance of LVMLogicalVolumeDevice
Keywords:
Status: CLOSED NOTABUG
Alias: None
Product: Fedora
Classification: Fedora
Component: python-blivet
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: David Lehman
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-10-10 12:53 UTC by Jan Synacek
Modified: 2013-11-06 19:12 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-11-06 19:12:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Jan Synacek 2013-10-10 12:53:35 UTC
Description of problem:
LVMThinPoolDevice is an instance of LVMLogicalVolumeDevice. I don't think that it should be like that. Thin pools are probably somewhere in between a volume group and a logical volume, but I don't think they are logical volumes. What would be LVMThinLogicalVolume then?


Version-Release number of selected component (if applicable):
python-blivet-0.22-1.fc21.noarch


Steps to Reproduce:
1. Have a thin pool present on your system.
2. Run the following code snippet
  import blivet
  b = blivet.Blivet()
  b.reset()
  tp = b.thinpools[0]
  print type(tp)
  # <class 'blivet.devices.LVMThinPoolDevice'>
  isinstance(tp, blivet.devices.LVMLogicalVolumeDevice)
  # True

Actual results:
LVMThinPoolDevice is an instance of LVMLogicalVolumeDevice


Expected results:
LVMThinPoolDevice is an instance of LVMVolumeGroupDevice? Not sure here.

Comment 1 David Lehman 2013-11-06 19:12:17 UTC
Both thin pools and thin volumes are special types of logical volume, so their classes inherit from LVMLogicalVolumeDevice. If you want to check what type a device is you should either use its "type" attribute or you should check using isinstance but check more specific classes first.


Note You need to log in before you can comment on or make changes to this bug.