Validate flavor specification in config
Validate that at least one of min-ram or flavor-name are present. Change-Id: I2e42b0d6176e5a15e1ceb2a77b9d557bc0704d50
This commit is contained in:
parent
9b7d8587a4
commit
02d137a777
@ -24,13 +24,21 @@ class ConfigValidator:
|
||||
self.config_file = config_file
|
||||
|
||||
def validate(self):
|
||||
pool_label = {
|
||||
label_min_ram = v.Schema({v.Required('min-ram'): int}, extra=True)
|
||||
|
||||
label_flavor_name = v.Schema({v.Required('flavor-name'): str},
|
||||
extra=True)
|
||||
|
||||
pool_label_main = {
|
||||
v.Required('name'): str,
|
||||
v.Required('diskimage'): str,
|
||||
'min-ram': int,
|
||||
'flavor-name': str,
|
||||
}
|
||||
|
||||
pool_label = v.All(pool_label_main,
|
||||
v.Any(label_min_ram, label_flavor_name))
|
||||
|
||||
pool = {
|
||||
'name': str,
|
||||
'networks': [str],
|
||||
|
Loading…
x
Reference in New Issue
Block a user