Bug 996524

Summary: ActionDestroyDevice with a LUKS device does not behave as expected
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: 20CC: 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: 2014-12-02 18:55: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:
Embargoed:
Attachments:
Description Flags
Reproducer none

Description Jan Synacek 2013-08-13 11:06:29 UTC
Created attachment 786110 [details]
Reproducer

Description of problem:
ActionDestroyDevice with a LUKS device does not behave as expected. The device is destroyed (closed in this case), but an exception is thrown. More details below.


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


How reproducible:
Always.


Steps to Reproduce:
1. Create and open a LUKS partition
2. Run the reproducer (change uuid in code as necessary)
3. Observe an exception


Actual results:
DeviceTreeError                           Traceback (most recent call last)
/usr/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
    176             else:
    177                 filename = fname
--> 178             __builtin__.execfile(filename, *where)

/home/jsynacek/openlmi-storage-nfs/blivet-luks-bug3.py in <module>()
     19 action = blivet.ActionDestroyDevice(luksdevice)
     20 # exception here
---> 21 b.devicetree.registerAction(action)
     22 print "YOU CAN'T SEE ME"
     23 b.devicetree.processActions([actions])

/usr/lib/python2.7/site-packages/blivet/devicetree.pyc in registerAction(self, action)
    341         if not (action.isCreate and action.isDevice) and \
    342            action.device not in self._devices:
--> 343             raise DeviceTreeError("device is not in the tree")
    344         elif (action.isCreate and action.isDevice):
    345             if action.device in self._devices:

DeviceTreeError: device is not in the tree


Expected results:
The LUKS device is closed without any exceptions as expected.


Additional info:
Note that even though the code throws an exception, the LUKS device *gets closed*.

Comment 1 Fedora End Of Life 2013-09-16 16:32:40 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 20 development cycle.
Changing version to '20'.

More information and reason for this action is here:
https://fedoraproject.org/wiki/BugZappers/HouseKeeping/Fedora20

Comment 2 David Lehman 2014-12-02 18:55:17 UTC
You have to add the LUKSDevice to the devicetree before you can use the devicetree to destroy it.