From 1d57697f64077ab0d3435ac746a12d5816602926 Mon Sep 17 00:00:00 2001
From: gary_williams <gary_williams@localhost>
Date: Mon, 22 Sep 2008 16:18:20 +0000
Subject: [PATCH] Issue 2752: ensure well formed XML in test reports (part 1)

---
 opends/tests/staf-tests/shared/python/common.py |   30 +++++++++++++++++++++---------
 1 files changed, 21 insertions(+), 9 deletions(-)

diff --git a/opends/tests/staf-tests/shared/python/common.py b/opends/tests/staf-tests/shared/python/common.py
index 7d7da0b..094d99a 100644
--- a/opends/tests/staf-tests/shared/python/common.py
+++ b/opends/tests/staf-tests/shared/python/common.py
@@ -266,24 +266,36 @@
     return sfx
 
 class staf_service:  
-
+  'Container to hold staf service instance objects'
   def __init__(self,host,name):
     from com.ibm.staf import STAFHandle
     from com.ibm.staf import STAFResult
     from com.ibm.staf import STAFMarshallingContext
 
-    __handle = STAFHandle("varHandle")
+    self.name=name
+    self.library='Unknown'
+    self.executable='Unknown'
+    self.options='Unknown'
+    self.params='Unknown'
+
+    try:
+      __handle = STAFHandle("varHandle")
+    except STAFException, e:
+      pass
 
     __cmd = 'QUERY SERVICE %s' % name
     __res = __handle.submit2(host, "SERVICE", __cmd)
-    __context = STAFMarshallingContext.unmarshall(__res.result)
-    __entryMap = __context.getRootObject()
 
-    self.name=__entryMap['name']
-    self.library=__entryMap['library']
-    self.executable=__entryMap['executable']
-    self.options=__entryMap['options']
-    self.params=__entryMap['parameters']
+    if (__res.rc == 0):
+   
+      __context = STAFMarshallingContext.unmarshall(__res.result)
+      __entryMap = __context.getRootObject()
+
+      self.name=__entryMap['name']
+      self.library=__entryMap['library']
+      self.executable=__entryMap['executable']
+      self.options=__entryMap['options']
+      self.params=__entryMap['parameters']
 
   def get_library(self):
     return self.library

--
Gitblit v1.10.0