Fix for crypto config default value

Signed-off-by: Gabor Mezei <[email protected]>
This commit is contained in:
Gabor Mezei
2024-07-25 11:00:06 +02:00
parent ee521b6137
commit d723b51bef
+9 -1
View File
@@ -599,12 +599,16 @@ class CryptoConfig(Config):
for (active, name, value, section)
in self.configfile.parse_file()})
def set(self, name, value=None):
def set(self, name, value='1'):
if name in UNSUPPORTED_FEATURE:
raise ValueError(f'Feature is unsupported: \'{name}\'')
if name in UNSTABLE_FEATURE:
raise ValueError(f'Feature is unstable: \'{name}\'')
# The default value in the crypto config is '1'
if not value:
value = '1'
if name not in self.settings:
self.configfile.templates.append((name, '', '#define ' + name + ' '))
@@ -655,6 +659,10 @@ class MultiConfig(Config):
if name in UNSTABLE_FEATURE:
raise ValueError(f'Feature is unstable: \'{name}\'')
# The default value in the crypto config is '1'
if not value:
value = '1'
if name not in self.settings:
configfile.templates.append((name, '', '#define ' + name + ' '))