Closed jreidinger closed 2 years ago
I would prefer adapting yast2-storage-ng in a way that actually makes the new undesired types invisible to the users of Y2Storage
.
This actually implies changing all the calls everywhere from MountByType.all
into calls to MountByType.all_supported
, including the calls in the test suite. That's a modification in the API.
In my opinion, the correct fix should imply no changes in the testsuite.
In other words, I would modify MountByType.all
to keep returning the same result that it returned before the change in libstorage-ng.
In other words, I would modify
MountByType.all
to keep returning the same result that it returned before the change in libstorage-ng.
I tried this but that alone did not fix the tests:
diff --git a/src/lib/y2storage/filesystems/mount_by_type.rb b/src/lib/y2storage/filesystems/mount_by_type.rb
index d3f64ebe..a50278e6 100644
--- a/src/lib/y2storage/filesystems/mount_by_type.rb
+++ b/src/lib/y2storage/filesystems/mount_by_type.rb
@@ -36,6 +36,10 @@ module Y2Storage
wrap_enum "MountByType"
+ def self.all
+ super - [PARTLABEL, PARTUUID]
+ end
+
# Hash with the properties for each mount by type.
#
# Keys are the symbols representing the types and values are hashes that
@mvidner I think that you cannot use super for wrapped class.
@ancorgs well, it can be done that way. What I do not like about it is that it is not consistent as for other classes all is all what is supported by libstorage-ng and here it will be reduced. But if you are OK with it, I can redo it.
Actually what I found inconsistent with other classes is using WhateverEnum.all
(eg. DasdType.all
, EncryptionType.all
, LvType.all, etc.) in all of them and then having to use
MountByType.all_supported`.
Problem
Libstorage-ng introduces new types for mount_by which causes failure in test suites and also other code is not adapted for it.
Solution
Introduce list of supported mount by and skip newly added ones as there is no request to support them.
Testing