Skip to content

Commit

Permalink
filters/ccs_revitalize[rm]: omit resources w/ repeated primary attr
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Pokorný <[email protected]>
  • Loading branch information
jnpkrn committed Nov 27, 2015
1 parent 37b0f70 commit 517c527
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions filters/cluster/rm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -272,3 +272,49 @@
' to /usr/lib/ocf/resource.d',
'/rgmanager directory')"/>'''
)

###

ccs_revitalize = '''\
<!-- omit resources with repeated primary attribute
rgmanager/src/daemons/reslist.c:store_resource:attribute collision
(simplified a bit - limited just to sibling scope)
-->
<xsl:template match="service
|service/*
|vm
|vm/*
|resources/*">
<xsl:choose>
<xsl:when test="preceding-sibling::*[
name() = name(current())
and
current()/@rgmanager-meta-primary
and
@*[
name() = current()/@rgmanager-meta-primary
] = current()/@*[
name() = current()/@rgmanager-meta-primary
]
]">
<xsl:message>
<xsl:value-of select="concat('WARNING: omitting resource',
' with repeated primary',
' attribute (', name(), '/@',
@rgmanager-meta-primary, '=',
@*[
name()
=
current()/@rgmanager-meta-primary
], ')'
)"/>
</xsl:message>
</xsl:when>
<xsl:otherwise>
<xsl:copy>
<xsl:apply-templates select="@*|node()"/>
</xsl:copy>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
'''

0 comments on commit 517c527

Please sign in to comment.