# HG changeset patch
# User Guolian Yun <yunguol(a)cn.ibm.com>
# Date 1206942619 25200
# Node ID 66fc3211e0bf16d2be0d39e2f0a4d74b84fb15f9
# Parent e9037a5a7df99bb63ae5e90ade698592af7b7e92
[CU] add one class to keep a list of received indications
Signed-off-by: Guolian Yun <yunguol(a)cn.ibm.com>
diff -r e9037a5a7df9 -r 66fc3211e0bf tools/indication_tester.py
--- a/tools/indication_tester.py Mon Mar 10 12:05:59 2008 -0700
+++ b/tools/indication_tester.py Sun Mar 30 22:50:19 2008 -0700
@@ -286,6 +286,11 @@ class CIMIndication:
def __str__(self):
return self.name
+class CIMIndicationServer(BaseHTTPServer.HTTPServer):
+ def __init__(self, *args):
+ BaseHTTPServer.HTTPServer.__init__(self, *args)
+ self.indications = []
+
class CIMSocketHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def do_POST(self):
length = self.headers.getheader('content-length')
@@ -295,6 +300,7 @@ class CIMSocketHandler(BaseHTTPServer.Ba
print "Got indication: %s" % indication
if self.server.print_ind:
print "%s\n\n" % data
+ self.server.indications.append(indication)
class CIMIndicationSubscription:
def __init__(self, name, typ, ns, print_ind, sysname):
@@ -305,6 +311,7 @@ class CIMIndicationSubscription:
self.server = BaseHTTPServer.HTTPServer(('', 8000), CIMSocketHandler)
self.server.print_ind = print_ind
+ self.server.indications = []
self.port = 8000
self.filter_xml = filter_xml(name, typ, ns, sysname)