@@ -254,8 +254,16 @@ def close(self, **kwargs):
254254 self .sock .close (** kwargs )
255255
256256
257- WSResponse = collections .namedtuple ('WSResponse' , ['data' , 'status' ])
257+ #WSResponse = collections.namedtuple('WSResponse', ['data', 'status', 'getheader'])
258+ class WSResponse :
258259
260+ def __init__ (self , data , status ):
261+ self .status = status
262+ self .data = data
263+
264+ def getheader (self , name , default = None ):
265+ """Returns a given response header."""
266+ return None
259267
260268class PortForward :
261269 def __init__ (self , websocket , ports ):
@@ -536,9 +544,9 @@ def websocket_call(configuration, _method, url, **kwargs):
536544 client .run_forever (timeout = _request_timeout )
537545 all = client .read_all ()
538546 if binary :
539- return WSResponse (data = all , status = 0 )
547+ return WSResponse (data = all , status = 200 )
540548 else :
541- return WSResponse (data = '%s' % '' .join (all ), status = 0 )
549+ return WSResponse (data = '%s' % '' .join (all ), status = 200 )
542550 except (Exception , KeyboardInterrupt , SystemExit ) as e :
543551 raise ApiException (status = 0 , reason = str (e ))
544552
0 commit comments