From f3ec5157c7fc97e31c7b48e3a56da268de7e4216 Mon Sep 17 00:00:00 2001
From: Laine Stump <laine@laine.org>
Date: Tue, 13 Oct 2015 14:42:35 -0400
Subject: [PATCH 2/2] Properly classify bond devices with no slaves
Although initscripts only considers an interface to be a bond if it
has slaves, there are times when setting up a bond, or testing, when a
bond may not have any slaves (yet) but does have a BONDING_OPTS
attribute. Previously in those situations netcf would identify the
interface as a plain ethernet. This patch makes the check more
inclusive - now any interface with slaves *or* with a BONDING_OPTS
attribute is considered to be a bond.
This patch was inspired by an earlier patch sent by Lubomir Rintel
which looked for BONDING_OPTS *instead of* looking for slaves.
---
data/xml/redhat-put.xsl | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/data/xml/redhat-put.xsl b/data/xml/redhat-put.xsl
index ed56c66..89145e5 100644
--- a/data/xml/redhat-put.xsl
+++ b/data/xml/redhat-put.xsl
@@ -135,7 +135,7 @@
</xsl:template>
<xsl:template name="bond-interface"
- match="tree[node[@label = 'DEVICE'][@value = //tree/node[@label = 'MASTER']/@value]][count(node[@label = 'BRIDGE']) = 0]">
+ match="tree[count(node[@label = 'BONDING_OPTS']) or (node[@label = 'DEVICE'][@value = //tree/node[@label = 'MASTER']/@value])][count(node[@label = 'BRIDGE']) = 0]">
<interface type="bond">
<xsl:call-template name="name-attr"/>
<xsl:call-template name="startmode"/>
--
2.4.3