def load_tcconfig(self, config_file_path):
import json
from voluptuous import Schema, Required, Any, ALLOW_EXTRA
schema = Schema({
Required(six.text_type): {
Any(*TrafficDirection.LIST): {
six.text_type: {
six.text_type: Any(six.text_type, int, float)
},
}
},
}, extra=ALLOW_EXTRA)
with open(config_file_path) as fp:
self.__config_table = json.load(fp)
schema(self.__config_table)
self.__logger.debug("tc config file: {:s}".format(
json.dumps(self.__config_table, indent=4)))
评论列表
文章目录