Bug 1017752

Summary: LVMThinPoolDevice is an instance of LVMLogicalVolumeDevice
Product: [Fedora] Fedora Reporter: Jan Synacek <jsynacek>
Component: python-blivetAssignee: David Lehman <dlehman>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: amulhern, anaconda-maint-list, bcl, dlehman, jsafrane
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-11-06 19:12:17 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

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.