[netcf/f20] Fix reading bridge stp value (bz #1031053)

Cole Robinson crobinso at fedoraproject.org
Sat May 3 20:22:12 UTC 2014


commit f45ad35f4f7dff88dcff865d5cb32940b067893c
Author: Cole Robinson <crobinso at redhat.com>
Date:   Sat May 3 16:22:31 2014 -0400

    Fix reading bridge stp value (bz #1031053)

 ...TP-value-from-yes-no-to-on-off-in-redhat-.patch |   40 ++++++++++++++++++++
 netcf.spec                                         |   11 +++++-
 2 files changed, 50 insertions(+), 1 deletions(-)
---
diff --git a/0001-transform-STP-value-from-yes-no-to-on-off-in-redhat-.patch b/0001-transform-STP-value-from-yes-no-to-on-off-in-redhat-.patch
new file mode 100644
index 0000000..4f689c0
--- /dev/null
+++ b/0001-transform-STP-value-from-yes-no-to-on-off-in-redhat-.patch
@@ -0,0 +1,40 @@
+From 048d13afcc91f4a16a80012aa34b9a024d95368e Mon Sep 17 00:00:00 2001
+Message-Id: <048d13afcc91f4a16a80012aa34b9a024d95368e.1399147755.git.crobinso at redhat.com>
+From: Martin Wilck <martin.wilck at ts.fujitsu.com>
+Date: Mon, 18 Nov 2013 12:35:15 +0100
+Subject: [PATCH] transform STP value from "yes/no" to "on/off" in
+ redhat-put.xsl
+
+Some tools (e.g. NetworkManager) use "yes"/"no" in config files
+rather than "on/off". netcf needs to transform this in order to conform
+with the schema.
+---
+ data/xml/redhat-put.xsl | 12 +++++++++++-
+ 2 files changed, 12 insertions(+), 1 deletion(-)
+
+diff --git a/data/xml/redhat-put.xsl b/data/xml/redhat-put.xsl
+index 267d9cd..88e6d73 100644
+--- a/data/xml/redhat-put.xsl
++++ b/data/xml/redhat-put.xsl
+@@ -77,7 +77,17 @@
+       <xsl:call-template name="interface-addressing"/>
+       <bridge>
+         <xsl:if test="node[@label = 'STP']">
+-          <xsl:attribute name="stp"><xsl:value-of select="node[@label = 'STP']/@value"/></xsl:attribute>
++          <xsl:choose>
++            <xsl:when test="node[@label = 'STP']/@value = 'yes'">
++              <xsl:attribute name="stp">on</xsl:attribute>
++            </xsl:when>
++            <xsl:when test="node[@label = 'STP']/@value = 'no'">
++              <xsl:attribute name="stp">off</xsl:attribute>
++            </xsl:when>
++            <xsl:otherwise>
++              <xsl:attribute name="stp"><xsl:value-of select="node[@label = 'STP']/@value"/></xsl:attribute>
++            </xsl:otherwise>
++          </xsl:choose>
+         </xsl:if>
+         <xsl:if test="node[@label = 'DELAY']">
+           <xsl:attribute name="delay"><xsl:value-of select="node[@label = 'DELAY']/@value"/></xsl:attribute>
+-- 
+1.9.0
+
diff --git a/netcf.spec b/netcf.spec
index aff1e0d..606f9d8 100644
--- a/netcf.spec
+++ b/netcf.spec
@@ -1,12 +1,15 @@
 Name:           netcf
 Version:        0.2.3
-Release:        5%{?dist}%{?extra_release}
+Release:        6%{?dist}%{?extra_release}
 Summary:        Cross-platform network configuration library
 
 Group:          System Environment/Libraries
 License:        LGPLv2+
 URL:            https://fedorahosted.org/netcf/
 Source0:        https://fedorahosted.org/released/%{name}/%{name}-%{version}.tar.gz
+
+# Fix reading bridge stp value (bz #1031053)
+Patch0001: 0001-transform-STP-value-from-yes-no-to-on-off-in-redhat-.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 BuildRequires:  readline-devel augeas-devel >= 0.5.2
@@ -56,6 +59,9 @@ The libraries for %{name}.
 %prep
 %setup -q
 
+# Fix reading bridge stp value (bz #1031053)
+%patch0001 -p1
+
 %build
 %if %{with_libnl1}
 %define _with_libnl1 --with-libnl1
@@ -97,6 +103,9 @@ rm -rf $RPM_BUILD_ROOT
 %{_libdir}/pkgconfig/netcf.pc
 
 %changelog
+* Sat May 03 2014 Cole Robinson <crobinso at redhat.com> - 0.2.3-6
+- Fix reading bridge stp value (bz #1031053)
+
 * Sat Aug 03 2013 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 0.2.3-5
 - Rebuilt for https://fedoraproject.org/wiki/Fedora_20_Mass_Rebuild
 


More information about the scm-commits mailing list