Skip to content

Commit 4166f89

Browse files
added new volume key "id" to schema
1 parent b03b613 commit 4166f89

File tree

1 file changed

+15
-22
lines changed

1 file changed

+15
-22
lines changed

bibigrid/core/utility/validate_schema.py

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,19 @@ def str_dict_or_none(d):
1919
return d
2020

2121

22+
VOLUMES = [{
23+
Optional('name'): str,
24+
Optional('id'): str,
25+
Optional('snapshot'): str, # optional; to create volume from
26+
# one or none of these
27+
Optional('permanent'): bool,
28+
Optional('semiPermanent'): bool,
29+
Optional('exists'): bool,
30+
Optional('mountPoint'): str,
31+
Optional('size'): int,
32+
Optional('fstype'): str,
33+
Optional('type'): str}]
34+
2235
WORKER = {'type': str, 'image': str, Optional('count'): int, Optional('onDemand'): bool, Optional('partitions'): [str],
2336
Optional('features'): [str],
2437
Optional('securityGroups'): [str],
@@ -27,17 +40,7 @@ def str_dict_or_none(d):
2740
Optional('terminate'): bool,
2841
Optional('size'): int
2942
},
30-
Optional('volumes'): [{
31-
Optional('name'): str,
32-
Optional('snapshot'): str, # optional; to create volume from
33-
# one or none of these
34-
Optional('permanent'): bool,
35-
Optional('semiPermanent'): bool,
36-
Optional('exists'): bool,
37-
Optional('mountPoint'): str,
38-
Optional('size'): int,
39-
Optional('fstype'): str,
40-
Optional('type'): str}],
43+
Optional('volumes'): VOLUMES,
4144
Optional('meta'): Use(str_dict_or_none)
4245
}
4346

@@ -50,17 +53,7 @@ def str_dict_or_none(d):
5053
Optional('terminate'): bool,
5154
Optional('size'): int
5255
},
53-
Optional('volumes'): [{
54-
Optional('name'): str,
55-
Optional('snapshot'): str, # optional; to create volume from
56-
# one or none of these
57-
Optional('permanent'): bool,
58-
Optional('semiPermanent'): bool,
59-
Optional('exists'): bool,
60-
Optional('mountPoint'): str,
61-
Optional('size'): int,
62-
Optional('fstype'): str,
63-
Optional('type'): str}],
56+
Optional('volumes'): VOLUMES,
6457
Optional('meta'): Use(str_dict_or_none)
6558
}
6659

0 commit comments

Comments
 (0)