Blob Blame History Raw
From 048d13afcc91f4a16a80012aa34b9a024d95368e Mon Sep 17 00:00:00 2001
Message-Id: <048d13afcc91f4a16a80012aa34b9a024d95368e.1399147755.git.crobinso@redhat.com>
From: Martin Wilck <martin.wilck@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