Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F4624422
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
19 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/xml/Makefile.am b/xml/Makefile.am
index e9cd875ca1..a73abef951 100644
--- a/xml/Makefile.am
+++ b/xml/Makefile.am
@@ -1,72 +1,76 @@
#
# Copyright (C) 2004 Andrew Beekhof
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 2
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
MAINTAINERCLEANFILES = Makefile.in
dtddir = $(CRM_DTD_DIRECTORY)
dtd_SCRIPTS = crm.dtd crm-transitional.dtd
-schema_VERSIONS = 1.2 next
-schema_GENERATED = pacemaker.rng $(foreach base,$(schema_VERSIONS),pacemaker-$(base).rng)
+xsltdir = $(dtddir)
+xslt_SCRIPTS = upgrade06.xsl upgrade11.xsl
-schemadir = $(CRM_DTD_DIRECTORY)
-RNG_cfg_files = options nodes resources constraints fencing acls unused
-RNG_files = cib $(RNG_cfg_files) status versions score rule nvset
-schema_SCRIPTS = $(foreach base,$(RNG_files),$(wildcard $(base)*.rng)) $(schema_GENERATED) \
- pacemaker-1.0.rng upgrade06.xsl upgrade11.xsl
-
-EXTRA_DIST = $(schema_SCRIPTS) $(dtd_SCRIPTS)
+RNGdir = $(dtddir)
# See Readme.md for details on updating schema files
+RNG_versions = 1.0 1.2 next
+RNG_generated = pacemaker.rng $(foreach base,$(RNG_versions),pacemaker-$(base).rng)
+
+RNG_cfg_base = options nodes resources constraints fencing acls
+RNG_base = cib $(RNG_cfg_base) status versions score rule nvset
+RNG_files = $(foreach base,$(RNG_base),$(wildcard $(base)*.rng))
+
+RNG_SCRIPTS = $(RNG_files) $(RNG_generated)
+
+# Needed?
+EXTRA_DIST = $(RNG_SCRIPTS) $(dtd_SCRIPTS) $(xslt_SCRIPTS)
best_match = $(shell $(top_srcdir)/xml/best-match.sh $(1) $(2))
pacemaker.rng: pacemaker-$(CRM_DTD_VERSION).rng
cp $(top_builddir)/xml/$< $@
-pacemaker-%.rng:
+pacemaker-%.rng:
echo "<?xml version='1.0' encoding='UTF-8'?>" > $@
echo "<grammar xmlns='http://relaxng.org/ns/structure/1.0' datatypeLibrary='http://www.w3.org/2001/XMLSchema-datatypes'>" >> $@
echo " <start>" >> $@
echo " <element name='cib'>" >> $@
- echo " <externalRef href=\"$(call best_match,cib,$*)\"/>" >> $@
+ $(top_srcdir)/xml/best-match.sh cib $(*) $(@) " "
echo " <element name='configuration'>" >> $@
echo " <interleave>" >> $@
- echo -e " "$(foreach rng,$(RNG_cfg_files)," <externalRef href=\"$(call best_match,$(rng),$*)\"/>\n") >> $@
+ for rng in $(RNG_cfg_base); do $(top_srcdir)/xml/best-match.sh $$rng $(*) $(@) " "; done
echo " </interleave>" >> $@
echo " </element>" >> $@
echo " <element name='status'>" >> $@
- echo " <externalRef href=\"$(call best_match,status,$*)\"/>" >> $@
+ $(top_srcdir)/xml/best-match.sh status $(*) $(@) " "
echo " </element>" >> $@
echo " </element>" >> $@
echo " </start>" >> $@
echo "</grammar>" >> $@
-
- echo "Created $@"
+ cat $@
rng_next = $(shell echo $(wildcard *-next.rng) | sed 's/-next.rng//g')
diff:
echo "Comparing changes to: $(rng_next)"
for rng in $(rng_next); do echo "### $${rng}"; diff -u $${rng}-$(CRM_DTD_VERSION).rng $${rng}-next.rng; done
echo "Done"
sync:
git rm -f $(wildcard *-next.rng)
make pacemaker-next.rng
clean:
- rm -f $(schema_GENERATED)
+ rm -f $(RNG_generated)
diff --git a/xml/best-match.sh b/xml/best-match.sh
index f6e3dc8a5a..299df5df82 100755
--- a/xml/best-match.sh
+++ b/xml/best-match.sh
@@ -1,40 +1,49 @@
#!/bin/bash
base=$1; shift
target=$1; shift
+destination=$1; shift
+prefix=$1; shift
+
+echo "$base $target $destination" 1>&2
+
best="0.0"
candidates=$(ls -1 ${base}-*.rng 2>/dev/null)
for rng in $candidates; do
case $rng in
${base}-${target}.rng)
- echo $rng
- exit
+ best=${target}
+ break
;;
*next*)
: skipping $rng
;;
*)
v=$(echo $rng | sed -e "s/${base}-//" -e 's/.rng//')
: comparing $v with $target
rc=$(echo "$v > ${best}" | bc)
if [ $rc = 1 ]; then
: $v beats the previous ${best} for $target
if [ ${target} = next ]; then
best=$v
else
rc=$(echo "$v < ${target}" | bc)
if [ $rc = 1 ]; then
: $v is still less than $target, using
best=$v
fi
fi
fi
;;
esac
done
+
if [ "x${best}" != "x0.0" ]; then
- echo ${base}-${best}.rng
-else
- echo "empty.rng"
+ if [ "x$destination" = x ]; then
+ echo ${base}-${best}.rng
+ else
+ echo "Saving to $destination"
+ echo "$prefix<externalRef href=\"${base}-${best}.rng\"/>" >> ${destination}
+ fi
fi
diff --git a/xml/cib-1.0.rng b/xml/cib-1.0.rng
new file mode 100644
index 0000000000..b05413df5a
--- /dev/null
+++ b/xml/cib-1.0.rng
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<grammar xmlns="http://relaxng.org/ns/structure/1.0"
+ datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
+ <start>
+ <ref name="attribute-options"/>
+ </start>
+
+ <define name="attribute-options">
+ <externalRef href="versions.rng"/>
+ <optional>
+ <attribute name="crm_feature_set"><text/></attribute>
+ </optional>
+ <optional>
+ <attribute name="remote-tls-port"><data type="nonNegativeInteger"/></attribute>
+ </optional>
+ <optional>
+ <attribute name="remote-clear-port"><data type="nonNegativeInteger"/></attribute>
+ </optional>
+ <optional>
+ <attribute name="have-quorum"><data type="boolean"/></attribute>
+ </optional>
+ <optional>
+ <attribute name="dc-uuid"><text/></attribute>
+ </optional>
+ <optional>
+ <attribute name="cib-last-written"><text/></attribute>
+ </optional>
+ <optional>
+ <attribute name="no-quorum-panic"><data type="boolean"/></attribute>
+ </optional>
+ </define>
+
+</grammar>
diff --git a/xml/constraints-1.0.rng b/xml/constraints-1.0.rng
index 5a4474a597..e8e04e2832 100644
--- a/xml/constraints-1.0.rng
+++ b/xml/constraints-1.0.rng
@@ -1,180 +1,182 @@
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<ref name="element-constraints"/>
</start>
<define name="element-constraints">
+ <element name="constraints">
<zeroOrMore>
<choice>
<ref name="element-location"/>
<ref name="element-colocation"/>
<ref name="element-order"/>
</choice>
</zeroOrMore>
+ </element>
</define>
<define name="element-location">
<element name="rsc_location">
<attribute name="id"><data type="ID"/></attribute>
<attribute name="rsc"><data type="IDREF"/></attribute>
<choice>
<group>
<externalRef href="score.rng"/>
<attribute name="node"><text/></attribute>
</group>
<oneOrMore>
<externalRef href="rule.rng"/>
</oneOrMore>
</choice>
<optional>
<ref name="element-lifetime"/>
</optional>
</element>
</define>
<define name="element-resource-set">
<element name="resource_set">
<choice>
<attribute name="id-ref"><data type="IDREF"/></attribute>
<group>
<attribute name="id"><data type="ID"/></attribute>
<optional>
<attribute name="sequential"><data type="boolean"/></attribute>
</optional>
<optional>
<attribute name="action">
<ref name="attribute-actions"/>
</attribute>
</optional>
<optional>
<attribute name="role">
<ref name="attribute-roles"/>
</attribute>
</optional>
<optional>
<externalRef href="score.rng"/>
</optional>
<oneOrMore>
<element name="resource_ref">
<attribute name="id"><data type="IDREF"/></attribute>
</element>
</oneOrMore>
</group>
</choice>
</element>
</define>
<define name="element-colocation">
<element name="rsc_colocation">
<attribute name="id"><data type="ID"/></attribute>
<optional>
<choice>
<externalRef href="score.rng"/>
<attribute name="score-attribute"><text/></attribute>
<attribute name="score-attribute-mangle"><text/></attribute>
</choice>
</optional>
<optional>
<ref name="element-lifetime"/>
</optional>
<choice>
<oneOrMore>
<ref name="element-resource-set"/>
</oneOrMore>
<group>
<attribute name="rsc"><data type="IDREF"/></attribute>
<attribute name="with-rsc"><data type="IDREF"/></attribute>
<optional>
<attribute name="node-attribute"><text/></attribute>
</optional>
<optional>
<attribute name="rsc-role">
<ref name="attribute-roles"/>
</attribute>
</optional>
<optional>
<attribute name="with-rsc-role">
<ref name="attribute-roles"/>
</attribute>
</optional>
</group>
</choice>
</element>
</define>
<define name="element-order">
<element name="rsc_order">
<attribute name="id"><data type="ID"/></attribute>
<optional>
<ref name="element-lifetime"/>
</optional>
<optional>
<attribute name="symmetrical"><data type="boolean"/></attribute>
</optional>
<optional>
<choice>
<externalRef href="score.rng"/>
<attribute name="kind">
<ref name="order-types"/>
</attribute>
</choice>
</optional>
<choice>
<oneOrMore>
<ref name="element-resource-set"/>
</oneOrMore>
<group>
<attribute name="first"><data type="IDREF"/></attribute>
<attribute name="then"><data type="IDREF"/></attribute>
<optional>
<attribute name="first-action">
<ref name="attribute-actions"/>
</attribute>
</optional>
<optional>
<attribute name="then-action">
<ref name="attribute-actions"/>
</attribute>
</optional>
</group>
</choice>
</element>
</define>
<define name="attribute-actions">
<choice>
<value>start</value>
<value>promote</value>
<value>demote</value>
<value>stop</value>
</choice>
</define>
<define name="attribute-roles">
<choice>
<value>Stopped</value>
<value>Started</value>
<value>Master</value>
<value>Slave</value>
</choice>
</define>
<define name="order-types">
<choice>
<value>Optional</value>
<value>Mandatory</value>
<value>Serialize</value>
</choice>
</define>
<define name="element-lifetime">
<element name="lifetime">
<oneOrMore>
<externalRef href="rule.rng"/>
</oneOrMore>
</element>
</define>
</grammar>
diff --git a/xml/options-1.2.rng b/xml/options-1.0.rng
similarity index 100%
rename from xml/options-1.2.rng
rename to xml/options-1.0.rng
diff --git a/xml/pacemaker-1.0.rng b/xml/pacemaker-1.0.rng
deleted file mode 100644
index 71003932fe..0000000000
--- a/xml/pacemaker-1.0.rng
+++ /dev/null
@@ -1,121 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- types: http://www.w3.org/TR/xmlschema-2/#dateTime -->
-<grammar xmlns="http://relaxng.org/ns/structure/1.0"
- datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
- <start>
- <element name="cib">
- <ref name="element-cib"/>
- </element>
- </start>
-
- <define name="element-cib">
- <ref name="attribute-options"/>
- <element name="configuration">
- <interleave>
- <element name="crm_config">
- <zeroOrMore>
- <element name="cluster_property_set">
- <externalRef href="nvset.rng"/>
- </element>
- </zeroOrMore>
- </element>
- <optional>
- <element name="rsc_defaults">
- <zeroOrMore>
- <element name="meta_attributes">
- <externalRef href="nvset.rng"/>
- </element>
- </zeroOrMore>
- </element>
- </optional>
- <optional>
- <element name="op_defaults">
- <zeroOrMore>
- <element name="meta_attributes">
- <externalRef href="nvset.rng"/>
- </element>
- </zeroOrMore>
- </element>
- </optional>
- <ref name="element-nodes"/>
- <element name="resources">
- <externalRef href="resources-1.0.rng"/>
- </element>
- <element name="constraints">
- <externalRef href="constraints-1.0.rng"/>
- </element>
- </interleave>
- </element>
- <element name="status">
- <ref name="element-status"/>
- </element>
- </define>
-
- <define name="attribute-options">
- <externalRef href="versions.rng"/>
- <optional>
- <attribute name="crm_feature_set"><text/></attribute>
- </optional>
- <optional>
- <attribute name="remote-tls-port"><data type="nonNegativeInteger"/></attribute>
- </optional>
- <optional>
- <attribute name="remote-clear-port"><data type="nonNegativeInteger"/></attribute>
- </optional>
- <optional>
- <attribute name="have-quorum"><data type="boolean"/></attribute>
- </optional>
- <optional>
- <attribute name="dc-uuid"><text/></attribute>
- </optional>
- <optional>
- <attribute name="cib-last-written"><text/></attribute>
- </optional>
- <optional>
- <attribute name="no-quorum-panic"><data type="boolean"/></attribute>
- </optional>
- </define>
-
- <define name="element-nodes">
- <element name="nodes">
- <zeroOrMore>
- <element name="node">
- <attribute name="id"><text/></attribute>
- <attribute name="uname"><text/></attribute>
- <attribute name="type">
- <choice>
- <value>normal</value>
- <value>member</value>
- <value>ping</value>
- </choice>
- </attribute>
- <optional>
- <attribute name="description"><text/></attribute>
- </optional>
- <zeroOrMore>
- <element name="instance_attributes">
- <externalRef href="nvset.rng"/>
- </element>
- </zeroOrMore>
- </element>
- </zeroOrMore>
- </element>
- </define>
-
- <define name="element-status">
- <zeroOrMore>
- <choice>
- <attribute>
- <anyName/>
- <text/>
- </attribute>
- <element>
- <anyName/>
- <ref name="element-status"/>
- </element>
- <text/>
- </choice>
- </zeroOrMore>
- </define>
-
-</grammar>
diff --git a/xml/resources-1.0.rng b/xml/resources-1.0.rng
index 7ea2228aa0..aa456cdf91 100644
--- a/xml/resources-1.0.rng
+++ b/xml/resources-1.0.rng
@@ -1,177 +1,179 @@
<?xml version="1.0" encoding="UTF-8"?>
<grammar xmlns="http://relaxng.org/ns/structure/1.0"
datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
<start>
<ref name="element-resources"/>
</start>
<define name="element-resources">
+ <element name="resources">
<zeroOrMore>
<choice>
<ref name="element-primitive"/>
<ref name="element-group"/>
<ref name="element-clone"/>
<ref name="element-master"/>
</choice>
</zeroOrMore>
+ </element>
</define>
<define name="element-primitive">
<element name="primitive">
<interleave>
<attribute name="id"><data type="ID"/></attribute>
<choice>
<group>
<attribute name="class"><value>ocf</value></attribute>
<attribute name="provider"><text/></attribute>
</group>
<attribute name="class">
<choice>
<value>lsb</value>
<value>heartbeat</value>
<value>stonith</value>
<value>upstart</value>
</choice>
</attribute>
</choice>
<attribute name="type"><text/></attribute>
<optional>
<attribute name="description"><text/></attribute>
</optional>
<ref name="element-resource-extra"/>
<ref name="element-operations"/>
</interleave>
</element>
</define>
<define name="element-group">
<element name="group">
<attribute name="id"><data type="ID"/></attribute>
<optional>
<attribute name="description"><text/></attribute>
</optional>
<interleave>
<ref name="element-resource-extra"/>
<oneOrMore>
<ref name="element-primitive"/>
</oneOrMore>
</interleave>
</element>
</define>
<define name="element-clone">
<element name="clone">
<attribute name="id"><data type="ID"/></attribute>
<optional>
<attribute name="description"><text/></attribute>
</optional>
<interleave>
<ref name="element-resource-extra"/>
<choice>
<ref name="element-primitive"/>
<ref name="element-group"/>
</choice>
</interleave>
</element>
</define>
<define name="element-master">
<element name="master">
<attribute name="id"><data type="ID"/></attribute>
<optional>
<attribute name="description"><text/></attribute>
</optional>
<interleave>
<ref name="element-resource-extra"/>
<choice>
<ref name="element-primitive"/>
<ref name="element-group"/>
</choice>
</interleave>
</element>
</define>
<define name="element-resource-extra">
<zeroOrMore>
<choice>
<element name="meta_attributes">
<externalRef href="nvset.rng"/>
</element>
<element name="instance_attributes">
<externalRef href="nvset.rng"/>
</element>
</choice>
</zeroOrMore>
</define>
<define name="element-operations">
<optional>
<element name="operations">
<optional>
<attribute name="id"><data type="ID"/></attribute>
</optional>
<optional>
<attribute name="id-ref"><data type="IDREF"/></attribute>
</optional>
<zeroOrMore>
<element name="op">
<attribute name="id"><data type="ID"/></attribute>
<attribute name="name"><text/></attribute>
<attribute name="interval"><text/></attribute>
<optional>
<attribute name="description"><text/></attribute>
</optional>
<optional>
<choice>
<attribute name="start-delay"><text/></attribute>
<attribute name="interval-origin"><text/></attribute>
</choice>
</optional>
<optional>
<attribute name="timeout"><text/></attribute>
</optional>
<optional>
<attribute name="enabled"><data type="boolean"/></attribute>
</optional>
<optional>
<attribute name="record-pending"><data type="boolean"/></attribute>
</optional>
<optional>
<attribute name="role">
<choice>
<value>Stopped</value>
<value>Started</value>
<value>Slave</value>
<value>Master</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="requires">
<choice>
<value>nothing</value>
<value>quorum</value>
<value>fencing</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="on-fail">
<choice>
<value>ignore</value>
<value>block</value>
<value>stop</value>
<value>restart</value>
<value>standby</value>
<value>fence</value>
</choice>
</attribute>
</optional>
<ref name="element-resource-extra"/>
</element>
</zeroOrMore>
</element>
</optional>
</define>
</grammar>
diff --git a/xml/status-1.2.rng b/xml/status-1.0.rng
similarity index 100%
rename from xml/status-1.2.rng
rename to xml/status-1.0.rng
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Tue, Jul 8, 6:21 PM (12 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2002596
Default Alt Text
(19 KB)
Attached To
Mode
rP Pacemaker
Attached
Detach File
Event Timeline
Log In to Comment