From 6e659ba12a4944a7a8eacceb66aa281e003586cc Mon Sep 17 00:00:00 2001 From: Aanand Prasad Date: Thu, 5 Sep 2013 22:46:24 -0400 Subject: [PATCH] Move creation of websocket connection to its own method, so subclasses can override --- docker/client.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/client.py b/docker/client.py index 7a9c59b5..28927dd4 100644 --- a/docker/client.py +++ b/docker/client.py @@ -155,8 +155,10 @@ class Client(requests.Session): url = self._url("/containers/{0}/attach/ws".format(container)) req = requests.Request("POST", url, params=self._attach_params(params)) full_url = req.prepare().url.replace("http://", "ws://", 1) - print full_url - return websocket.create_connection(full_url) + return self._create_websocket_connection(full_url) + + def _create_websocket_connection(self, url): + return websocket.create_connection(url) def attach(self, container): socket = self.attach_socket(container)