示例#1
0
def _priority_class_from_spec(spec):
    if spec['template'] not in PRIORITY_CLASS_MAP.keys():
        raise InvalidRuleException("Unknown template: %s" % (spec['kind']))
    pc = PRIORITY_CLASS_MAP[spec['template']]

    if spec['scope'] == 'device':
        pc += len(PRIORITY_CLASS_MAP)

    return pc
示例#2
0
def _priority_class_from_spec(spec):
    if spec['template'] not in PRIORITY_CLASS_MAP.keys():
        raise InvalidRuleException("Unknown template: %s" % (spec['kind']))
    pc = PRIORITY_CLASS_MAP[spec['template']]

    if spec['scope'] == 'device':
        pc += len(PRIORITY_CLASS_MAP)

    return pc
def _priority_class_from_spec(spec):
    if spec['template'] not in PRIORITY_CLASS_MAP.keys():
        raise InvalidRuleException("Unknown template: %s" % (spec['template']))
    pc = PRIORITY_CLASS_MAP[spec['template']]

    return pc
示例#4
0
def _priority_class_from_spec(spec):
    if spec['template'] not in PRIORITY_CLASS_MAP.keys():
        raise InvalidRuleException("Unknown template: %s" % (spec['template']))
    pc = PRIORITY_CLASS_MAP[spec['template']]

    return pc
示例#5
0
def _add_empty_priority_class_arrays(d):
    for pc in PRIORITY_CLASS_MAP.keys():
        d[pc] = []
    return d
示例#6
0
def _add_empty_priority_class_arrays(d: Dict[str, list]) -> Dict[str, list]:
    for pc in PRIORITY_CLASS_MAP.keys():
        d[pc] = []
    return d
示例#7
0
def _add_empty_priority_class_arrays(d):
    for pc in PRIORITY_CLASS_MAP.keys():
        d[pc] = []
    return d
示例#8
0
def _priority_class_from_spec(spec: RuleSpec) -> int:
    if spec.template not in PRIORITY_CLASS_MAP.keys():
        raise InvalidRuleException("Unknown template: %s" % (spec.template))
    pc = PRIORITY_CLASS_MAP[spec.template]

    return pc