
import logging
import socket
import websocket

from zun.common import exception


LOG = logging.getLogger(__name__)


class WebSocketClient(object):

    def __init__(self, host_url, escape='~',
                 close_wait=0.5):
        self.escape = escape
        self.close_wait = close_wait
        self.host_url = host_url
        self.cs = None

    def connect(self):
        url = self.host_url
        try:
            self.ws = websocket.create_connection(url,
                                                  skip_utf8_validation=True)
        except socket.error as e:
            raise exception.ConnectionFailed(e)
        except websocket.WebSocketConnectionClosedException as e:
            raise exception.ConnectionFailed(e)
        except websocket.WebSocketBadStatusException as e:
            raise exception.ConnectionFailed(e)


import socket
import websocket

from zun.common import exception


class WebSocketClient(object):

    def __init__(self, host_url, escape='~',
                 close_wait=0.5):
        self.escape = escape
        self.close_wait = close_wait
        self.host_url = host_url
        self.cs = None

    def connect(self):
        url = self.host_url
        try:
            self.ws = websocket.create_connection(url,
                                                  skip_utf8_validation=True)
        except socket.error as e:
            raise exception.ConnectionFailed(e)
        except websocket.WebSocketConnectionClosedException as e:
            raise exception.ConnectionFailed(e)
        except websocket.WebSocketBadStatusException as e:
            raise exception.ConnectionFailed(e)

Remove unused LOG in websocket
Remove unused LOG in websocket

Change-Id: Ic45e5e4353dd816fd5416b880aa47df8542b2e02

  
- import logging
  import socket
  import websocket
  
  from zun.common import exception
- 
- 
- LOG = logging.getLogger(__name__)
  
  
  class WebSocketClient(object):
  
      def __init__(self, host_url, escape='~',
                   close_wait=0.5):
          self.escape = escape
          self.close_wait = close_wait
          self.host_url = host_url
          self.cs = None
  
      def connect(self):
          url = self.host_url
          try:
              self.ws = websocket.create_connection(url,
                                                    skip_utf8_validation=True)
          except socket.error as e:
              raise exception.ConnectionFailed(e)
          except websocket.WebSocketConnectionClosedException as e:
              raise exception.ConnectionFailed(e)
          except websocket.WebSocketBadStatusException as e:
              raise exception.ConnectionFailed(e)
  
Remove unused LOG in websocket
## Code Before:

import logging
import socket
import websocket

from zun.common import exception


LOG = logging.getLogger(__name__)


class WebSocketClient(object):

    def __init__(self, host_url, escape='~',
                 close_wait=0.5):
        self.escape = escape
        self.close_wait = close_wait
        self.host_url = host_url
        self.cs = None

    def connect(self):
        url = self.host_url
        try:
            self.ws = websocket.create_connection(url,
                                                  skip_utf8_validation=True)
        except socket.error as e:
            raise exception.ConnectionFailed(e)
        except websocket.WebSocketConnectionClosedException as e:
            raise exception.ConnectionFailed(e)
        except websocket.WebSocketBadStatusException as e:
            raise exception.ConnectionFailed(e)

## Instruction:
Remove unused LOG in websocket
## Code After:

import socket
import websocket

from zun.common import exception


class WebSocketClient(object):

    def __init__(self, host_url, escape='~',
                 close_wait=0.5):
        self.escape = escape
        self.close_wait = close_wait
        self.host_url = host_url
        self.cs = None

    def connect(self):
        url = self.host_url
        try:
            self.ws = websocket.create_connection(url,
                                                  skip_utf8_validation=True)
        except socket.error as e:
            raise exception.ConnectionFailed(e)
        except websocket.WebSocketConnectionClosedException as e:
            raise exception.ConnectionFailed(e)
        except websocket.WebSocketBadStatusException as e:
            raise exception.ConnectionFailed(e)
