Fedora Account System
Red Hat Associate
Red Hat Customer
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*.
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
You have to add the LUKSDevice to the devicetree before you can use the devicetree to destroy it.