6
6
from ...utils import merge_config
7
7
8
8
9
- def merge_list (schema_list ):
10
- schema = default_schema
11
- for s in schema_list :
12
- schema = merge_config (schema , s )
13
- return schema
14
-
15
-
16
9
"""
17
10
This defines a new property in the ``Interface``.
18
11
@@ -23,7 +16,7 @@ def merge_list(schema_list):
23
16
on a bridge
24
17
"""
25
18
26
- netconf_schema = {
19
+ override_schema = {
27
20
"type" : "object" ,
28
21
"addtionalProperties" : True ,
29
22
"definitions" : {
@@ -34,19 +27,38 @@ def merge_list(schema_list):
34
27
"default" : False ,
35
28
}
36
29
}
37
- }
38
- }
39
- }
40
-
41
-
42
- """
43
- This schema defines a new property for netjson
44
-
45
- As the antenna can be in ``bridge`` or ``router`` mode
46
- this mode can be selected from this property
47
- """
48
- netmode_schema = {
49
- "type" : "object" ,
30
+ },
31
+ "encryption_wireless_property_ap" : {
32
+ "properties" : {
33
+ "encryption" : {
34
+ "type" : "object" ,
35
+ "title" : "Encryption" ,
36
+ "required" : "protocol" ,
37
+ "propertyOrder" : 20 ,
38
+ "oneOf" : [
39
+ {"$ref" : "#/definitions/encryption_none" },
40
+ {"$ref" : "#/definitions/encryption_wpa_personal" },
41
+ {"$ref" : "#/definitions/encryption_wpa_enterprise_sta" },
42
+ ],
43
+ },
44
+ },
45
+ },
46
+ "encryption_wireless_property_sta" : {
47
+ "properties" : {
48
+ "encryption" : {
49
+ "type" : "object" ,
50
+ "title" : "Encryption" ,
51
+ "required" : "protocol" ,
52
+ "propertyOrder" : 20 ,
53
+ "oneOf" : [
54
+ {"$ref" : "#/definitions/encryption_none" },
55
+ {"$ref" : "#/definitions/encryption_wpa_personal" },
56
+ {"$ref" : "#/definitions/encryption_wpa_enterprise_sta" },
57
+ ],
58
+ },
59
+ },
60
+ },
61
+ },
50
62
"properties" : {
51
63
"netmode" : {
52
64
"enum" : [
@@ -59,49 +71,9 @@ def merge_list(schema_list):
59
71
},
60
72
}
61
73
62
-
63
- """
64
- This schema override the possible encryption for AirOS from the default schema
65
- """
66
- wpasupplicant_schema = {
67
- "encryption_wireless_property_sta" : {
68
- "properties" : {
69
- "encryption" : {
70
- "type" : "object" ,
71
- "title" : "Encryption" ,
72
- "required" : "protocol" ,
73
- "propertyOrder" : 20 ,
74
- "oneOf" : [
75
- {"$ref" : "#/definitions/encryption_none" },
76
- {"$ref" : "#/definitions/encryption_wpa_personal" },
77
- {"$ref" : "#/definitions/encryption_wpa_enterprise_sta" },
78
- ],
79
- },
80
- },
81
- },
82
- "encryption_wireless_property_ap" : {
83
- "properties" : {
84
- "encryption" : {
85
- "type" : "object" ,
86
- "title" : "Encryption" ,
87
- "required" : "protocol" ,
88
- "propertyOrder" : 20 ,
89
- "oneOf" : [
90
- {"$ref" : "#/definitions/encryption_none" },
91
- {"$ref" : "#/definitions/encryption_wpa_personal" },
92
- {"$ref" : "#/definitions/encryption_wpa_enterprise_sta" },
93
- ],
94
- },
95
- },
96
- },
97
- }
98
-
99
-
100
- schema = merge_list ([
74
+ schema = merge_config (
101
75
default_schema ,
102
- netconf_schema ,
103
- netmode_schema ,
104
- wpasupplicant_schema ,
105
- ])
76
+ override_schema
77
+ )
106
78
107
79
__all__ = [schema ]
0 commit comments