예제 #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