Red Hat Bugzilla – Bug 996524
ActionDestroyDevice with a LUKS device does not behave as expected
Last modified: 2014-12-02 13:55:17 EST
Created attachment 786110 [details]
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):
Steps to Reproduce:
1. Create and open a LUKS partition
2. Run the reproducer (change uuid in code as necessary)
3. Observe an exception
DeviceTreeError Traceback (most recent call last)
/usr/lib/python2.7/site-packages/IPython/utils/py3compat.pyc in execfile(fname, *where)
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"
/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
The LUKS device is closed without any exceptions as expected.
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:
You have to add the LUKSDevice to the devicetree before you can use the devicetree to destroy it.