# HG changeset patch
# User Kaitlin Rupert <karupert(a)us.ibm.com>
# Date 1208836847 25200
# Node ID 00549613964a06a76d614151c3dfa86881169177
# Parent fdd1e960ba1d092dffe072d373824baca5276877
Fix indication_tester to send proper Content-Type.
Changed the Content-Type from text/cimxml to application/xml. Also change the exception
text to print the request return code and error message.
Signed-off-by: Kaitlin Rupert <karupert(a)us.ibm.com>
diff -r fdd1e960ba1d -r 00549613964a tools/indication_tester.py
--- a/tools/indication_tester.py Fri Apr 18 14:18:01 2008 -0700
+++ b/tools/indication_tester.py Mon Apr 21 21:00:47 2008 -0700
@@ -317,7 +317,7 @@
headers = {"CIMOperation" : "MethodCall",
"CIMMethod" : method,
"CIMObject" : "root/PG_Interop",
- "Content-Type" : "text/cimxml"}
+ "Content-Type" : 'application/xml;
charset="utf-8"'}
if auth_hdr:
headers["Authorization"] = "Basic %s" % auth_hdr
@@ -325,7 +325,8 @@
conn.request("POST", "/cimom", body, headers)
resp = conn.getresponse()
if not resp.getheader("content-length"):
- raise Exception("Authentication (or request) Failed!")
+ raise Exception("Request Failed: %d %s" %
+ (resp.status, resp.reason))
resp.read()