Blob Blame History Raw
From d25230cb26cdd6603d2758bdb2d3c56925d8219e Mon Sep 17 00:00:00 2001
From: Satoru SATOH <ssato@redhat.com>
Date: Wed, 3 Jul 2013 13:17:27 -0400
Subject: [PATCH] remove extraneous quotes from BONDING_OPTS

This fixes: https://bugzilla.redhat.com/show_bug.cgi?id=798851

For some unknown reason, the BONDING_OPTS setting in ifcfg files was
being set with an extra set of single quotes. So, for example, instead of:

  BONDING_OPTS="mode=active-backup primary=eth1 miimon=100 updelay=10 use_carrier=0"

we would get (e.g.):

  BONDING_OPTS="'mode=active-backup primary=eth1 miimon=100 updelay=10 use_carrier=0'"

Even when there weren't any BONDING_OPTS to set, the ifcfg file would
still get:

  BONDING_OPTS="''"

Since the extra quotes are added in all cases, and are never needed,
this patch just unconditionally removes them.

(cherry picked from commit 581ff3f252552cf5edc8e47c4a72667a39e133ba)

Conflicts:

 AUTHORS - one additional name upstream for debian-specific patch not
   yet in RHEL.

 tests/suse/schema/*.xml - the upstream patch modified some files that
   weren't yet being shipped in the tarball as of netcf-0.2.3; they are
   unused in RHEL anyway.
---
 AUTHORS                               | 1 +
 data/xml/util-get.xsl                 | 2 --
 tests/redhat/schema/bond-arp.xml      | 2 +-
 tests/redhat/schema/bond-defaults.xml | 2 +-
 tests/redhat/schema/bond.xml          | 2 +-
 tests/redhat/schema/bridge-bond.xml   | 2 +-
 6 files changed, 5 insertions(+), 6 deletions(-)

diff --git a/AUTHORS b/AUTHORS
index b41f26e..2512ac8 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -19,3 +19,4 @@ Contributions by:
   Guido Günther    <agx@sigxcpu.org>
   Ed Maste         <emaste@freebsd.org>
   Hendrik Schwartke <hendrik@os-t.de>
+  Satoru SATOH     <ssato@redhat.com>
diff --git a/data/xml/util-get.xsl b/data/xml/util-get.xsl
index 9edace3..ac0a320 100644
--- a/data/xml/util-get.xsl
+++ b/data/xml/util-get.xsl
@@ -3,7 +3,6 @@
                 version="1.0">
 
   <xsl:template name="bonding-opts">
-    <xsl:text>'</xsl:text>
     <xsl:if test="bond/@mode">mode=<xsl:value-of select='bond/@mode'/></xsl:if>
     <xsl:if test="bond/@mode = 'active-backup'"> primary=<xsl:value-of select='bond/interface[1]/@name'/></xsl:if>
     <xsl:if test="bond/miimon">
@@ -21,7 +20,6 @@
       <xsl:text> arp_ip_target=</xsl:text><xsl:value-of select="bond/arpmon/@target"/>
       <xsl:if test="bond/arpmon/@validate"><xsl:text> arp_validate=</xsl:text><xsl:value-of select="bond/arpmon/@validate"/></xsl:if>
     </xsl:if>
-    <xsl:text>'</xsl:text>
   </xsl:template>
 
 </xsl:stylesheet>
diff --git a/tests/redhat/schema/bond-arp.xml b/tests/redhat/schema/bond-arp.xml
index 6a53d09..884cb84 100644
--- a/tests/redhat/schema/bond-arp.xml
+++ b/tests/redhat/schema/bond-arp.xml
@@ -7,7 +7,7 @@
     <node label="IPADDR" value="192.168.50.7"/>
     <node label="NETMASK" value="255.255.255.0"/>
     <node label="GATEWAY" value="192.168.50.1"/>
-    <node label="BONDING_OPTS" value="'mode=active-backup primary=eth1 arp_interval=100 arp_ip_target=192.168.50.1 arp_validate=active'"/>
+    <node label="BONDING_OPTS" value="mode=active-backup primary=eth1 arp_interval=100 arp_ip_target=192.168.50.1 arp_validate=active"/>
   </tree>
   <tree path="/files/etc/sysconfig/network-scripts/ifcfg-eth1">
     <node label="DEVICE" value="eth1"/>
diff --git a/tests/redhat/schema/bond-defaults.xml b/tests/redhat/schema/bond-defaults.xml
index 3e92d19..5ee875d 100644
--- a/tests/redhat/schema/bond-defaults.xml
+++ b/tests/redhat/schema/bond-defaults.xml
@@ -11,7 +11,7 @@
     <node label="IPADDR" value="192.168.50.7"/>
     <node label="NETMASK" value="255.255.255.0"/>
     <node label="GATEWAY" value="192.168.50.1"/>
-    <node label="BONDING_OPTS" value="''"/>
+    <node label="BONDING_OPTS" value=""/>
   </tree>
   <tree  path="/files/etc/sysconfig/network-scripts/ifcfg-eth1">
     <node label="DEVICE" value="eth1"/>
diff --git a/tests/redhat/schema/bond.xml b/tests/redhat/schema/bond.xml
index d97542d..4a7e9bf 100644
--- a/tests/redhat/schema/bond.xml
+++ b/tests/redhat/schema/bond.xml
@@ -11,7 +11,7 @@
     <node label="IPADDR" value="192.168.50.7"/>
     <node label="NETMASK" value="255.255.255.0"/>
     <node label="GATEWAY" value="192.168.50.1"/>
-    <node label="BONDING_OPTS" value="'mode=active-backup primary=eth1 miimon=100 updelay=10 use_carrier=0'"/>
+    <node label="BONDING_OPTS" value="mode=active-backup primary=eth1 miimon=100 updelay=10 use_carrier=0"/>
   </tree>
   <tree  path="/files/etc/sysconfig/network-scripts/ifcfg-eth1">
     <node label="DEVICE" value="eth1"/>
diff --git a/tests/redhat/schema/bridge-bond.xml b/tests/redhat/schema/bridge-bond.xml
index c72f8d3..0b521d4 100644
--- a/tests/redhat/schema/bridge-bond.xml
+++ b/tests/redhat/schema/bridge-bond.xml
@@ -17,7 +17,7 @@
     <node label="DEVICE" value="bond0"/>
     <node label="ONBOOT" value="yes"/>
     <node label="MTU" value="1500"/>
-    <node label="BONDING_OPTS" value="'mode=active-backup primary=eth1 miimon=100 updelay=10 use_carrier=0'"/>
+    <node label="BONDING_OPTS" value="mode=active-backup primary=eth1 miimon=100 updelay=10 use_carrier=0"/>
     <node label="BRIDGE" value="br0"/>
   </tree>
   <tree path="/files/etc/sysconfig/network-scripts/ifcfg-eth1">
-- 
1.8.3.1