blob: 70b4c8cb8b7bcdd868d0a2f75573b8d0f93540c9 [file] [log] [blame]
Neels Hofmeyr3531a192017-03-28 14:30:28 +02001# osmo_gsm_tester: validate dict structures
2#
3# Copyright (C) 2016-2017 by sysmocom - s.f.m.c. GmbH
4#
5# Author: Neels Hofmeyr <neels@hofmeyr.de>
6#
7# This program is free software: you can redistribute it and/or modify
Harald Welte27205342017-06-03 09:51:45 +02008# it under the terms of the GNU General Public License as
Neels Hofmeyr3531a192017-03-28 14:30:28 +02009# published by the Free Software Foundation, either version 3 of the
10# License, or (at your option) any later version.
11#
12# This program is distributed in the hope that it will be useful,
13# but WITHOUT ANY WARRANTY; without even the implied warranty of
14# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
Harald Welte27205342017-06-03 09:51:45 +020015# GNU General Public License for more details.
Neels Hofmeyr3531a192017-03-28 14:30:28 +020016#
Harald Welte27205342017-06-03 09:51:45 +020017# You should have received a copy of the GNU General Public License
Neels Hofmeyr3531a192017-03-28 14:30:28 +020018# along with this program. If not, see <http://www.gnu.org/licenses/>.
19
20import re
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +020021import os
Neels Hofmeyr3531a192017-03-28 14:30:28 +020022
23from . import log
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +020024from . import util
Neels Hofmeyr3531a192017-03-28 14:30:28 +020025
Pau Espin Pedrole0b89902020-05-06 16:28:01 +020026KEY_RE = re.compile('[a-zA-Z0-9][a-zA-Z0-9_]*')
Neels Hofmeyr3531a192017-03-28 14:30:28 +020027IPV4_RE = re.compile('([0-9]{1,3}.){3}[0-9]{1,3}')
28HWADDR_RE = re.compile('([0-9a-fA-F]{2}:){5}[0-9a-fA-F]{2}')
29IMSI_RE = re.compile('[0-9]{6,15}')
30KI_RE = re.compile('[0-9a-fA-F]{32}')
31MSISDN_RE = re.compile('[0-9]{1,15}')
32
33def match_re(name, regex, val):
34 while True:
35 if not isinstance(val, str):
36 break;
37 if not regex.fullmatch(val):
38 break;
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020039 return True
Neels Hofmeyr3531a192017-03-28 14:30:28 +020040 raise ValueError('Invalid %s: %r' % (name, val))
41
42def band(val):
Pau Espin Pedrol05a838e2018-03-27 19:15:41 +020043 if val in ('GSM-900', 'GSM-1800', 'GSM-1900'):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020044 return True
Neels Hofmeyr3531a192017-03-28 14:30:28 +020045 raise ValueError('Unknown GSM band: %r' % val)
46
47def ipv4(val):
48 match_re('IPv4 address', IPV4_RE, val)
49 els = [int(el) for el in val.split('.')]
50 if not all([el >= 0 and el <= 255 for el in els]):
51 raise ValueError('Invalid IPv4 address: %r' % val)
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020052 return True
Neels Hofmeyr3531a192017-03-28 14:30:28 +020053
54def hwaddr(val):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020055 return match_re('hardware address', HWADDR_RE, val)
Neels Hofmeyr3531a192017-03-28 14:30:28 +020056
57def imsi(val):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020058 return match_re('IMSI', IMSI_RE, val)
Neels Hofmeyr3531a192017-03-28 14:30:28 +020059
60def ki(val):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020061 return match_re('KI', KI_RE, val)
Neels Hofmeyr3531a192017-03-28 14:30:28 +020062
63def msisdn(val):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020064 return match_re('MSISDN', MSISDN_RE, val)
Neels Hofmeyr3531a192017-03-28 14:30:28 +020065
Pau Espin Pedrol713ce2c2017-08-24 16:57:17 +020066def auth_algo(val):
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +020067 if val not in util.ENUM_OSMO_AUTH_ALGO:
Neels Hofmeyr0af893c2017-12-14 15:18:05 +010068 raise ValueError('Unknown Authentication Algorithm: %r' % val)
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020069 return True
Pau Espin Pedrol713ce2c2017-08-24 16:57:17 +020070
Pau Espin Pedrolfa9a6d32017-09-12 15:13:21 +020071def uint(val):
72 n = int(val)
73 if n < 0:
74 raise ValueError('Positive value expected instead of %d' % n)
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020075 return True
Pau Espin Pedrolfa9a6d32017-09-12 15:13:21 +020076
Pau Espin Pedrol8a3a7b52017-11-28 15:50:02 +010077def uint8(val):
78 n = int(val)
79 if n < 0:
80 raise ValueError('Positive value expected instead of %d' % n)
81 if n > 255: # 2^8 - 1
82 raise ValueError('Value %d too big, max value is 255' % n)
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020083 return True
Pau Espin Pedrol8a3a7b52017-11-28 15:50:02 +010084
Pau Espin Pedrol5e0c2512017-11-06 18:40:23 +010085def uint16(val):
86 n = int(val)
87 if n < 0:
88 raise ValueError('Positive value expected instead of %d' % n)
89 if n > 65535: # 2^16 - 1
90 raise ValueError('Value %d too big, max value is 65535' % n)
Pau Espin Pedrold79e7192020-05-21 15:40:57 +020091 return True
92
93def bool_str(val):
94 # str2bool will raise an exception if unable to parse it
95 util.str2bool(val)
96 return True
Pau Espin Pedrol5e0c2512017-11-06 18:40:23 +010097
Pau Espin Pedrolead79ac2017-09-12 15:19:18 +020098def times(val):
99 n = int(val)
100 if n < 1:
101 raise ValueError('Positive value >0 expected instead of %d' % n)
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200102 return True
Pau Espin Pedrolead79ac2017-09-12 15:19:18 +0200103
Pau Espin Pedrol57497a62017-08-28 14:21:15 +0200104def cipher(val):
105 if val in ('a5_0', 'a5_1', 'a5_2', 'a5_3', 'a5_4', 'a5_5', 'a5_6', 'a5_7'):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200106 return True
Pau Espin Pedrol57497a62017-08-28 14:21:15 +0200107 raise ValueError('Unknown Cipher value: %r' % val)
108
Pau Espin Pedrolac18fd32017-08-31 18:49:47 +0200109def modem_feature(val):
Pau Espin Pedroleae9c902020-03-31 11:12:39 +0200110 if val in ('sms', 'gprs', 'voice', 'ussd', 'sim', '2g', '3g', '4g'):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200111 return True
Pau Espin Pedrolac18fd32017-08-31 18:49:47 +0200112 raise ValueError('Unknown Modem Feature: %r' % val)
113
Pau Espin Pedrolc9b63762018-05-07 01:57:01 +0200114def phy_channel_config(val):
115 if val in ('CCCH', 'CCCH+SDCCH4', 'TCH/F', 'TCH/H', 'SDCCH8', 'PDCH',
116 'TCH/F_PDCH', 'CCCH+SDCCH4+CBCH', 'SDCCH8+CBCH','TCH/F_TCH/H_PDCH'):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200117 return True
Pau Espin Pedrolc9b63762018-05-07 01:57:01 +0200118 raise ValueError('Unknown Physical channel config: %r' % val)
119
Pau Espin Pedrol722e94e2018-08-22 11:01:32 +0200120def channel_allocator(val):
121 if val in ('ascending', 'descending'):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200122 return True
Pau Espin Pedrol722e94e2018-08-22 11:01:32 +0200123 raise ValueError('Unknown Channel Allocator Policy %r' % val)
124
Pau Espin Pedrol4f23ab52018-10-29 11:30:00 +0100125def gprs_mode(val):
126 if val in ('none', 'gprs', 'egprs'):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200127 return True
Pau Espin Pedrol4f23ab52018-10-29 11:30:00 +0100128 raise ValueError('Unknown GPRS mode %r' % val)
129
Pau Espin Pedrol5dc24592018-08-27 12:53:41 +0200130def codec(val):
131 if val in ('hr1', 'hr2', 'hr3', 'fr1', 'fr2', 'fr3'):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200132 return True
Pau Espin Pedrol5dc24592018-08-27 12:53:41 +0200133 raise ValueError('Unknown Codec value: %r' % val)
134
Pau Espin Pedrol0d455042018-08-27 17:07:41 +0200135def osmo_trx_clock_ref(val):
136 if val in ('internal', 'external', 'gspdo'):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200137 return True
Pau Espin Pedrol0d455042018-08-27 17:07:41 +0200138 raise ValueError('Unknown OsmoTRX clock reference value: %r' % val)
139
Pau Espin Pedrolb6937712020-02-27 18:02:20 +0100140def lte_transmission_mode(val):
141 n = int(val)
142 if n <= 4:
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200143 return True
Pau Espin Pedrolb6937712020-02-27 18:02:20 +0100144 raise ValueError('LTE Transmission Mode %d not in expected range' % n)
145
Andre Puschmann2dcc4312020-03-28 15:34:00 +0100146def duration(val):
147 if val.isdecimal() or val.endswith('m') or val.endswith('h'):
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200148 return True
Andre Puschmann2dcc4312020-03-28 15:34:00 +0100149 raise ValueError('Invalid duration value: %r' % val)
150
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200151INT = 'int'
152STR = 'str'
Pau Espin Pedrolfa9a6d32017-09-12 15:13:21 +0200153UINT = 'uint'
Pau Espin Pedrol404e1502017-08-22 11:17:43 +0200154BOOL_STR = 'bool_str'
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200155BAND = 'band'
156IPV4 = 'ipv4'
157HWADDR = 'hwaddr'
158IMSI = 'imsi'
159KI = 'ki'
160MSISDN = 'msisdn'
Pau Espin Pedrol713ce2c2017-08-24 16:57:17 +0200161AUTH_ALGO = 'auth_algo'
Pau Espin Pedrolead79ac2017-09-12 15:19:18 +0200162TIMES='times'
Pau Espin Pedrol57497a62017-08-28 14:21:15 +0200163CIPHER = 'cipher'
Pau Espin Pedrolac18fd32017-08-31 18:49:47 +0200164MODEM_FEATURE = 'modem_feature'
Pau Espin Pedrolc9b63762018-05-07 01:57:01 +0200165PHY_CHAN = 'chan'
Pau Espin Pedrol722e94e2018-08-22 11:01:32 +0200166CHAN_ALLOCATOR = 'chan_allocator'
Pau Espin Pedrol4f23ab52018-10-29 11:30:00 +0100167GPRS_MODE = 'gprs_mode'
Pau Espin Pedrol5dc24592018-08-27 12:53:41 +0200168CODEC = 'codec'
Pau Espin Pedrol0d455042018-08-27 17:07:41 +0200169OSMO_TRX_CLOCK_REF = 'osmo_trx_clock_ref'
Pau Espin Pedrolb6937712020-02-27 18:02:20 +0100170LTE_TRANSMISSION_MODE = 'lte_transmission_mode'
Andre Puschmann2dcc4312020-03-28 15:34:00 +0100171DURATION = 'duration'
Pau Espin Pedrolac18fd32017-08-31 18:49:47 +0200172
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200173SCHEMA_TYPES = {
174 INT: int,
175 STR: str,
Pau Espin Pedrolfa9a6d32017-09-12 15:13:21 +0200176 UINT: uint,
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200177 BOOL_STR: bool_str,
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200178 BAND: band,
179 IPV4: ipv4,
180 HWADDR: hwaddr,
181 IMSI: imsi,
182 KI: ki,
183 MSISDN: msisdn,
Pau Espin Pedrol713ce2c2017-08-24 16:57:17 +0200184 AUTH_ALGO: auth_algo,
Pau Espin Pedrolead79ac2017-09-12 15:19:18 +0200185 TIMES: times,
Pau Espin Pedrol57497a62017-08-28 14:21:15 +0200186 CIPHER: cipher,
Pau Espin Pedrolac18fd32017-08-31 18:49:47 +0200187 MODEM_FEATURE: modem_feature,
Pau Espin Pedrolc9b63762018-05-07 01:57:01 +0200188 PHY_CHAN: phy_channel_config,
Pau Espin Pedrol722e94e2018-08-22 11:01:32 +0200189 CHAN_ALLOCATOR: channel_allocator,
Pau Espin Pedrol4f23ab52018-10-29 11:30:00 +0100190 GPRS_MODE: gprs_mode,
Pau Espin Pedrol5dc24592018-08-27 12:53:41 +0200191 CODEC: codec,
Pau Espin Pedrol0d455042018-08-27 17:07:41 +0200192 OSMO_TRX_CLOCK_REF: osmo_trx_clock_ref,
Pau Espin Pedrolb6937712020-02-27 18:02:20 +0100193 LTE_TRANSMISSION_MODE: lte_transmission_mode,
Andre Puschmann2dcc4312020-03-28 15:34:00 +0100194 DURATION: duration,
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200195 }
196
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200197def add(dest, src):
198 if util.is_dict(dest):
199 if not util.is_dict(src):
200 raise ValueError('cannot add to dict a value of type: %r' % type(src))
201
202 for key, val in src.items():
203 dest_val = dest.get(key)
204 if dest_val is None:
205 dest[key] = val
206 else:
207 log.ctx(key=key)
208 add(dest_val, val)
209 return
210 if util.is_list(dest):
211 if not util.is_list(src):
212 raise ValueError('cannot add to list a value of type: %r' % type(src))
213 dest.extend(src)
214 return
215 if dest == src:
216 return
217 raise ValueError('cannot add dicts, conflicting items (values %r and %r)'
218 % (dest, src))
219
220def combine(dest, src):
221 if util.is_dict(dest):
222 if not util.is_dict(src):
223 raise ValueError('cannot combine dict with a value of type: %r' % type(src))
224
225 for key, val in src.items():
226 log.ctx(key=key)
227 dest_val = dest.get(key)
228 if dest_val is None:
229 dest[key] = val
230 else:
231 combine(dest_val, val)
232 return
233 if util.is_list(dest):
234 if not util.is_list(src):
235 raise ValueError('cannot combine list with a value of type: %r' % type(src))
236 # Validate that all elements in both lists are of the same type:
237 t = util.list_validate_same_elem_type(src + dest)
238 if t is None:
239 return # both lists are empty, return
240 # For lists of complex objects, we expect them to be sorted lists:
241 if t in (dict, list, tuple):
242 for i in range(len(dest)):
243 log.ctx(idx=i)
244 src_it = src[i] if i < len(src) else util.empty_instance_type(t)
245 combine(dest[i], src_it)
246 for i in range(len(dest), len(src)):
247 log.ctx(idx=i)
248 dest.append(src[i])
249 else: # for lists of basic elements, we handle them as unsorted sets:
250 for elem in src:
251 if elem not in dest:
252 dest.append(elem)
253 return
254 if dest == src:
255 return
256 raise ValueError('cannot combine dicts, conflicting items (values %r and %r)'
257 % (dest, src))
258
259def replicate_times(d):
260 '''
261 replicate items that have a "times" > 1
262
263 'd' is a dict matching WANT_SCHEMA, which is the same as
264 the RESOURCES_SCHEMA, except each entity that can be reserved has a 'times'
265 field added, to indicate how many of those should be reserved.
266 '''
267 d = copy.deepcopy(d)
268 for key, item_list in d.items():
269 idx = 0
270 while idx < len(item_list):
271 item = item_list[idx]
272 times = int(item.pop('times', 1))
273 for j in range(1, times):
274 item_list.insert(idx + j, copy.deepcopy(item))
275 idx += times
276 return d
277
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200278def validate(config, schema):
279 '''Make sure the given config dict adheres to the schema.
280 The schema is a dict of 'dict paths' in dot-notation with permitted
281 value type. All leaf nodes are validated, nesting dicts are implicit.
282
283 validate( { 'a': 123, 'b': { 'b1': 'foo', 'b2': [ 1, 2, 3 ] } },
284 { 'a': int,
285 'b.b1': str,
286 'b.b2[]': int } )
287
288 Raise a ValueError in case the schema is violated.
289 '''
290
291 def validate_item(path, value, schema):
292 want_type = schema.get(path)
293
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200294 if util.is_list(value):
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200295 if want_type:
296 raise ValueError('config item is a list, should be %r: %r' % (want_type, path))
297 path = path + '[]'
298 want_type = schema.get(path)
299
300 if not want_type:
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200301 if util.is_dict(value):
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200302 nest(path, value, schema)
303 return
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200304 if util.is_list(value) and value:
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200305 for list_v in value:
306 validate_item(path, list_v, schema)
307 return
308 raise ValueError('config item not known: %r' % path)
309
310 if want_type not in SCHEMA_TYPES:
311 raise ValueError('unknown type %r at %r' % (want_type, path))
312
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200313 if util.is_dict(value):
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200314 raise ValueError('config item is dict but should be a leaf node of type %r: %r'
315 % (want_type, path))
316
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200317 if util.is_list(value):
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200318 for list_v in value:
319 validate_item(path, list_v, schema)
320 return
321
Neels Hofmeyr1a7a3f02017-06-10 01:18:27 +0200322 log.ctx(path)
323 type_validator = SCHEMA_TYPES.get(want_type)
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200324 valid = type_validator(value)
325 if not valid:
326 raise ValueError('Invalid value %r for schema type \'%s\' (validator: %s)' % (value, want_type, type_validator.__name__))
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200327
328 def nest(parent_path, config, schema):
329 if parent_path:
330 parent_path = parent_path + '.'
331 else:
332 parent_path = ''
333 for k,v in config.items():
334 if not KEY_RE.fullmatch(k):
335 raise ValueError('invalid config key: %r' % k)
336 path = parent_path + k
337 validate_item(path, v, schema)
338
339 nest(None, config, schema)
340
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200341def config_to_schema_def(src, key_prefix):
342 'Converts a yaml parsed config into a schema dictionary used by validate()'
343 if util.is_dict(src):
344 out_dict = {}
345 for key, val in src.items():
346 list_token = ''
347 dict_token = ''
348 if util.is_list(val):
349 list_token = '[]'
350 assert len(val) == 1
351 val = val[0]
352 if util.is_dict(val):
353 dict_token = '.'
354 tmp_out = config_to_schema_def(val, "%s%s%s%s" %(key_prefix, key, list_token, dict_token))
355 out_dict = {**out_dict, **tmp_out}
356 return out_dict
357
358 # base case: string
359 return {key_prefix: str(src)}
360
361
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200362def generate_schemas():
363 "Generate supported schemas dynamically from objects"
364 obj_dir = '%s/../obj/' % os.path.dirname(os.path.abspath(__file__))
365 for filename in os.listdir(obj_dir):
366 if not filename.endswith(".py"):
367 continue
368 module_name = 'osmo_gsm_tester.obj.%s' % filename[:-3]
369 util.run_python_file_method(module_name, 'on_register_schemas', False)
370
371
372_RESOURCE_TYPES = ['ip_address', 'arfcn']
373
374_RESOURCES_SCHEMA = {
375 'ip_address[].addr': IPV4,
376 'arfcn[].arfcn': INT,
377 'arfcn[].band': BAND,
378 }
379
380_CONFIG_SCHEMA = {}
381
382_WANT_SCHEMA = None
383_ALL_SCHEMA = None
384
Pau Espin Pedrold79e7192020-05-21 15:40:57 +0200385def register_schema_types(schema_type_attr):
386 """Register schema types to be used by schema attributes.
387 For instance: register_resource_schema_attributes({ 'fruit': lambda val: val in ('banana', 'apple') })
388 """
389 global SCHEMA_TYPES
390 combine(SCHEMA_TYPES, schema_type_attr)
391
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200392def register_resource_schema(obj_class_str, obj_attr_dict):
393 """Register schema attributes for a resource type.
394 For instance: register_resource_schema_attributes('modem', {'type': schema.STR, 'ki': schema.KI})
395 """
396 global _RESOURCES_SCHEMA
397 global _RESOURCE_TYPES
398 tmpdict = {}
399 for key, val in obj_attr_dict.items():
400 new_key = '%s[].%s' % (obj_class_str, key)
401 tmpdict[new_key] = val
402 combine(_RESOURCES_SCHEMA, tmpdict)
403 if obj_class_str not in _RESOURCE_TYPES:
404 _RESOURCE_TYPES.append(obj_class_str)
405
406def register_config_schema(obj_class_str, obj_attr_dict):
407 """Register schema attributes to configure all instances of an object class.
408 For instance: register_resource_schema_attributes('bsc', {'net.codec_list[]': schema.CODEC})
409 """
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200410 global _CONFIG_SCHEMA, _ALL_SCHEMA
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200411 tmpdict = {}
412 for key, val in obj_attr_dict.items():
413 new_key = '%s.%s' % (obj_class_str, key)
414 tmpdict[new_key] = val
415 combine(_CONFIG_SCHEMA, tmpdict)
Pau Espin Pedrol30637302020-05-06 21:11:02 +0200416 _ALL_SCHEMA = None # reset _ALL_SCHEMA so it is re-generated next time it's requested.
Pau Espin Pedrolea8c3d42020-05-04 12:05:05 +0200417
418def get_resources_schema():
419 return _RESOURCES_SCHEMA;
420
421def get_want_schema():
422 global _WANT_SCHEMA
423 if _WANT_SCHEMA is None:
424 _WANT_SCHEMA = util.dict_add(
425 dict([('%s[].times' % r, TIMES) for r in _RESOURCE_TYPES]),
426 get_resources_schema())
427 return _WANT_SCHEMA
428
429def get_all_schema():
430 global _ALL_SCHEMA
431 if _ALL_SCHEMA is None:
432 want_schema = get_want_schema()
433 _ALL_SCHEMA = util.dict_add({ 'defaults.timeout': STR },
434 dict([('config.%s' % key, val) for key, val in _CONFIG_SCHEMA.items()]),
435 dict([('resources.%s' % key, val) for key, val in want_schema.items()]),
436 dict([('modifiers.%s' % key, val) for key, val in want_schema.items()]))
437 return _ALL_SCHEMA
438
Neels Hofmeyr3531a192017-03-28 14:30:28 +0200439# vim: expandtab tabstop=4 shiftwidth=4