summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--filters/cib/configuration/__init__.py31
-rw-r--r--filters/cluster/rm/failoverdomains/__init__.py23
2 files changed, 44 insertions, 10 deletions
diff --git a/filters/cib/configuration/__init__.py b/filters/cib/configuration/__init__.py
index cd06a7d..e7017c0 100644
--- a/filters/cib/configuration/__init__.py
+++ b/filters/cib/configuration/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: UTF-8 -*-
-# Copyright 2015 Red Hat, Inc.
+# Copyright 2016 Red Hat, Inc.
# Part of clufter project
# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt)
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
@@ -142,14 +142,27 @@ cibcompact2cib = ('''\
<rule id="CONSTRAINT-LOCATION-{$Resource/@id}-RESTRICTED"
boolean-op="and"
score="-INFINITY">
- <xsl:for-each select="$FailoverDomain/meta_attributes/nvpair[
- starts-with(@name, 'failoverdomainnode-')
- ]">
- <expression id="CONSTRAINT-LOCATION-{$Resource/@id}-RESTRICTED-{@value}-expr"
- attribute="#uname"
- operation="ne"
- value="{@value}"/>
- </xsl:for-each>
+ <xsl:choose>
+ <xsl:when test="$FailoverDomain/meta_attributes/nvpair[
+ starts-with(@name, 'failoverdomainnode-')
+ ]">
+ <xsl:for-each select="$FailoverDomain/meta_attributes/nvpair[
+ starts-with(@name, 'failoverdomainnode-')
+ ]">
+ <expression id="CONSTRAINT-LOCATION-{$Resource/@id}-RESTRICTED-{@value}-expr"
+ attribute="#uname"
+ operation="ne"
+ value="{@value}"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <!-- see filters/ccs-revitalize[failoverdomains]:
+ warn on empty restricted failoverdomains -->
+ <expression id="CONSTRAINT-LOCATION-{$Resource/@id}-RESTRICTED-all-expr"
+ attribute="#uname"
+ operation="defined"/>
+ </xsl:otherwise>
+ </xsl:choose>
</rule>
</xsl:if>
</rsc_location>
diff --git a/filters/cluster/rm/failoverdomains/__init__.py b/filters/cluster/rm/failoverdomains/__init__.py
index 299b1f1..6923c51 100644
--- a/filters/cluster/rm/failoverdomains/__init__.py
+++ b/filters/cluster/rm/failoverdomains/__init__.py
@@ -1,5 +1,5 @@
# -*- coding: UTF-8 -*-
-# Copyright 2015 Red Hat, Inc.
+# Copyright 2016 Red Hat, Inc.
# Part of clufter project
# Licensed under GPLv2+ (a copy included | http://gnu.org/licenses/gpl-2.0.txt)
__author__ = "Jan Pokorný <jpokorny @at@ Red Hat .dot. com>"
@@ -19,4 +19,25 @@ ccs_revitalize = '''\
' with repeated name (', @name, ')')"/>
</xsl:message>
</xsl:template>
+ <!-- warn on empty restricted failoverdomains
+ rgmanager/src/daemons/groups.c:consider_start:instead of start req.
+ http://oss.clusterlabs.org/pipermail/users/2016-January/002176.html
+ -->
+ <xsl:template match="failoverdomain[
+ @restricted != ''
+ and
+ contains('123456789',
+ substring(@restricted, 1, 1))
+ and
+ not(failoverdomainnode)
+ ]">
+ <xsl:message>
+ <xsl:value-of select="concat('WARNING: empty restricted failoverdomain',
+ ' means associated resource groups',
+ ' will not start (', @name, ')')"/>
+ </xsl:message>
+ <xsl:copy>
+ <xsl:apply-templates select="@*|node()"/>
+ </xsl:copy>
+ </xsl:template>
'''