commit 4a99839972db032682865cd78072d35ad6c10f11
Author: Ondrej Lichtner <olichtne(a)redhat.com>
Date: Tue May 6 10:01:56 2014 +0200
ResultSerializer: use the xslt_url option
This patch makes it so that the XSLT reference is automatically added
when creating a result xml file.
Signed-off-by: Ondrej Lichtner <olichtne(a)redhat.com>
Signed-off-by: Jiri Pirko <jiri(a)resnulli.us>
lnst/Controller/NetTestResultSerializer.py | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/lnst/Controller/NetTestResultSerializer.py
b/lnst/Controller/NetTestResultSerializer.py
index a7702fc..61f6c79 100644
--- a/lnst/Controller/NetTestResultSerializer.py
+++ b/lnst/Controller/NetTestResultSerializer.py
@@ -15,6 +15,7 @@ import logging
from xml.dom.minidom import getDOMImplementation
from lnst.Common.NetTestCommand import str_command
from lnst.Common.Colours import decorate_string, decorate_with_preset
+from lnst.Common.Config import lnst_config
def serialize_obj(obj, dom, el, upper_name="unnamed"):
if isinstance(obj, dict):
@@ -157,7 +158,12 @@ class NetTestResultSerializer:
def get_result_xml(self):
impl = getDOMImplementation()
doc = impl.createDocument(None, "results", None)
+
+ xslt_url = lnst_config.get_option("environment", "xslt_url")
+ proc_inst = doc.createProcessingInstruction('xml-stylesheet',
+ 'type="text/xsl"
href="'+xslt_url+'"')
top_el = doc.documentElement
+ doc.insertBefore(proc_inst, top_el)
for recipe in self._results:
recipe_el = doc.createElement("recipe")
Show replies by date