Bug 1017752 - LVMThinPoolDevice is an instance of LVMLogicalVolumeDevice
LVMThinPoolDevice is an instance of LVMLogicalVolumeDevice
Status: CLOSED NOTABUG
Product: Fedora
Classification: Fedora
Component: python-blivet (Show other bugs)
rawhide
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: David Lehman
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2013-10-10 08:53 EDT by Jan Synacek
Modified: 2013-11-06 14:12 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-11-06 14:12:17 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jan Synacek 2013-10-10 08:53:35 EDT
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 14:12:17 EST
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.