# Path: networking_odl/_i18n.py
# DOMAIN = "networking_odl"
# _C = _translators.contextual_form
# _P = _translators.plural_form
# def get_available_languages():
# 
# Path: networking_odl/common/client.py
# LOG = log.getLogger(__name__)
# class OpenDaylightRestClient(object):
# class OpenDaylightRestClientGlobal(object):
#     def _check_opt(url):
#     def create_client(cls, url=None):
#     def __init__(self, url, username, password, timeout):
#     def get_resource(self, resource_type, resource_id):
#     def get(self, urlpath='', data=None):
#     def request(self, method, urlpath='', data=None):
#     def sendjson(self, method, urlpath, obj):
#     def _check_response(self, response):
#     def __init__(self):
#     def get_client(self):


import re
import ssl
import threading
import time
import websocket
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils
from oslo_utils import excutils
from requests import codes
from requests import exceptions
from networking_odl._i18n import _
from networking_odl.common import client as odl_client
                raise ValueError(_("bad_request (http400),check path."))

            LOG.warning("websocket connection failed",
                        exc_info=True)
            return None
        except Exception:
            LOG.error("websocket subscription failed", exc_info=True)
            return None

        # Subscribing to stream. Returns websocket URL to listen to
        ws_dce_subs_url = """restconf/streams/stream/"""
        try:
            stream_name = response.json()
            stream_name = stream_name['output']['stream-name']
            url = ws_dce_subs_url + stream_name
            if self.leaf_node_only:
                url += "?odl-leaf-nodes-only=true"
            response = self.odl_rest_client.get(url)
            response.raise_for_status()
            stream_url = response.headers['location']
            LOG.debug("websocket stream URL: %s", stream_url)
            return stream_url
        except exceptions.ConnectionError:
            LOG.error("cannot connect to the opendaylight controller")
            return None
        except exceptions.HTTPError as e:
            # restconf returns 404 on operation when there is no entry
            if e.response.status_code == codes.not_found:
                LOG.debug("response code not_found (404)"
                          "unable to websocket connection url")

# Path: networking_odl/_i18n.py
# DOMAIN = "networking_odl"
# _C = _translators.contextual_form
# _P = _translators.plural_form
# def get_available_languages():
# 
# Path: networking_odl/common/client.py
# LOG = log.getLogger(__name__)
# class OpenDaylightRestClient(object):
# class OpenDaylightRestClientGlobal(object):
#     def _check_opt(url):
#     def create_client(cls, url=None):
#     def __init__(self, url, username, password, timeout):
#     def get_resource(self, resource_type, resource_id):
#     def get(self, urlpath='', data=None):
#     def request(self, method, urlpath='', data=None):
#     def sendjson(self, method, urlpath, obj):
#     def _check_response(self, response):
#     def __init__(self):
#     def get_client(self):


# Path: networking_odl/common/websocket_client.py
import re
import ssl
import threading
import time
import websocket
from oslo_config import cfg
from oslo_log import log
from oslo_serialization import jsonutils
from oslo_utils import excutils
from requests import codes
from requests import exceptions
from networking_odl._i18n import _
from networking_odl.common import client as odl_client

                raise ValueError(_("bad_request (http400),check path."))

            LOG.warning("websocket connection failed",
                        exc_info=True)
            return None
        except Exception:
            LOG.error("websocket subscription failed", exc_info=True)
            return None

        # Subscribing to stream. Returns websocket URL to listen to
        ws_dce_subs_url = """restconf/streams/stream/"""
        try:
            stream_name = response.json()
            stream_name = stream_name['output']['stream-name']
            url = ws_dce_subs_url + stream_name
            if self.leaf_node_only:
                url += "?odl-leaf-nodes-only=true"
            response = self.odl_rest_client.get(url)
            response.raise_for_status()
            stream_url = response.headers['location']
            LOG.debug("websocket stream URL: %s", stream_url)
            return stream_url
        except exceptions.ConnectionError:
            LOG.error("cannot connect to the opendaylight controller")
            return None
        except exceptions.HTTPError as e:
            # restconf returns 404 on operation when there is no entry
            if e.response.status_code == codes.not_found:
                LOG.debug("response code not_found (404)"
                          "unable to websocket connection url")

                raise ValueError(_("bad_request (http400),check path"))