[prev in list] [next in list] [prev in thread] [next in thread] 

List:       lnst-developers
Subject:    [lnst] schema-recipe: task can't be empty
From:       Jiří Pírko <jirka () fedoraproject ! org>
Date:       2013-10-18 7:04:49
Message-ID: 20131018070449.82C8360E80 () fedorahosted ! org
[Download RAW message or body]

commit 0622d105824e189e0951e8f73c53894c357c5325
Author: Ondrej Lichtner <olichtne@redhat.com>
Date:   Mon Oct 14 13:50:28 2013 +0200

    schema-recipe: task can't be empty
    
    The scheme allowed the existence of empty tasks, which would later cause
    an expcetion during the recipe execution.
    
    This patch fixes the schema so that there is always at least one command
    in the schema. The solution isn't perfect since now the error reported
    is something like "expected element <run>" which isn't entirely true
    (for e.g. <config> can be found as well), but it will do for now.
    
    Signed-off-by: Ondrej Lichtner <olichtne@redhat.com>
    Signed-off-by: Jiri Pirko <jiri@resnulli.us>

 schema-recipe.rng |   26 +++++++-------------------
 1 files changed, 7 insertions(+), 19 deletions(-)
---
diff --git a/schema-recipe.rng b/schema-recipe.rng
index c211b11..bd0a8df 100644
--- a/schema-recipe.rng
+++ b/schema-recipe.rng
@@ -65,30 +65,18 @@
                 </attribute>
             </optional>
 
-            <interleave>
-                <optional>
-                    <ref name="define"/>
-                </optional>
-
-                <zeroOrMore>
-                    <ref name="config"/>
-                </zeroOrMore>
-                <zeroOrMore>
+            <oneOrMore>
+                <choice>
                     <ref name="run"/>
-                </zeroOrMore>
-                <zeroOrMore>
+                    <ref name="config"/>
                     <ref name="wait"/>
-                </zeroOrMore>
-                <zeroOrMore>
                     <ref name="intr"/>
-                </zeroOrMore>
-                <zeroOrMore>
                     <ref name="kill"/>
-                </zeroOrMore>
-                <zeroOrMore>
                     <ref name="ctl_wait"/>
-                </zeroOrMore>
-            </interleave>
+
+                    <ref name="define"/>
+                </choice>
+            </oneOrMore>
         </element>
     </define>
 
_______________________________________________
LNST-developers mailing list
LNST-developers@lists.fedorahosted.org
https://lists.fedorahosted.org/mailman/listinfo/lnst-developers

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic