)]}'
{"networking_odl/ml2/mech_driver_v2.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":56,"context_line":"        self.port_binding_controller \u003d port_binding.PortBindingManager.create()"},{"line_number":57,"context_line":"        self.trunk_driver \u003d trunk_driver.OpenDaylightTrunkDriverV2.create()"},{"line_number":58,"context_line":"        self._start_maintenance_thread()"},{"line_number":59,"context_line":"        port_status_update.OdlPortStatusUpdate()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _start_maintenance_thread(self):"},{"line_number":62,"context_line":"        # start the maintenance thread and register all the maintenance"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_621f5c08","line":59,"range":{"start_line":59,"start_character":8,"end_line":59,"end_character":48},"updated":"2017-03-10 03:04:42.000000000","message":"this needs to be referenced.\ne.g. self.xxx \u003d xxx.\notherwise, it may be subject to gc.","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"}],"networking_odl/ml2/port_status_update.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_a2feb4ab","line":1,"range":{"start_line":1,"start_character":16,"end_line":1,"end_character":20},"updated":"2017-03-10 03:04:42.000000000","message":"2017","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"6a023dc7ac160b276e7d38ce35b1f86c36ecb127","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def __init__(self):"},{"line_number":36,"context_line":"        # Opendaylight path to recieve websocket notifications on"},{"line_number":37,"context_line":"        neutron_ports_path \u003d \"\"\"/neutron:neutron/neutron:ports\"\"\""},{"line_number":38,"context_line":"        restconf_url \u003d \"restconf/operational/neutron:neutron/ports\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        self.ports_uri \u003d self._make_ports_uri("},{"line_number":41,"context_line":"            cfg.CONF.ml2_odl.url, restconf_url)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_6bd634f2","line":38,"range":{"start_line":37,"start_character":7,"end_line":38,"end_character":67},"updated":"2017-03-10 19:20:43.000000000","message":"are these path configurable or is there a way to get these from configuration ? if there is a way, then i\u0027ll say not hardcode these and fetch from config or might be helper for fetching these can be added.\n\nbut if they are going to stay same no matter what then can you consider moving it to constants so that that operations can also make use of these while using websocket to communicate with odl.","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        self.path_uri \u003d self._make_odl_url(cfg.CONF.ml2_odl.url)"},{"line_number":43,"context_line":"        self.odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client("},{"line_number":44,"context_line":"            url\u003dself.ports_uri)"},{"line_number":45,"context_line":"        self.agents_db \u003d directory.get_plugin()"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.odl_websocket_client \u003d ("},{"line_number":48,"context_line":"            odl_ws_client.OpendaylightWebsocketClient.odl_create_websocket("}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_02b22006","line":45,"range":{"start_line":45,"start_character":13,"end_line":45,"end_character":47},"updated":"2017-03-10 03:04:42.000000000","message":"this is a l2 plugin. not agent","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":54,"context_line":"            ))"},{"line_number":55,"context_line":"        if self.odl_websocket_client is None:"},{"line_number":56,"context_line":"            LOG.error(_LE(\"Error starting websocket thread\"))"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"    def _process_websocket_recv(self, payload, reconnect):"},{"line_number":59,"context_line":"        # Callback for websocket notification"},{"line_number":60,"context_line":"        LOG.debug(\"Websocket notification for port status update\")"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_c2a2c8ad","line":57,"updated":"2017-03-10 03:04:42.000000000","message":"raise exception to block neutron to boot.","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        for event in odl_ws_client.EventDataParser.get_item(payload):"},{"line_number":62,"context_line":"            try:"},{"line_number":63,"context_line":"                operation, path, data \u003d event.get_fields()"},{"line_number":64,"context_line":"                if ((operation \u003d\u003d event.OPERATION_UPDATE) or"},{"line_number":65,"context_line":"                   (operation \u003d\u003d event.OPERATION_CREATE)):"},{"line_number":66,"context_line":"                    port_id \u003d event.extract_field(path, \"neutron:uuid\")"},{"line_number":67,"context_line":"                    status \u003d data[\u0027status\u0027][\u0027content\u0027]"},{"line_number":68,"context_line":"                    LOG.debug(\"Update port for port id %s %s\", port_id, status)"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_427ed819","line":65,"range":{"start_line":64,"start_character":19,"end_line":65,"end_character":58},"updated":"2017-03-10 03:04:42.000000000","message":"operation in [CREATE, UPDATE]","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":67,"context_line":"                    status \u003d data[\u0027status\u0027][\u0027content\u0027]"},{"line_number":68,"context_line":"                    LOG.debug(\"Update port for port id %s %s\", port_id, status)"},{"line_number":69,"context_line":"                    # update port"},{"line_number":70,"context_line":"                    self.agents_db.update_port("},{"line_number":71,"context_line":"                        context.get_admin_context(), port_id,"},{"line_number":72,"context_line":"                        {\u0027port\u0027: {\u0027status\u0027: status}})"},{"line_number":73,"context_line":"                if operation \u003d\u003d event.OPERATION_DELETE:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_82d9b024","line":70,"range":{"start_line":70,"start_character":35,"end_line":70,"end_character":46},"updated":"2017-03-10 03:04:42.000000000","message":"update_port_status can be used.","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        for port in ports:"},{"line_number":100,"context_line":"            port_id \u003d port[\u0027id\u0027]"},{"line_number":101,"context_line":"            status \u003d port[\u0027status\u0027]"},{"line_number":102,"context_line":"            self.agents_db.update_port("},{"line_number":103,"context_line":"                context.get_admin_context(), port_id,"},{"line_number":104,"context_line":"                {\u0027port\u0027: {\u0027status\u0027: status}})"},{"line_number":105,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_42d33804","line":102,"range":{"start_line":102,"start_character":27,"end_line":102,"end_character":38},"updated":"2017-03-10 03:04:42.000000000","message":"update_port_status can be used.","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":111,"context_line":"        except exceptions.ConnectionError:"},{"line_number":112,"context_line":"            LOG.error(_LE(\"Cannot connect to the Opendaylight Controller\"),"},{"line_number":113,"context_line":"                      exc_info\u003dTrue)"},{"line_number":114,"context_line":"            return None"},{"line_number":115,"context_line":"        except exceptions.HTTPError as e:"},{"line_number":116,"context_line":"            # restconf returns 404 on operation when there is no entry"},{"line_number":117,"context_line":"            if e.response.status_code \u003d\u003d codes.not_found:"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_2201e46a","line":114,"range":{"start_line":114,"start_character":19,"end_line":114,"end_character":23},"updated":"2017-03-10 03:04:42.000000000","message":"None or []?\nPlease be consistent.","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        return ports"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"    def _get_neutron_db_plugin(self):"},{"line_number":142,"context_line":"        return directory.get_plugin()"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def _make_ports_uri(self, odl_url\u003dNone, path\u003d\u0027\u0027):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_2238043d","line":141,"range":{"start_line":141,"start_character":8,"end_line":141,"end_character":31},"updated":"2017-03-10 03:04:42.000000000","message":"not used.","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ded0b0d35caf5ffcf11d90438e489c7d33f68533","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def _make_ports_uri(self, odl_url\u003dNone, path\u003d\u0027\u0027):"},{"line_number":145,"context_line":"        \"\"\"Make ODL ports URI with host/port extraced from ODL_URL.\"\"\""},{"line_number":146,"context_line":"        odl_url \u003d odl_url or \u0027http://localhost:8080/\u0027"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"        # extract ODL_IP and ODL_PORT from ODL_ENDPOINT and append path"},{"line_number":149,"context_line":"        # urlsplit and urlunparse don\u0027t throw exceptions"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a30ddce_623e7c29","line":146,"range":{"start_line":146,"start_character":26,"end_line":146,"end_character":53},"updated":"2017-03-10 03:04:42.000000000","message":"don\u0027t fall back. this kind of value should be default value of option.","commit_id":"2d2d3ffe0086ea584531fed0b68ef44391b48350"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"fdd90ce9b77a7d1b8cc099e2858e92527e82b277","unresolved":false,"context_lines":[{"line_number":1,"context_line":"# Copyright (c) 2016 OpenStack Foundation"},{"line_number":2,"context_line":"# All Rights Reserved."},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"#    Licensed under the Apache License, Version 2.0 (the \"License\"); you may"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_057145a8","line":1,"range":{"start_line":1,"start_character":16,"end_line":1,"end_character":21},"updated":"2017-03-22 02:16:58.000000000","message":"2017","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"2bb752e8a834eab4eb83ed5a3d3b613c17b6f981","unresolved":false,"context_lines":[{"line_number":30,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":"class OdlPortStatusUpdate(object):"},{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def __init__(self):"},{"line_number":36,"context_line":"        # Opendaylight path to recieve websocket notifications on"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a1ff146_42ff3a01","line":33,"updated":"2017-03-15 09:04:04.000000000","message":"I know this patch is still tagged as experimental so ignore this if it is inappropriate but I think there should be a comment here that explains what this class is responsible for and how it achieves those responsibilities.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def __init__(self):"},{"line_number":36,"context_line":"        # Opendaylight path to recieve websocket notifications on"},{"line_number":37,"context_line":"        neutron_ports_path \u003d \"\"\"/neutron:neutron/neutron:ports\"\"\""},{"line_number":38,"context_line":"        restconf_url \u003d \"restconf/operational/neutron:neutron/ports\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        self.ports_uri \u003d self._make_ports_uri("}],"source_content_type":"text/x-python","patch_set":3,"id":"3a1ff146_6452aadf","line":37,"range":{"start_line":37,"start_character":29,"end_line":37,"end_character":32},"updated":"2017-03-19 12:49:33.000000000","message":"nit: why triple quotes?","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def __init__(self):"},{"line_number":36,"context_line":"        # Opendaylight path to recieve websocket notifications on"},{"line_number":37,"context_line":"        neutron_ports_path \u003d \"\"\"/neutron:neutron/neutron:ports\"\"\""},{"line_number":38,"context_line":"        restconf_url \u003d \"restconf/operational/neutron:neutron/ports\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        self.ports_uri \u003d self._make_ports_uri("},{"line_number":41,"context_line":"            cfg.CONF.ml2_odl.url, restconf_url)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a1ff146_6400eaab","line":38,"range":{"start_line":37,"start_character":8,"end_line":38,"end_character":67},"updated":"2017-03-19 12:49:33.000000000","message":"These are just constant strings, why assign to a variable?","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":37,"context_line":"        neutron_ports_path \u003d \"\"\"/neutron:neutron/neutron:ports\"\"\""},{"line_number":38,"context_line":"        restconf_url \u003d \"restconf/operational/neutron:neutron/ports\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"        self.ports_uri \u003d self._make_ports_uri("},{"line_number":41,"context_line":"            cfg.CONF.ml2_odl.url, restconf_url)"},{"line_number":42,"context_line":"        self.path_uri \u003d self._make_odl_url(cfg.CONF.ml2_odl.url)"},{"line_number":43,"context_line":"        self.odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client("},{"line_number":44,"context_line":"            url\u003dself.ports_uri)"},{"line_number":45,"context_line":"        self.db \u003d directory.get_plugin()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_0530ce9d","line":42,"range":{"start_line":40,"start_character":8,"end_line":42,"end_character":64},"updated":"2017-03-19 12:49:33.000000000","message":"These arent used beyond the constructor, no need to put them in \u0027self\u0027","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":42,"context_line":"        self.path_uri \u003d self._make_odl_url(cfg.CONF.ml2_odl.url)"},{"line_number":43,"context_line":"        self.odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client("},{"line_number":44,"context_line":"            url\u003dself.ports_uri)"},{"line_number":45,"context_line":"        self.db \u003d directory.get_plugin()"},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"        self.odl_websocket_client \u003d ("},{"line_number":48,"context_line":"            odl_ws_client.OpendaylightWebsocketClient.odl_create_websocket("}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_6597c290","line":45,"range":{"start_line":45,"start_character":8,"end_line":45,"end_character":15},"updated":"2017-03-19 12:49:33.000000000","message":"This name is very confusing, plugin or l2_plugin is much better","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":52,"context_line":"                self._process_websocket_recv,"},{"line_number":53,"context_line":"                self._process_websocket_reconnect"},{"line_number":54,"context_line":"            ))"},{"line_number":55,"context_line":"        if self.odl_websocket_client is None:"},{"line_number":56,"context_line":"            LOG.error(_LE(\"Error starting websocket thread\"))"},{"line_number":57,"context_line":"            raise Exception(_(\"Error starting websocket thread\"))"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _process_websocket_recv(self, payload, reconnect):"},{"line_number":60,"context_line":"        # Callback for websocket notification"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_05860e65","line":57,"range":{"start_line":55,"start_character":8,"end_line":57,"end_character":65},"updated":"2017-03-19 12:49:33.000000000","message":"Why would this ever happen?","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":68,"context_line":"                    status \u003d data[\u0027status\u0027][\u0027content\u0027]"},{"line_number":69,"context_line":"                    LOG.debug(\"Update port for port id %s %s\", port_id, status)"},{"line_number":70,"context_line":"                    # update port"},{"line_number":71,"context_line":"                    self.db.update_port_status(context.get_admin_context(),"},{"line_number":72,"context_line":"                                               port_id, status)"},{"line_number":73,"context_line":"                if operation \u003d\u003d event.OPERATION_DELETE:"},{"line_number":74,"context_line":"                    LOG.debug(\"PortStatus: Ignoring delete operation\")"},{"line_number":75,"context_line":"            except KeyError:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_7ad75dbf","line":72,"range":{"start_line":71,"start_character":20,"end_line":72,"end_character":63},"updated":"2017-03-19 12:49:33.000000000","message":"Generally we shouldn\u0027t be updating the DB directly.\n\nInstead the correct way to do this would be to use provisioning blocks which need to be inserted when a port is created or updated (same as ML2 OVS driver does it) and removed here.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":72,"context_line":"                                               port_id, status)"},{"line_number":73,"context_line":"                if operation \u003d\u003d event.OPERATION_DELETE:"},{"line_number":74,"context_line":"                    LOG.debug(\"PortStatus: Ignoring delete operation\")"},{"line_number":75,"context_line":"            except KeyError:"},{"line_number":76,"context_line":"                LOG.warning(_LW(\"Invalid JSON for websocket notification\"))"},{"line_number":77,"context_line":"                continue"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def _process_websocket_reconnect(self, status):"},{"line_number":80,"context_line":"        if status \u003d\u003d odl_ws_client.ODL_WEBSOCKET_CONNECTED:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_1a6e6901","line":77,"range":{"start_line":75,"start_character":12,"end_line":77,"end_character":24},"updated":"2017-03-19 12:49:33.000000000","message":"Why expect KeyError?\n\nThe code should be robust enough not to cause these, and if they are cause I\u0027d like to know about it and not suppress it.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"2bb752e8a834eab4eb83ed5a3d3b613c17b6f981","unresolved":false,"context_lines":[{"line_number":76,"context_line":"                LOG.warning(_LW(\"Invalid JSON for websocket notification\"))"},{"line_number":77,"context_line":"                continue"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"    def _process_websocket_reconnect(self, status):"},{"line_number":80,"context_line":"        if status \u003d\u003d odl_ws_client.ODL_WEBSOCKET_CONNECTED:"},{"line_number":81,"context_line":"            # Get port data using restconf"},{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a1ff146_178e6278","line":79,"updated":"2017-03-15 09:04:04.000000000","message":"since processing the reconnect may involve more than just a single status update, does it make sense to do it in another thread?","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"2bb752e8a834eab4eb83ed5a3d3b613c17b6f981","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":83,"context_line":"            self._get_and_update_port_status()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_and_update_port_status(self, session\u003dNone):"},{"line_number":86,"context_line":"        LOG.info(_LI(\"REST/GET ports from ODL\"))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        ports \u003d self._rest_get_ports()"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a1ff146_b7410e3c","line":85,"updated":"2017-03-15 09:04:04.000000000","message":"I think it is really important to only fetch the ports that are not ACTIVE. The code should query the neutron db for devices that are not yet ACTIVE and query ODL for their status one at a time. There will really only be a few of these at any given time. Why? Because any disruption in the websocket connection is almost certainly guaranteed to come along with a general lack of connection between neutron and ODL so new ports will not be created during that period. On the other hand, if we pull all the ports there could be bazillions of them.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"81f573dd777e76a486be13ad3fcb9a53092bd228","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":83,"context_line":"            self._get_and_update_port_status()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_and_update_port_status(self, session\u003dNone):"},{"line_number":86,"context_line":"        LOG.info(_LI(\"REST/GET ports from ODL\"))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        ports \u003d self._rest_get_ports()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_25deaa3f","line":85,"in_reply_to":"1a1ced50_149ac263","updated":"2017-03-19 12:53:03.000000000","message":"A few points.\n\n1. It will be very hard to get good scale test numbers. The reason for this is that the real world scenario is crucial here. We\u0027re not just interested in the relative speed of one method vs. the other. It really depends on how many down ports there would be when the connection goes down in a real world deployment. \n\n2. My own *guess* is that it would generally be a small number because if the websocket goes down it is likely that neutron in general has lost connectivity to ODL and therefor no new ports will (or should) be created in the interval of time until the connection is resumed.\n\n3. We know for sure that there can be millions of ports. Pulling the JSON for all these will be megabytes of data...and then it needs to be parsed.\n\n4. While it is true that retrieving X ports one at a time is slower than retrieving X ports in bulk with one request, that is not the case here. In any large deployment the vast majority of ports will be ACTIVE and only a few DOWN at any given time. Given all this, I think it would be a big mistake to pull ALL ports every time there is a dropped websocket connection. There might not even be any non-ACTIVE ports!\nRetrieving all the ports guarantees problematic performance in large deployments. Per-port retrieve will *probably* be OK since the odds are there will not be a lot of non-ACTIVE ports, even in large deployments.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"6a96fa42d151b1244caddfd09ba419e3e627f021","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":83,"context_line":"            self._get_and_update_port_status()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_and_update_port_status(self, session\u003dNone):"},{"line_number":86,"context_line":"        LOG.info(_LI(\"REST/GET ports from ODL\"))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        ports \u003d self._rest_get_ports()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_d959085c","line":85,"in_reply_to":"1a1ced50_25deaa3f","updated":"2017-03-21 05:26:45.000000000","message":"Discussed this with Isaku today. This solution seems ok and will update the patch accordingly.\nOne concern is that this solution is not generic and is specific to the current Netvirt implementation. There was a suggestion earlier to implement a similar kind of scheme on ODL side. May be eventually it will make sense to do that.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"8ce0b4f08f5bec975daad74ef3c5ee5f9ca94c2b","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":83,"context_line":"            self._get_and_update_port_status()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_and_update_port_status(self, session\u003dNone):"},{"line_number":86,"context_line":"        LOG.info(_LI(\"REST/GET ports from ODL\"))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        ports \u003d self._rest_get_ports()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_4bea27dc","line":85,"in_reply_to":"1a1ced50_2a79aec8","updated":"2017-03-23 11:55:22.000000000","message":"I think that so long as we avoid pulling EVERYTHING it shouldn\u0027t matter how any *total* ports there are. The only performance issue with my proposal is that it requires a round-trip per port in transitioning state, which I think we can assume for now will never be too many. \n\nWhat do you feel about my proposal is less _correct_?","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"244836ea00febd55e0cbd1347d39166934a83f72","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":83,"context_line":"            self._get_and_update_port_status()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_and_update_port_status(self, session\u003dNone):"},{"line_number":86,"context_line":"        LOG.info(_LI(\"REST/GET ports from ODL\"))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        ports \u003d self._rest_get_ports()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_855eb910","line":85,"in_reply_to":"1a1ced50_4bea27dc","updated":"2017-03-23 19:10:58.000000000","message":"I\u0027m discussing a tradeoff of return vs implementation cost.\n\nIf you implement with new patches on top of this patch and do its evaluation, I\u0027m very happy. Please go implement it.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"fdd90ce9b77a7d1b8cc099e2858e92527e82b277","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":83,"context_line":"            self._get_and_update_port_status()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_and_update_port_status(self, session\u003dNone):"},{"line_number":86,"context_line":"        LOG.info(_LI(\"REST/GET ports from ODL\"))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        ports \u003d self._rest_get_ports()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_2a79aec8","line":85,"in_reply_to":"1a1ced50_54e95f7f","updated":"2017-03-22 02:16:58.000000000","message":"Josh, do you have any scalability target?\ne.g. 1K ports, 10K ports etc. very rough one is okay.\nIt determines how far we should go optimize.\nI can think of various optimizations. e.g. bulk port update, developing specialized protocol between networking-odl and ODL....\nBut without scalability target, it\u0027s quite unsure if it\u0027s worthwhile.\n\n\nPersonally we should do correctness first and then optimize it later.\nAnyway if we\u0027d like to do what you say, we should check ports where  admin_state_up !\u003d status instead of status \u003d\u003d DOWN.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"faa3738ec642a502d76192dbf5397971db41f89c","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":83,"context_line":"            self._get_and_update_port_status()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_and_update_port_status(self, session\u003dNone):"},{"line_number":86,"context_line":"        LOG.info(_LI(\"REST/GET ports from ODL\"))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        ports \u003d self._rest_get_ports()"}],"source_content_type":"text/x-python","patch_set":3,"id":"ffe62b97_7318bc80","line":85,"in_reply_to":"1a1ced50_855eb910","updated":"2017-03-24 07:03:15.000000000","message":"Ah, OK. No problem.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"7d6a157d58e1488d4bf1184133d2dfaff7e7d651","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":83,"context_line":"            self._get_and_update_port_status()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_and_update_port_status(self, session\u003dNone):"},{"line_number":86,"context_line":"        LOG.info(_LI(\"REST/GET ports from ODL\"))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        ports \u003d self._rest_get_ports()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_54e95f7f","line":85,"in_reply_to":"1a1ced50_d959085c","updated":"2017-03-21 06:10:11.000000000","message":"Sounds good. What do you mean by, \"implement a similar kind of scheme on ODL side\"?","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"e45628b63cc11c8c9055fbbfc9ab62ffa2156fde","unresolved":false,"context_lines":[{"line_number":82,"context_line":"            LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":83,"context_line":"            self._get_and_update_port_status()"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    def _get_and_update_port_status(self, session\u003dNone):"},{"line_number":86,"context_line":"        LOG.info(_LI(\"REST/GET ports from ODL\"))"},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"        ports \u003d self._rest_get_ports()"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_149ac263","line":85,"in_reply_to":"3a1ff146_b7410e3c","updated":"2017-03-19 07:01:47.000000000","message":"Currently there is only one http request required to query the ports. The proposed solution will result in making http queries equivalent to number of not ACTIVE ports. At this point it is hard to say which approach will scale better. The best course will be run some scale tests first. Also we need to check how websocket implementation behaves at scale to validate the whole approach.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"2bb752e8a834eab4eb83ed5a3d3b613c17b6f981","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        LOG.debug(\"Updating DB with ODL ports status\")"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"        for port in ports:"},{"line_number":100,"context_line":"            port_id \u003d port[\u0027id\u0027]"},{"line_number":101,"context_line":"            status \u003d port[\u0027status\u0027]"},{"line_number":102,"context_line":"            self.db.update_port_status(context.get_admin_context(),"},{"line_number":103,"context_line":"                                       port_id, status)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a1ff146_7ca5bd02","line":100,"updated":"2017-03-15 09:04:04.000000000","message":"uuid","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":99,"context_line":"        for port in ports:"},{"line_number":100,"context_line":"            port_id \u003d port[\u0027id\u0027]"},{"line_number":101,"context_line":"            status \u003d port[\u0027status\u0027]"},{"line_number":102,"context_line":"            self.db.update_port_status(context.get_admin_context(),"},{"line_number":103,"context_line":"                                       port_id, status)"},{"line_number":104,"context_line":""},{"line_number":105,"context_line":"    def _rest_get_ports(self):"},{"line_number":106,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_baa63551","line":103,"range":{"start_line":102,"start_character":0,"end_line":103,"end_character":55},"updated":"2017-03-19 12:49:33.000000000","message":"Provisioning block should be used here as well","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"2bb752e8a834eab4eb83ed5a3d3b613c17b6f981","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        try:"},{"line_number":107,"context_line":"            response \u003d self.odl_rest_client.get()"},{"line_number":108,"context_line":"            response.raise_for_status()"},{"line_number":109,"context_line":"            ports \u003d response.json()[\u0027ports\u0027][\u0027port\u0027]"},{"line_number":110,"context_line":"        except exceptions.ConnectionError:"},{"line_number":111,"context_line":"            LOG.error(_LE(\"Cannot connect to the Opendaylight Controller\"),"},{"line_number":112,"context_line":"                      exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3a1ff146_7c7cdd72","line":109,"updated":"2017-03-15 09:04:04.000000000","message":"when there are no ports this returns \"{u\u0027ports\u0027: {}}\" and this line raises, \"KeyError: \u0027port\u0027\"","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            response \u003d self.odl_rest_client.get()"},{"line_number":108,"context_line":"            response.raise_for_status()"},{"line_number":109,"context_line":"            ports \u003d response.json()[\u0027ports\u0027][\u0027port\u0027]"},{"line_number":110,"context_line":"        except exceptions.ConnectionError:"},{"line_number":111,"context_line":"            LOG.error(_LE(\"Cannot connect to the Opendaylight Controller\"),"},{"line_number":112,"context_line":"                      exc_info\u003dTrue)"},{"line_number":113,"context_line":"            return None"},{"line_number":114,"context_line":"        except exceptions.HTTPError as e:"},{"line_number":115,"context_line":"            # restconf returns 404 on operation when there is no entry"},{"line_number":116,"context_line":"            if e.response.status_code \u003d\u003d codes.not_found:"},{"line_number":117,"context_line":"                LOG.debug(\"Response code not_found (404)\""},{"line_number":118,"context_line":"                          \" treated as an empty list\")"},{"line_number":119,"context_line":"                return None"},{"line_number":120,"context_line":"            else:"},{"line_number":121,"context_line":"                LOG.warning(_LW(\"REST/GET odl port failed, \"),"},{"line_number":122,"context_line":"                            exc_info\u003dTrue)"},{"line_number":123,"context_line":"                return None"},{"line_number":124,"context_line":"        except KeyError:"},{"line_number":125,"context_line":"            LOG.error(_LE(\"got invalid ports\"),"},{"line_number":126,"context_line":"                      exc_info\u003dTrue)"},{"line_number":127,"context_line":"            return None"},{"line_number":128,"context_line":"        except Exception:"},{"line_number":129,"context_line":"            LOG.warning(_LW(\"REST/GET odl port failed, \"),"},{"line_number":130,"context_line":"                        exc_info\u003dTrue)"},{"line_number":131,"context_line":"            return None"},{"line_number":132,"context_line":"        else:"},{"line_number":133,"context_line":"            if LOG.isEnabledFor(logging.DEBUG):"},{"line_number":134,"context_line":"                _port_str \u003d jsonutils.dumps("}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_65142244","line":131,"range":{"start_line":110,"start_character":8,"end_line":131,"end_character":23},"updated":"2017-03-19 12:49:33.000000000","message":"Most of this seems irrelevant in this context, except the 404 this has little to do with the logic of this function so I\u0027d expect it to be handled up the call stack","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"7bb27d69c50ab85b80359befc1522daeee5c280c","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            response \u003d self.odl_rest_client.get()"},{"line_number":108,"context_line":"            response.raise_for_status()"},{"line_number":109,"context_line":"            ports \u003d response.json()[\u0027ports\u0027][\u0027port\u0027]"},{"line_number":110,"context_line":"        except exceptions.ConnectionError:"},{"line_number":111,"context_line":"            LOG.error(_LE(\"Cannot connect to the Opendaylight Controller\"),"},{"line_number":112,"context_line":"                      exc_info\u003dTrue)"},{"line_number":113,"context_line":"            return None"},{"line_number":114,"context_line":"        except exceptions.HTTPError as e:"},{"line_number":115,"context_line":"            # restconf returns 404 on operation when there is no entry"},{"line_number":116,"context_line":"            if e.response.status_code \u003d\u003d codes.not_found:"},{"line_number":117,"context_line":"                LOG.debug(\"Response code not_found (404)\""},{"line_number":118,"context_line":"                          \" treated as an empty list\")"},{"line_number":119,"context_line":"                return None"},{"line_number":120,"context_line":"            else:"},{"line_number":121,"context_line":"                LOG.warning(_LW(\"REST/GET odl port failed, \"),"},{"line_number":122,"context_line":"                            exc_info\u003dTrue)"},{"line_number":123,"context_line":"                return None"},{"line_number":124,"context_line":"        except KeyError:"},{"line_number":125,"context_line":"            LOG.error(_LE(\"got invalid ports\"),"},{"line_number":126,"context_line":"                      exc_info\u003dTrue)"},{"line_number":127,"context_line":"            return None"},{"line_number":128,"context_line":"        except Exception:"},{"line_number":129,"context_line":"            LOG.warning(_LW(\"REST/GET odl port failed, \"),"},{"line_number":130,"context_line":"                        exc_info\u003dTrue)"},{"line_number":131,"context_line":"            return None"},{"line_number":132,"context_line":"        else:"},{"line_number":133,"context_line":"            if LOG.isEnabledFor(logging.DEBUG):"},{"line_number":134,"context_line":"                _port_str \u003d jsonutils.dumps("}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_4b7f8714","line":131,"range":{"start_line":110,"start_character":8,"end_line":131,"end_character":23},"in_reply_to":"1a1ced50_2543a143","updated":"2017-03-23 11:57:27.000000000","message":"The KeyError looks suspicious to me. The ConnectionError and the HTTPErrors must be handled here. That leaves the plain Exception. I\u0027m not sure but I\u0027d err on the side of leaving it.","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"fdd90ce9b77a7d1b8cc099e2858e92527e82b277","unresolved":false,"context_lines":[{"line_number":107,"context_line":"            response \u003d self.odl_rest_client.get()"},{"line_number":108,"context_line":"            response.raise_for_status()"},{"line_number":109,"context_line":"            ports \u003d response.json()[\u0027ports\u0027][\u0027port\u0027]"},{"line_number":110,"context_line":"        except exceptions.ConnectionError:"},{"line_number":111,"context_line":"            LOG.error(_LE(\"Cannot connect to the Opendaylight Controller\"),"},{"line_number":112,"context_line":"                      exc_info\u003dTrue)"},{"line_number":113,"context_line":"            return None"},{"line_number":114,"context_line":"        except exceptions.HTTPError as e:"},{"line_number":115,"context_line":"            # restconf returns 404 on operation when there is no entry"},{"line_number":116,"context_line":"            if e.response.status_code \u003d\u003d codes.not_found:"},{"line_number":117,"context_line":"                LOG.debug(\"Response code not_found (404)\""},{"line_number":118,"context_line":"                          \" treated as an empty list\")"},{"line_number":119,"context_line":"                return None"},{"line_number":120,"context_line":"            else:"},{"line_number":121,"context_line":"                LOG.warning(_LW(\"REST/GET odl port failed, \"),"},{"line_number":122,"context_line":"                            exc_info\u003dTrue)"},{"line_number":123,"context_line":"                return None"},{"line_number":124,"context_line":"        except KeyError:"},{"line_number":125,"context_line":"            LOG.error(_LE(\"got invalid ports\"),"},{"line_number":126,"context_line":"                      exc_info\u003dTrue)"},{"line_number":127,"context_line":"            return None"},{"line_number":128,"context_line":"        except Exception:"},{"line_number":129,"context_line":"            LOG.warning(_LW(\"REST/GET odl port failed, \"),"},{"line_number":130,"context_line":"                        exc_info\u003dTrue)"},{"line_number":131,"context_line":"            return None"},{"line_number":132,"context_line":"        else:"},{"line_number":133,"context_line":"            if LOG.isEnabledFor(logging.DEBUG):"},{"line_number":134,"context_line":"                _port_str \u003d jsonutils.dumps("}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_2543a143","line":131,"range":{"start_line":110,"start_character":8,"end_line":131,"end_character":23},"in_reply_to":"1a1ced50_65142244","updated":"2017-03-22 02:16:58.000000000","message":"Josh, do you have any comment?","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def _make_ports_uri(self, odl_url\u003dNone, path\u003d\u0027\u0027):"},{"line_number":141,"context_line":"        \"\"\"Make ODL ports URI with host/port extraced from ODL_URL.\"\"\""},{"line_number":142,"context_line":"        odl_url \u003d odl_url"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        # extract ODL_IP and ODL_PORT from ODL_ENDPOINT and append path"},{"line_number":145,"context_line":"        # urlsplit and urlunparse don\u0027t throw exceptions"}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_850f5e2d","line":142,"range":{"start_line":142,"start_character":0,"end_line":142,"end_character":25},"updated":"2017-03-19 12:49:33.000000000","message":"Huh?","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a878c10c14045fe436ee4bed0013b03d674116f5","unresolved":false,"context_lines":[{"line_number":137,"context_line":""},{"line_number":138,"context_line":"        return ports"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"    def _make_ports_uri(self, odl_url\u003dNone, path\u003d\u0027\u0027):"},{"line_number":141,"context_line":"        \"\"\"Make ODL ports URI with host/port extraced from ODL_URL.\"\"\""},{"line_number":142,"context_line":"        odl_url \u003d odl_url"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"        # extract ODL_IP and ODL_PORT from ODL_ENDPOINT and append path"},{"line_number":145,"context_line":"        # urlsplit and urlunparse don\u0027t throw exceptions"},{"line_number":146,"context_line":"        purl \u003d urlparse.urlsplit(odl_url)"},{"line_number":147,"context_line":"        return urlparse.urlunparse((purl.scheme, purl.netloc,"},{"line_number":148,"context_line":"                                    path, \u0027\u0027, \u0027\u0027, \u0027\u0027))"},{"line_number":149,"context_line":""},{"line_number":150,"context_line":"    def _make_odl_url(self, odl_url):"},{"line_number":151,"context_line":"        \"\"\"Extract host/port from ODL_URL to use for websocket.\"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a1ced50_8592fe9d","line":148,"range":{"start_line":140,"start_character":0,"end_line":148,"end_character":54},"updated":"2017-03-19 12:49:33.000000000","message":"You can simply use https://docs.python.org/3/library/urllib.parse.html#module-urllib.parse","commit_id":"18d10b9b5d31b4a27b1a94007e8e1738c6dd46fa"}]}
