예제 #1
0
파일: constraint.py 프로젝트: rriifftt/pcs
 def normalize(constraint_el):
     return (
         constraint_el.getAttribute("rsc"),
         [
             rule_utils.ExportAsExpression().get_string(rule_el, True)
             for rule_el in constraint_el.getElementsByTagName("rule")
         ]
     )
예제 #2
0
 def normalize(constraint_el):
     if constraint_el.hasAttribute("rsc-pattern"):
         rsc = (RESOURCE_TYPE_REGEXP,
                constraint_el.getAttribute("rsc-pattern"))
     else:
         rsc = (RESOURCE_TYPE_RESOURCE, constraint_el.getAttribute("rsc"))
     return (rsc, [
         rule_utils.ExportAsExpression().get_string(rule_el, True)
         for rule_el in constraint_el.getElementsByTagName("rule")
     ])