Page Menu
Home
ClusterLabs Projects
Search
Configure Global Search
Log In
Files
F2822984
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
38 KB
Referenced Files
None
Subscribers
None
View Options
diff --git a/cts/schemas/test-3/ref/nagios.ref-4 b/cts/schemas/test-3/ref/nagios.ref-4
index 6d5ecca944..4719168f78 100644
--- a/cts/schemas/test-3/ref/nagios.ref-4
+++ b/cts/schemas/test-3/ref/nagios.ref-4
@@ -1,188 +1,111 @@
<cib crm_feature_set="3.19.7" validate-with="pacemaker-4.0" epoch="8" num_updates="0" admin_epoch="0" original="1">
<configuration original="1">
<!-- The essential elements of this test are:
* There is an nagios template and an ocf template.
* There are nagios and ocf primitives, defined either inline or by
reference to the corresponding template.
* There is a group with only nagios primitives and a group with both
nagios and ocf primitives.
* There is a cloned nagios resource and a cloned ocf resource.
* There is a cloned group containing only nagios primitives and a
cloned group containing both nagios and ocf primitives.
* There is a bundle containing an nagios primitive.
* There are various constraints, many of which reference nagios
resources.
In this situation:
* The nagios templates and primitives should be dropped, while the ocf
ones should be kept.
* Groups and clones that would become empty should be dropped.
* Groups containing ocf primitives should be kept; only their nagios
members should be dropped.
* The bundle should be kept so that its container remains managed; its
primitive should be dropped.
* Constraints with attributes referencing nagios resources should be
dropped.
* Resource sets containing only references to nagios resources should
be dropped.
* Constraints with resource sets should be dropped if all of their
resource sets should be dropped.
-->
<crm_config original="1"/>
<nodes original="1"/>
<resources original="1">
- <template id="template_drop" class="nagios" type="Dummy" original="1"/>
<template id="template_keep" class="ocf" provider="pacemaker" type="Dummy" original="1"/>
- <primitive id="primitive1_drop" class="nagios" type="Dummy" original="1"/>
<primitive id="primitive2_keep" class="ocf" provider="pacemaker" type="Dummy" original="1"/>
- <primitive id="primitive3_drop" template="template_drop" original="1"/>
<primitive id="primitive4_keep" template="template_keep" original="1"/>
- <group id="grp1_drop" original="1">
- <primitive id="grp1_rsc1_drop" class="nagios" type="Dummy" original="1"/>
- <primitive id="grp1_rsc2_drop" template="template_drop" original="1"/>
- </group>
<group id="grp2_keep" original="1">
- <primitive id="grp2_rsc1_drop" class="nagios" type="Dummy" original="1"/>
<primitive id="grp2_rsc2_keep" class="ocf" provider="pacemaker" type="Dummy" original="1"/>
- <primitive id="grp2_rsc3_drop" template="template_drop" original="1"/>
<primitive id="grp2_rsc4_keep" template="template_keep" original="1"/>
</group>
- <clone id="clone1_drop" original="1">
- <primitive id="clone1_rsc_drop" class="nagios" type="Dummy" original="1"/>
- </clone>
<clone id="clone2_keep" original="1">
<primitive id="clone2_rsc_keep" class="ocf" provider="pacemaker" type="Dummy" original="1"/>
</clone>
- <clone id="clone3_drop" original="1">
- <group id="clone3_grp_drop" original="1">
- <primitive id="clone3_grp_rsc1_drop" class="nagios" type="Dummy" original="1"/>
- <primitive id="clone3_grp_rsc2_drop" template="template_drop" original="1"/>
- </group>
- </clone>
<clone id="clone4_keep" original="1">
<group id="clone4_grp_keep" original="1">
- <primitive id="clone4_grp_rsc1_drop" class="nagios" type="Dummy" original="1"/>
<primitive id="clone4_grp_rsc2_keep" class="ocf" provider="pacemaker" type="Dummy" original="1"/>
- <primitive id="clone4_grp_rsc3_drop" template="template_drop" original="1"/>
<primitive id="clone4_grp_rsc4_keep" template="template_keep" original="1"/>
</group>
</clone>
<bundle id="bundle_keep" original="1">
<podman image="image" original="1"/>
- <primitive id="bundle_rsc_drop" class="nagios" type="Dummy" original="1"/>
</bundle>
</resources>
<constraints original="1">
- <rsc_location id="location1_drop" rsc="primitive1_drop" node="node1" score="INFINITY" original="1"/>
<rsc_location id="location2_keep" rsc="primitive2_keep" node="node1" score="INFINITY" original="1"/>
- <rsc_location id="location3_drop" node="node1" score="INFINITY" original="1">
- <resource_set id="location3_drop-set" original="1">
- <resource_ref id="grp1_drop" original="1"/>
- <resource_ref id="clone1_drop" original="1"/>
- </resource_set>
- </rsc_location>
<rsc_location id="location4_keep" node="node1" score="INFINITY" original="1">
<resource_set id="location4_keep-set" original="1">
<resource_ref id="clone2_keep" original="1"/>
- <resource_ref id="clone3_drop" original="1"/>
<resource_ref id="clone4_keep" original="1"/>
</resource_set>
</rsc_location>
<rsc_location id="location5_keep" node="node1" score="INFINITY" original="1">
- <resource_set id="location5_keep-set_drop" original="1">
- <resource_ref id="grp1_drop" original="1"/>
- <resource_ref id="clone1_drop" original="1"/>
- </resource_set>
<resource_set id="location5_keep-set_keep" original="1">
<resource_ref id="clone2_keep" original="1"/>
- <resource_ref id="clone3_drop" original="1"/>
<resource_ref id="clone4_keep" original="1"/>
</resource_set>
</rsc_location>
<rsc_location id="location6_keep" rsc-pattern="primitive1_drop" node="node1" score="INFINITY" original="1"/>
- <rsc_colocation id="colocation1_drop" rsc="primitive1_drop" with-rsc="primitive2_keep" original="1"/>
- <rsc_colocation id="colocation2_drop" rsc="primitive2_keep" with-rsc="primitive1_drop" original="1"/>
- <rsc_colocation id="colocation3_drop" rsc="primitive3_drop" with-rsc="primitive1_drop" original="1"/>
<rsc_colocation id="colocation4_keep" rsc="primitive4_keep" with-rsc="primitive2_keep" original="1"/>
- <rsc_colocation id="colocation5_drop" original="1">
- <resource_set id="colocation5_drop-set" original="1">
- <resource_ref id="grp1_drop" original="1"/>
- <resource_ref id="clone1_drop" original="1"/>
- </resource_set>
- </rsc_colocation>
<rsc_colocation id="colocation6_keep" original="1">
<resource_set id="colocation6_keep-set" original="1">
<resource_ref id="clone2_keep" original="1"/>
- <resource_ref id="clone3_drop" original="1"/>
<resource_ref id="clone4_keep" original="1"/>
</resource_set>
</rsc_colocation>
<rsc_colocation id="colocation7_keep" original="1">
- <resource_set id="colocation7_keep-set_drop" original="1">
- <resource_ref id="grp1_drop" original="1"/>
- <resource_ref id="clone1_drop" original="1"/>
- </resource_set>
<resource_set id="colocation7_keep-set_keep" original="1">
<resource_ref id="clone2_keep" original="1"/>
- <resource_ref id="clone3_drop" original="1"/>
<resource_ref id="clone4_keep" original="1"/>
</resource_set>
</rsc_colocation>
- <rsc_order id="order1_drop" first="primitive1_drop" then="primitive2_keep" original="1"/>
- <rsc_order id="order2_drop" first="primitive2_keep" then="primitive1_drop" original="1"/>
- <rsc_order id="order3_drop" first="primitive3_drop" then="primitive1_drop" original="1"/>
<rsc_order id="order4_keep" first="primitive4_keep" then="primitive2_keep" original="1"/>
- <rsc_order id="order5_drop" original="1">
- <resource_set id="order5_drop-set" original="1">
- <resource_ref id="grp1_drop" original="1"/>
- <resource_ref id="clone1_drop" original="1"/>
- </resource_set>
- </rsc_order>
<rsc_order id="order6_keep" original="1">
<resource_set id="order6_keep-set" original="1">
<resource_ref id="clone2_keep" original="1"/>
- <resource_ref id="clone3_drop" original="1"/>
<resource_ref id="clone4_keep" original="1"/>
</resource_set>
</rsc_order>
<rsc_order id="order7_keep" original="1">
- <resource_set id="order7_keep-set_drop" original="1">
- <resource_ref id="grp1_drop" original="1"/>
- <resource_ref id="clone1_drop" original="1"/>
- </resource_set>
<resource_set id="order7_keep-set_keep" original="1">
<resource_ref id="clone2_keep" original="1"/>
- <resource_ref id="clone3_drop" original="1"/>
<resource_ref id="clone4_keep" original="1"/>
</resource_set>
</rsc_order>
- <rsc_ticket id="ticket1_drop" rsc="primitive1_drop" ticket="ticket1" original="1"/>
<rsc_ticket id="ticket2_keep" rsc="primitive2_keep" ticket="ticket1" original="1"/>
- <rsc_ticket id="ticket3_drop" ticket="ticket1" original="1">
- <resource_set id="ticket3_drop-set" original="1">
- <resource_ref id="grp1_drop" original="1"/>
- <resource_ref id="clone1_drop" original="1"/>
- </resource_set>
- </rsc_ticket>
<rsc_ticket id="ticket4_keep" ticket="ticket1" original="1">
<resource_set id="ticket4_keep-set" original="1">
<resource_ref id="clone2_keep" original="1"/>
- <resource_ref id="clone3_drop" original="1"/>
<resource_ref id="clone4_keep" original="1"/>
</resource_set>
</rsc_ticket>
<rsc_ticket id="ticket5_keep" ticket="ticket1" original="1">
- <resource_set id="ticket5_keep-set_drop" original="1">
- <resource_ref id="grp1_drop" original="1"/>
- <resource_ref id="clone1_drop" original="1"/>
- </resource_set>
<resource_set id="ticket5_keep-set_keep" original="1">
<resource_ref id="clone2_keep" original="1"/>
- <resource_ref id="clone3_drop" original="1"/>
<resource_ref id="clone4_keep" original="1"/>
</resource_set>
</rsc_ticket>
</constraints>
</configuration>
<status original="1"/>
</cib>
diff --git a/cts/schemas/test-3/ref/nagios.ref-99 b/cts/schemas/test-3/ref/nagios.ref-99
index 315d9d2587..4b4aa496e0 100644
--- a/cts/schemas/test-3/ref/nagios.ref-99
+++ b/cts/schemas/test-3/ref/nagios.ref-99
@@ -1,188 +1,111 @@
<cib crm_feature_set="3.19.7" validate-with="pacemaker-4.0" epoch="8" num_updates="0" admin_epoch="0">
<configuration>
<!-- The essential elements of this test are:
* There is an nagios template and an ocf template.
* There are nagios and ocf primitives, defined either inline or by
reference to the corresponding template.
* There is a group with only nagios primitives and a group with both
nagios and ocf primitives.
* There is a cloned nagios resource and a cloned ocf resource.
* There is a cloned group containing only nagios primitives and a
cloned group containing both nagios and ocf primitives.
* There is a bundle containing an nagios primitive.
* There are various constraints, many of which reference nagios
resources.
In this situation:
* The nagios templates and primitives should be dropped, while the ocf
ones should be kept.
* Groups and clones that would become empty should be dropped.
* Groups containing ocf primitives should be kept; only their nagios
members should be dropped.
* The bundle should be kept so that its container remains managed; its
primitive should be dropped.
* Constraints with attributes referencing nagios resources should be
dropped.
* Resource sets containing only references to nagios resources should
be dropped.
* Constraints with resource sets should be dropped if all of their
resource sets should be dropped.
-->
<crm_config/>
<nodes/>
<resources>
- <template id="template_drop" class="nagios" type="Dummy"/>
<template id="template_keep" class="ocf" provider="pacemaker" type="Dummy"/>
- <primitive id="primitive1_drop" class="nagios" type="Dummy"/>
<primitive id="primitive2_keep" class="ocf" provider="pacemaker" type="Dummy"/>
- <primitive id="primitive3_drop" template="template_drop"/>
<primitive id="primitive4_keep" template="template_keep"/>
- <group id="grp1_drop">
- <primitive id="grp1_rsc1_drop" class="nagios" type="Dummy"/>
- <primitive id="grp1_rsc2_drop" template="template_drop"/>
- </group>
<group id="grp2_keep">
- <primitive id="grp2_rsc1_drop" class="nagios" type="Dummy"/>
<primitive id="grp2_rsc2_keep" class="ocf" provider="pacemaker" type="Dummy"/>
- <primitive id="grp2_rsc3_drop" template="template_drop"/>
<primitive id="grp2_rsc4_keep" template="template_keep"/>
</group>
- <clone id="clone1_drop">
- <primitive id="clone1_rsc_drop" class="nagios" type="Dummy"/>
- </clone>
<clone id="clone2_keep">
<primitive id="clone2_rsc_keep" class="ocf" provider="pacemaker" type="Dummy"/>
</clone>
- <clone id="clone3_drop">
- <group id="clone3_grp_drop">
- <primitive id="clone3_grp_rsc1_drop" class="nagios" type="Dummy"/>
- <primitive id="clone3_grp_rsc2_drop" template="template_drop"/>
- </group>
- </clone>
<clone id="clone4_keep">
<group id="clone4_grp_keep">
- <primitive id="clone4_grp_rsc1_drop" class="nagios" type="Dummy"/>
<primitive id="clone4_grp_rsc2_keep" class="ocf" provider="pacemaker" type="Dummy"/>
- <primitive id="clone4_grp_rsc3_drop" template="template_drop"/>
<primitive id="clone4_grp_rsc4_keep" template="template_keep"/>
</group>
</clone>
<bundle id="bundle_keep">
<podman image="image"/>
- <primitive id="bundle_rsc_drop" class="nagios" type="Dummy"/>
</bundle>
</resources>
<constraints>
- <rsc_location id="location1_drop" rsc="primitive1_drop" node="node1" score="INFINITY"/>
<rsc_location id="location2_keep" rsc="primitive2_keep" node="node1" score="INFINITY"/>
- <rsc_location id="location3_drop" node="node1" score="INFINITY">
- <resource_set id="location3_drop-set">
- <resource_ref id="grp1_drop"/>
- <resource_ref id="clone1_drop"/>
- </resource_set>
- </rsc_location>
<rsc_location id="location4_keep" node="node1" score="INFINITY">
<resource_set id="location4_keep-set">
<resource_ref id="clone2_keep"/>
- <resource_ref id="clone3_drop"/>
<resource_ref id="clone4_keep"/>
</resource_set>
</rsc_location>
<rsc_location id="location5_keep" node="node1" score="INFINITY">
- <resource_set id="location5_keep-set_drop">
- <resource_ref id="grp1_drop"/>
- <resource_ref id="clone1_drop"/>
- </resource_set>
<resource_set id="location5_keep-set_keep">
<resource_ref id="clone2_keep"/>
- <resource_ref id="clone3_drop"/>
<resource_ref id="clone4_keep"/>
</resource_set>
</rsc_location>
<rsc_location id="location6_keep" rsc-pattern="primitive1_drop" node="node1" score="INFINITY"/>
- <rsc_colocation id="colocation1_drop" rsc="primitive1_drop" with-rsc="primitive2_keep"/>
- <rsc_colocation id="colocation2_drop" rsc="primitive2_keep" with-rsc="primitive1_drop"/>
- <rsc_colocation id="colocation3_drop" rsc="primitive3_drop" with-rsc="primitive1_drop"/>
<rsc_colocation id="colocation4_keep" rsc="primitive4_keep" with-rsc="primitive2_keep"/>
- <rsc_colocation id="colocation5_drop">
- <resource_set id="colocation5_drop-set">
- <resource_ref id="grp1_drop"/>
- <resource_ref id="clone1_drop"/>
- </resource_set>
- </rsc_colocation>
<rsc_colocation id="colocation6_keep">
<resource_set id="colocation6_keep-set">
<resource_ref id="clone2_keep"/>
- <resource_ref id="clone3_drop"/>
<resource_ref id="clone4_keep"/>
</resource_set>
</rsc_colocation>
<rsc_colocation id="colocation7_keep">
- <resource_set id="colocation7_keep-set_drop">
- <resource_ref id="grp1_drop"/>
- <resource_ref id="clone1_drop"/>
- </resource_set>
<resource_set id="colocation7_keep-set_keep">
<resource_ref id="clone2_keep"/>
- <resource_ref id="clone3_drop"/>
<resource_ref id="clone4_keep"/>
</resource_set>
</rsc_colocation>
- <rsc_order id="order1_drop" first="primitive1_drop" then="primitive2_keep"/>
- <rsc_order id="order2_drop" first="primitive2_keep" then="primitive1_drop"/>
- <rsc_order id="order3_drop" first="primitive3_drop" then="primitive1_drop"/>
<rsc_order id="order4_keep" first="primitive4_keep" then="primitive2_keep"/>
- <rsc_order id="order5_drop">
- <resource_set id="order5_drop-set">
- <resource_ref id="grp1_drop"/>
- <resource_ref id="clone1_drop"/>
- </resource_set>
- </rsc_order>
<rsc_order id="order6_keep">
<resource_set id="order6_keep-set">
<resource_ref id="clone2_keep"/>
- <resource_ref id="clone3_drop"/>
<resource_ref id="clone4_keep"/>
</resource_set>
</rsc_order>
<rsc_order id="order7_keep">
- <resource_set id="order7_keep-set_drop">
- <resource_ref id="grp1_drop"/>
- <resource_ref id="clone1_drop"/>
- </resource_set>
<resource_set id="order7_keep-set_keep">
<resource_ref id="clone2_keep"/>
- <resource_ref id="clone3_drop"/>
<resource_ref id="clone4_keep"/>
</resource_set>
</rsc_order>
- <rsc_ticket id="ticket1_drop" rsc="primitive1_drop" ticket="ticket1"/>
<rsc_ticket id="ticket2_keep" rsc="primitive2_keep" ticket="ticket1"/>
- <rsc_ticket id="ticket3_drop" ticket="ticket1">
- <resource_set id="ticket3_drop-set">
- <resource_ref id="grp1_drop"/>
- <resource_ref id="clone1_drop"/>
- </resource_set>
- </rsc_ticket>
<rsc_ticket id="ticket4_keep" ticket="ticket1">
<resource_set id="ticket4_keep-set">
<resource_ref id="clone2_keep"/>
- <resource_ref id="clone3_drop"/>
<resource_ref id="clone4_keep"/>
</resource_set>
</rsc_ticket>
<rsc_ticket id="ticket5_keep" ticket="ticket1">
- <resource_set id="ticket5_keep-set_drop">
- <resource_ref id="grp1_drop"/>
- <resource_ref id="clone1_drop"/>
- </resource_set>
<resource_set id="ticket5_keep-set_keep">
<resource_ref id="clone2_keep"/>
- <resource_ref id="clone3_drop"/>
<resource_ref id="clone4_keep"/>
</resource_set>
</rsc_ticket>
</constraints>
</configuration>
<status/>
</cib>
diff --git a/xml/resources-4.0.rng b/xml/resources-4.0.rng
index 44cd16e51e..8f019d09b6 100644
--- a/xml/resources-4.0.rng
+++ b/xml/resources-4.0.rng
@@ -1,377 +1,374 @@
<?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>
<!--
Include rule definitions so that we can override element-nvset.rule based on
context
-->
<include href="rule-4.0.rng">
<start combine="choice">
<notAllowed/>
</start>
</include>
<define name="element-resources">
<element name="resources">
<zeroOrMore>
<choice>
<ref name="element-primitive"/>
<ref name="element-template"/>
<ref name="element-group"/>
<ref name="element-clone"/>
<ref name="element-bundle"/>
</choice>
</zeroOrMore>
</element>
</define>
<define name="element-primitive">
<element name="primitive">
<interleave>
<attribute name="id"><data type="ID"/></attribute>
<choice>
<group>
<ref name="element-resource-class"/>
<attribute name="type"><text/></attribute>
</group>
<attribute name="template"><data type="IDREF"/></attribute>
</choice>
<optional>
<attribute name="description"><text/></attribute>
</optional>
<ref name="element-resource-extra.primitive-template"/>
<ref name="element-operations"/>
</interleave>
</element>
</define>
<define name="element-template">
<element name="template">
<interleave>
<attribute name="id"><data type="ID"/></attribute>
<ref name="element-resource-class"/>
<attribute name="type"><text/></attribute>
<optional>
<attribute name="description"><text/></attribute>
</optional>
<ref name="element-resource-extra.primitive-template"/>
<ref name="element-operations"/>
</interleave>
</element>
</define>
<define name="element-bundle">
<element name="bundle">
<interleave>
<attribute name="id"><data type="ID"/></attribute>
<optional>
<attribute name="description"><text/></attribute>
</optional>
<ref name="element-resource-extra"/>
<choice>
<element name="docker">
<attribute name="image"><text/></attribute>
<optional>
<attribute name="replicas"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="replicas-per-host"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="promoted-max"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="run-command"> <text/></attribute>
</optional>
<optional>
<attribute name="network"><text/></attribute>
</optional>
<optional>
<attribute name="options"><text/></attribute>
</optional>
</element>
<!-- @COMPAT rkt containers in bundles are deprecated since 2.1.8 -->
<element name="rkt">
<attribute name="image"><text/></attribute>
<optional>
<attribute name="replicas"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="replicas-per-host"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="promoted-max"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="run-command"> <text/></attribute>
</optional>
<optional>
<attribute name="network"><text/></attribute>
</optional>
<optional>
<attribute name="options"><text/></attribute>
</optional>
</element>
<element name="podman">
<attribute name="image"><text/></attribute>
<optional>
<attribute name="replicas"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="replicas-per-host"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="promoted-max"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="run-command"> <text/></attribute>
</optional>
<optional>
<attribute name="network"><text/></attribute>
</optional>
<optional>
<attribute name="options"><text/></attribute>
</optional>
</element>
</choice>
<optional>
<element name="network">
<optional>
<attribute name="ip-range-start"><text/></attribute>
</optional>
<optional>
<attribute name="control-port"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="host-interface"><text/></attribute>
</optional>
<optional>
<attribute name="host-netmask"><data type="integer"/></attribute>
</optional>
<optional>
<attribute name="add-host"><data type="boolean"/></attribute>
</optional>
<zeroOrMore>
<element name="port-mapping">
<attribute name="id"><data type="ID"/></attribute>
<choice>
<group>
<attribute name="port"><data type="integer"/></attribute>
<optional>
<attribute name="internal-port"><data type="integer"/></attribute>
</optional>
</group>
<attribute name="range">
<data type="string">
<param name="pattern">([0-9\-]+)</param>
</data>
</attribute>
</choice>
</element>
</zeroOrMore>
</element>
</optional>
<optional>
<element name="storage">
<zeroOrMore>
<element name="storage-mapping">
<attribute name="id"><data type="ID"/></attribute>
<choice>
<attribute name="source-dir"><text/></attribute>
<attribute name="source-dir-root"><text/></attribute>
</choice>
<attribute name="target-dir"><text/></attribute>
<optional>
<attribute name="options"><text/></attribute>
</optional>
</element>
</zeroOrMore>
</element>
</optional>
<optional>
<ref name="element-primitive"/>
</optional>
</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-resource-extra">
<zeroOrMore>
<choice>
<ref name="element-instance_attributes"/>
<element name="meta_attributes">
<externalRef href="nvset-4.0.rng"/>
</element>
</choice>
</zeroOrMore>
</define>
<define name="element-resource-extra.primitive-template">
<zeroOrMore>
<choice>
<ref name="element-instance_attributes"/>
<element name="meta_attributes">
<externalRef href="nvset-4.0.rng"/>
</element>
<element name="utilization">
<externalRef href="nvset-4.0.rng"/>
</element>
</choice>
</zeroOrMore>
</define>
<define name="element-resource-extra.op">
<zeroOrMore>
<choice>
<ref name="element-instance_attributes"/>
<element name="meta_attributes">
<grammar>
<include href="nvset-4.0.rng">
<!--
@COMPAT: Support for node attribute expressions is deprecated
here. We can just delete this define when we drop support.
-->
<define name="element-nvset.rule">
<parentRef name="element-rule-node-allowed"/>
</define>
</include>
</grammar>
</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>Promoted</value>
<value>Unpromoted</value>
<value>Slave</value>
<value>Master</value>
</choice>
</attribute>
</optional>
<optional>
<attribute name="on-fail">
<choice>
<value>ignore</value>
<value>block</value>
<value>demote</value>
<value>stop</value>
<value>restart</value>
<value>standby</value>
<value>fence</value>
<value>restart-container</value>
</choice>
</attribute>
</optional>
<ref name="element-resource-extra.op"/>
</element>
</zeroOrMore>
</element>
</optional>
</define>
<define name="element-resource-class">
<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>service</value>
<value>systemd</value>
-
- <!-- @COMPAT nagios resources are deprecated since 2.1.6 -->
- <value>nagios</value>
</choice>
</attribute>
</choice>
</define>
<define name="element-instance_attributes">
<element name="instance_attributes">
<grammar>
<include href="nvset-4.0.rng">
<define name="element-nvset.rule">
<parentRef name="element-rule-node-allowed"/>
</define>
</include>
</grammar>
</element>
</define>
</grammar>
diff --git a/xml/upgrade-3.10-4.xsl b/xml/upgrade-3.10-4.xsl
index 5c7bd8cc35..7e286e31e0 100644
--- a/xml/upgrade-3.10-4.xsl
+++ b/xml/upgrade-3.10-4.xsl
@@ -1,162 +1,164 @@
<?xml version="1.0" encoding="UTF-8"?>
<!--
Use comments liberally as future maintainers may be unfamiliar with XSLT.
-->
<!--
upgrade-3.10-4.xsl
Guarantees after this transformation:
- * There are no upstart-class resources. If there were any prior to this
- transformation, they have been dropped.
+ * There are no nagios-class or upstart-class resources. If there were any prior
+ to this transformation, they have been dropped.
-->
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:import href="upgrade-3.10-common.xsl"/>
<!-- XSLT 1.0 lacks upper-case() and lower-case() functions -->
<xsl:variable name="upper" select="'ABCDEFGHIJKLMNOPQRSTUVWXYZ'"/>
<xsl:variable name="lower" select="'abcdefghijklmnopqrstuvwxyz'"/>
<!-- Index all resource templates by ID -->
<xsl:key name="template_id" match="template" use="@id"/>
<!-- Copy everything unaltered by default -->
<xsl:template match="/|@*|node()">
<xsl:call-template name="identity"/>
</xsl:template>
<!-- Resources -->
<!-- The following XSL templates use XPath 1.0 set intersection idioms -->
<!-- Upstart-class templates -->
<xsl:variable name="dropped_templates"
select="//template
- [translate(@class, $upper, $lower) = 'upstart']"/>
+ [(translate(@class, $upper, $lower) = 'nagios')
+ or (translate(@class, $upper, $lower) = 'upstart')]"/>
<!-- Upstart-class primitives -->
<xsl:variable name="dropped_primitives"
select="//primitive
- [(translate(@class, $upper, $lower) = 'upstart')
+ [(translate(@class, $upper, $lower) = 'nagios')
+ or (translate(@class, $upper, $lower) = 'upstart')
or (@template
and (count(key('template_id', @template)
|$dropped_templates)
= count($dropped_templates)))]"/>
-<!-- Groups containing only upstart-class primitives -->
+<!-- Groups containing only nagios- and upstart-class primitives -->
<xsl:variable name="dropped_groups"
select="//group[count(primitive|$dropped_primitives)
= count($dropped_primitives)]"/>
-<!-- Clones containing only upstart-class primitives -->
+<!-- Clones containing only nagios- and upstart-class primitives -->
<xsl:variable name="dropped_clones"
select="//clone[count(.//primitive|$dropped_primitives)
= count($dropped_primitives)]"/>
<!-- All dropped resources -->
<xsl:variable name="dropped_resources"
select="$dropped_primitives|$dropped_groups|$dropped_clones"/>
-<!-- Drop upstart-class resource templates -->
+<!-- Drop nagios- and upstart-class resource templates -->
<xsl:template match="template">
<xsl:if test="count(.|$dropped_templates) != count($dropped_templates)">
<xsl:call-template name="identity"/>
</xsl:if>
</xsl:template>
-<!-- Drop upstart-class primitives -->
+<!-- Drop nagios- and upstart-class primitives -->
<xsl:template match="primitive">
<xsl:if test="count(.|$dropped_primitives) != count($dropped_primitives)">
<xsl:call-template name="identity"/>
</xsl:if>
</xsl:template>
<!-- Drop groups that would become empty -->
<xsl:template match="group">
<xsl:if test="count(.|$dropped_groups) != count($dropped_groups)">
<xsl:call-template name="identity"/>
</xsl:if>
</xsl:template>
<!-- Drop clones that would become empty -->
<xsl:template match="clone">
<xsl:if test="count(.|$dropped_clones) != count($dropped_clones)">
<xsl:call-template name="identity"/>
</xsl:if>
</xsl:template>
<!-- Constraints -->
<!-- Drop resource refs that refer to dropped resources -->
<xsl:variable name="dropped_resource_refs"
select="//resource_ref[@id = $dropped_resources/@id]"/>
<xsl:template match="resource_ref">
<xsl:if test="count(.|$dropped_resource_refs)
!= count($dropped_resource_refs)">
<xsl:call-template name="identity"/>
</xsl:if>
</xsl:template>
<!-- Drop resource sets that would become empty -->
<xsl:variable name="dropped_resource_sets"
select="//resource_set
[count(resource_ref|$dropped_resource_refs)
= count($dropped_resource_refs)]"/>
<xsl:template match="resource_set">
<xsl:if test="count(.|$dropped_resource_sets)
!= count($dropped_resource_sets)">
<xsl:call-template name="identity"/>
</xsl:if>
</xsl:template>
<!-- Drop constraints that would contain no valid resource references -->
<xsl:template match="rsc_location|rsc_ticket">
<xsl:choose>
<xsl:when test="@rsc = $dropped_resources/@id"/>
<!-- The constraint contained resource sets, and they're all dropped -->
<xsl:when test="resource_set
and (count(resource_set|$dropped_resource_sets)
= count($dropped_resource_sets))"/>
<xsl:otherwise>
<xsl:call-template name="identity"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="rsc_colocation">
<xsl:choose>
<xsl:when test="@rsc = $dropped_resources/@id"/>
<xsl:when test="@with-rsc = $dropped_resources/@id"/>
<xsl:when test="resource_set
and (count(resource_set|$dropped_resource_sets)
= count($dropped_resource_sets))"/>
<xsl:otherwise>
<xsl:call-template name="identity"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="rsc_order">
<xsl:choose>
<xsl:when test="@first = $dropped_resources/@id"/>
<xsl:when test="@then = $dropped_resources/@id"/>
<xsl:when test="resource_set
and (count(resource_set|$dropped_resource_sets)
= count($dropped_resource_sets))"/>
<xsl:otherwise>
<xsl:call-template name="identity"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Jan 25, 6:59 AM (1 d, 14 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
1317756
Default Alt Text
(38 KB)
Attached To
Mode
rP Pacemaker
Attached
Detach File
Event Timeline
Log In to Comment