commit 0622d105824e189e0951e8f73c53894c357c5325
Author: Ondrej Lichtner <olichtne(a)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(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)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>
Show replies by date