Skip to content

Commit 51f2a73

Browse files
committed
remove check_dict usage from cryptsetup module
Signed-off-by: Zen <[email protected]>
1 parent bc81e7b commit 51f2a73

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/ugrd/crypto/cryptsetup.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,19 @@
11
__author__ = 'desultory'
2-
__version__ = '2.5.0'
2+
__version__ = '2.5.1'
33

4-
from zenlib.util import check_dict, contains
4+
from zenlib.util import contains
55

66

77
_module_name = 'ugrd.crypto.cryptsetup'
88

99
CRYPTSETUP_PARAMETERS = ['key_type', 'partuuid', 'uuid', 'path', 'key_file', 'header_file', 'retries', 'key_command', 'reset_command', 'try_nokey', 'include_key']
1010

1111

12-
@check_dict('cryptsetup', value_arg=1, return_arg=2, contains=True) # Check if the mapped name is defined
1312
def _merge_cryptsetup(self, mapped_name: str, config: dict) -> None:
1413
""" Merges the cryptsetup configuration """
14+
if mapped_name not in self['cryptsetup']:
15+
return config
16+
1517
self.logger.log(5, "Existing cryptsetup configuration: %s" % self['cryptsetup'][mapped_name])
1618
self.logger.debug("[%s] Merging cryptsetup configuration: %s" % (mapped_name, config))
1719
return dict(self['cryptsetup'][mapped_name], **config)

0 commit comments

Comments
 (0)