Skip to content

Commit a3148c6

Browse files
committed
Improves/fixes error handling in xmlrpc server
1 parent 7132112 commit a3148c6

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

SoftLayer/testing/xmlrpc.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -55,20 +55,20 @@ def do_POST(self):
5555

5656
response_body = utils.xmlrpc_client.dumps((response,),
5757
allow_none=True,
58-
methodresponse=1)
58+
methodresponse=True)
5959

6060
self.send_response(200)
6161
self.send_header("Content-type", "application/xml")
6262
self.end_headers()
6363
self.wfile.write(response_body.encode('utf-8'))
6464

6565
except SoftLayer.SoftLayerAPIError as ex:
66-
self.send_response(ex.faultCode or 500)
66+
self.send_response(200)
6767
self.end_headers()
6868
response = utils.xmlrpc_client.Fault(ex.faultCode, str(ex.reason))
69-
response_body = utils.xmlrpc_client.dumps((response,),
69+
response_body = utils.xmlrpc_client.dumps(response,
7070
allow_none=True,
71-
methodresponse=1)
71+
methodresponse=True)
7272
self.wfile.write(response_body.encode('utf-8'))
7373
except Exception as ex:
7474
self.send_response(500)

0 commit comments

Comments
 (0)