Allow setting size for non-existing LUKS devices #848
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The LUKS device "inherits" its size from the parent so we are
just setting the parent's size here. This allows automatic size
adjustments for format minimum size for growable devices with
sizes smaller than format minimum size (e.g. using --grow in
kickstart for PVs).
Resolves: rhbz#1836269
I'm not sure about this one. There are two issues here. First, the size setter currently doesn't work for
LUKSDevice
at all. I think it's python problem with mixing the new style properties (using the@property
decorator) and the old style properties and the setter fromStorageDevice
is currently not being inherited which causes the installation crash with thecan't set attribute
error. Second issue is about setting size for theLUKSDevice
during_set_format
-- the device factory first creates a 1 MiB partition, formats to PV format and updates its size to 8 MiB (we are talking about--size=1 --grow
in the kickstart) and after this we add the encryption by creating LUKSDevice which is now 6 MiB (size of the partition minus LUKS metadata) and try to format it to PV updating its size to 8 MiB which now fails.I've added a new test case to cover this new LUKS size getter/setter functionality (setter is covered with
test_size_setter
inherited fromStorageDeviceSizeTest
) but I'm not sure if this is the best approach and this might affect other things not covered by our test suite.