fix: make nodatacow and compress mutually exclusive (#1998)
* fix: make nodatacow and compress mutually exclusive * fix: raise ValueError when both compress and nodatacow flags are set
This commit is contained in:
parent
47ed711743
commit
f4a6d11373
|
|
@ -412,12 +412,18 @@ class SubvolumeModification:
|
|||
|
||||
mountpoint = Path(entry['mountpoint']) if entry['mountpoint'] else None
|
||||
|
||||
compress = entry.get('compress', False)
|
||||
nodatacow = entry.get('nodatacow', False)
|
||||
|
||||
if compress and nodatacow:
|
||||
raise ValueError('compress and nodatacow flags cannot be enabled simultaneously on a btfrs subvolume')
|
||||
|
||||
mods.append(
|
||||
SubvolumeModification(
|
||||
entry['name'],
|
||||
mountpoint,
|
||||
entry.get('compress', False),
|
||||
entry.get('nodatacow', False)
|
||||
compress,
|
||||
nodatacow
|
||||
)
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -46,7 +46,6 @@ class SubvolumeMenu(ListManager):
|
|||
['nodatacow', 'compress'],
|
||||
skip=True,
|
||||
preset_values=preset_options,
|
||||
multi=True
|
||||
).run()
|
||||
|
||||
if choice.type_ == MenuSelectionType.Selection:
|
||||
|
|
|
|||
Loading…
Reference in New Issue