* device list as explicit list
This commit is contained in:
parent
085a0daa95
commit
5aba14b469
1 changed files with 12 additions and 1 deletions
|
@ -561,7 +561,7 @@ class CryptoBoxSettings:
|
|||
|
||||
validation_spec = """
|
||||
[Main]
|
||||
AllowedDevices = list(min=1)
|
||||
AllowedDevices = listOfDevices(default="")
|
||||
DefaultVolumePrefix = string(min=1)
|
||||
DefaultCipher = string(default="aes-cbc-essiv:sha256")
|
||||
ConfigVolumeLabel = string(min=1, default="cbox_config")
|
||||
|
@ -625,6 +625,7 @@ class CryptoBoxSettingsValidator(validate.Validator):
|
|||
self.functions["fileWriteable"] = self.check_file_writeable
|
||||
self.functions["listOfExistingDirectories"] = self.check_existing_directories
|
||||
self.functions["listOfLanguages"] = self.list_languages
|
||||
self.functions["listOfDevices"] = self.list_devices
|
||||
|
||||
|
||||
def check_directory_exists(self, value):
|
||||
|
@ -692,6 +693,16 @@ class CryptoBoxSettingsValidator(validate.Validator):
|
|||
langs = [langs]
|
||||
return langs
|
||||
|
||||
def list_devices(self, devices):
|
||||
"""Return devices as a list.
|
||||
"""
|
||||
if not devices:
|
||||
raise validate.VdtValueError("no device specified")
|
||||
if not isinstance(devices, list):
|
||||
devices = [devices]
|
||||
return devices
|
||||
|
||||
|
||||
|
||||
class MiscConfigFile:
|
||||
"""all other config files (e.g. a ssl certificate) to be stored"""
|
||||
|
|
Loading…
Reference in a new issue