)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"b9b0d6c597c58449c145ac97ba9acd081a9b476d","unresolved":false,"context_lines":[{"line_number":7,"context_line":"WIP: Adding Websocket client for ODL"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ODL provides websocket based notifications."},{"line_number":10,"context_line":"https://wiki.opendaylight.org/view/OpenDaylight_"},{"line_number":11,"context_line":"Controller:MD-SAL:Restconf:Change_event_notification_"},{"line_number":12,"context_line":"subscription.Currently Pseudo Agent port binding uses"},{"line_number":13,"context_line":"polling to read host config from ODL. Websocket can"},{"line_number":14,"context_line":"be used as alternative to receive notification for"},{"line_number":15,"context_line":"host config changes. This patch adds the basic"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"7a3c09a3_b9a16348","line":12,"range":{"start_line":10,"start_character":0,"end_line":12,"end_character":12},"updated":"2017-01-17 20:25:01.000000000","message":"nitpick:what about not break line?","commit_id":"805d774ea549651199b4d4085d41cfe088023e5f"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"98029b051985041c3bf1ed12f28fb3c7bdb4b7b3","unresolved":false,"context_lines":[{"line_number":7,"context_line":"WIP: Adding Websocket client for ODL"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ODL provides websocket based notifications."},{"line_number":10,"context_line":"https://wiki.opendaylight.org/view/OpenDaylight_"},{"line_number":11,"context_line":"Controller:MD-SAL:Restconf:Change_event_notification_"},{"line_number":12,"context_line":"subscription.Currently Pseudo Agent port binding uses"},{"line_number":13,"context_line":"polling to read host config from ODL. Websocket can"},{"line_number":14,"context_line":"be used as alternative to receive notification for"},{"line_number":15,"context_line":"host config changes. This patch adds the basic"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a461143_b7a99892","line":12,"range":{"start_line":10,"start_character":0,"end_line":12,"end_character":12},"in_reply_to":"7a3c09a3_b9a16348","updated":"2017-01-29 13:03:52.000000000","message":"She had to because of line length restriction of 72 chars..\n\nMaybe a URL shortener can be used?","commit_id":"805d774ea549651199b4d4085d41cfe088023e5f"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"6f191ee810037482f6e7cfb4cd71aae621634d17","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding Websocket client for ODL"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ODL provides websocket based notifications."},{"line_number":10,"context_line":"https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription."},{"line_number":11,"context_line":"Currently Pseudo Agent port binding uses"},{"line_number":12,"context_line":"polling to read host config from ODL. Websocket can"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa31d9ce_ba28b6e3","line":9,"range":{"start_line":9,"start_character":29,"end_line":9,"end_character":42},"updated":"2017-02-14 02:14:36.000000000","message":"does this mechanism \"replay\" the all existing data on connect?\notherwise we\u0027ll lose events while disconnected.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"eafeccec9f372a9db417ed0ccd36ebaf6edcbef8","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding Websocket client for ODL"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ODL provides websocket based notifications."},{"line_number":10,"context_line":"https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription."},{"line_number":11,"context_line":"Currently Pseudo Agent port binding uses"},{"line_number":12,"context_line":"polling to read host config from ODL. Websocket can"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa31d9ce_e6a29398","line":9,"range":{"start_line":9,"start_character":29,"end_line":9,"end_character":42},"in_reply_to":"fa31d9ce_70c1fd53","updated":"2017-02-14 05:19:50.000000000","message":"On the first connect of the websocket to ODL, all the events present up to that point are sent as a create operation notification. Subsequent re-connections do not result in notifications for those events. One solution can be to use restconf to manually sync up status with ODL before waiting for new events. Does this guarantee that no events will be missed?\n\nThat\u0027s correct every notification contains every node in that sub-tree even the one\u0027s that didn\u0027t change. For hostconfig use case the new nodes that are added come as \u0027create\u0027 notification and the nodes that are already present come as \u0027update\u0027 notification.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"91d41407ab59b9b0eae5cd5110e4ef579bf62d09","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding Websocket client for ODL"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ODL provides websocket based notifications."},{"line_number":10,"context_line":"https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription."},{"line_number":11,"context_line":"Currently Pseudo Agent port binding uses"},{"line_number":12,"context_line":"polling to read host config from ODL. Websocket can"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa31d9ce_35b630f9","line":9,"range":{"start_line":9,"start_character":29,"end_line":9,"end_character":42},"in_reply_to":"fa31d9ce_96b2a6e3","updated":"2017-02-16 00:33:11.000000000","message":"Currently ODL doesn\u0027t support (a) i.e. delete subscription. This requires enhancing ODL to add this capability. Based on this discussion that is the right thing to do here. I\u0027ll create a bug in ODL bugzilla for this.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"c1c4694fe9dbfaec7922befc21c721ddb1222f57","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding Websocket client for ODL"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ODL provides websocket based notifications."},{"line_number":10,"context_line":"https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription."},{"line_number":11,"context_line":"Currently Pseudo Agent port binding uses"},{"line_number":12,"context_line":"polling to read host config from ODL. Websocket can"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa31d9ce_70c1fd53","line":9,"range":{"start_line":9,"start_character":29,"end_line":9,"end_character":42},"in_reply_to":"fa31d9ce_ba28b6e3","updated":"2017-02-14 03:22:17.000000000","message":"I checked...partially. For certain if you create a new subscription you will not receive events that occurred before that subscription, even if you had a previous, identical subscription. I will be looking into this further today and will try what happens with a single subscription with a disconnect in the middle (whether events during disconnect are lost).\n\nAnother potential issue I figured I\u0027d mention is that if you subscribe to a node in the md-sal tree, every notification will contain every node in that sub-tree - even those that did not change!","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"69193ca2a5202270178d542c66d6f07d4a5c185b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding Websocket client for ODL"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ODL provides websocket based notifications."},{"line_number":10,"context_line":"https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription."},{"line_number":11,"context_line":"Currently Pseudo Agent port binding uses"},{"line_number":12,"context_line":"polling to read host config from ODL. Websocket can"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa31d9ce_ea2a358f","line":9,"range":{"start_line":9,"start_character":29,"end_line":9,"end_character":42},"in_reply_to":"fa31d9ce_e6a29398","updated":"2017-02-14 18:40:10.000000000","message":"It causes race condition to use two sources.\nIn order to recieve only delta, probably ODL netconf needs to be fixed.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"cc81881fb8b80bb72bbc936dfc006f39bc466ca1","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Adding Websocket client for ODL"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"ODL provides websocket based notifications."},{"line_number":10,"context_line":"https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:Change_event_notification_subscription."},{"line_number":11,"context_line":"Currently Pseudo Agent port binding uses"},{"line_number":12,"context_line":"polling to read host config from ODL. Websocket can"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"fa31d9ce_96b2a6e3","line":9,"range":{"start_line":9,"start_character":29,"end_line":9,"end_character":42},"in_reply_to":"fa31d9ce_ea2a358f","updated":"2017-02-15 11:01:08.000000000","message":"Isaku, that sounds about right. Here\u0027s another option I put in a different comment on this review. This will be simpler and also not have race condition issues:\n\nAnother idea I just had was that perhaps when a disconnect happens the correct thing to do is (a) delete the subscription and then (b) resubscribe. Whoever writes code to use this class will need to be able the initial \"create\" events that happened before the subscription so the code to deal with this will exist already. I think either the callback method or this will work but though I\u0027d just throw this idea out as well.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"}],"networking_odl/common/config.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"69193ca2a5202270178d542c66d6f07d4a5c185b","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    cfg.IntOpt(\u0027restconf_poll_interval\u0027, default\u003d30,"},{"line_number":59,"context_line":"               help\u003d_(\"Poll interval in seconds for getting ODL hostconfig\")),"},{"line_number":60,"context_line":"    cfg.BoolOpt(\u0027enable_websocket_pseudo_agentdb\u0027,"},{"line_number":61,"context_line":"                default\u003dFalse,"},{"line_number":62,"context_line":"                help\u003d_(\u0027Enable websocket for pseudo-agent-binding.\u0027)),"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_4db43b81","line":61,"range":{"start_line":61,"start_character":24,"end_line":61,"end_character":29},"updated":"2017-02-14 18:40:10.000000000","message":"In Pike cycle, we\u0027d like to make this True.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ff765143d92538ab74c6b1bfc540b5db0e3b5120","unresolved":false,"context_lines":[{"line_number":59,"context_line":"               help\u003d_(\"Poll interval in seconds for getting ODL hostconfig\")),"},{"line_number":60,"context_line":"    cfg.BoolOpt(\u0027enable_websocket_pseudo_agentdb\u0027,"},{"line_number":61,"context_line":"                default\u003dFalse,"},{"line_number":62,"context_line":"                help\u003d_(\u0027Enable websocket for pseudo-agent-binding.\u0027)),"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"]"},{"line_number":65,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"5ff73747_8da0fb43","line":62,"range":{"start_line":62,"start_character":57,"end_line":62,"end_character":65},"updated":"2017-04-29 06:36:59.000000000","message":"nitpick: port-binding","commit_id":"415ed78841e01cc4c4c3b8d1f1ae35e01fd47dfe"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"b73e640cd90d5bf480add9e5c61e3435e21069cb","unresolved":false,"context_lines":[{"line_number":57,"context_line":"               default\u003d\"/restconf/operational/neutron:neutron/hostconfigs\"),"},{"line_number":58,"context_line":"    cfg.IntOpt(\u0027restconf_poll_interval\u0027, default\u003d30,"},{"line_number":59,"context_line":"               help\u003d_(\"Poll interval in seconds for getting ODL hostconfig\")),"},{"line_number":60,"context_line":"    cfg.BoolOpt(\u0027enable_websocket_pseudo_agentdb\u0027,"},{"line_number":61,"context_line":"                default\u003dFalse,"},{"line_number":62,"context_line":"                help\u003d_(\u0027Enable websocket for pseudo-agent-port-binding.\u0027)),"},{"line_number":63,"context_line":""},{"line_number":64,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":32,"id":"3f044301_8a8890c6","line":61,"range":{"start_line":60,"start_character":16,"end_line":61,"end_character":30},"updated":"2017-05-04 20:42:37.000000000","message":"nit: this could fit in one line without exceeding 72 chars","commit_id":"e28e759a197520906f8b4e037b0b69ab92b2102b"}],"networking_odl/common/websocket_client.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"b9b0d6c597c58449c145ac97ba9acd081a9b476d","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":2,"id":"7a3c09a3_99b5877f","line":1,"range":{"start_line":1,"start_character":16,"end_line":1,"end_character":20},"updated":"2017-01-17 20:25:01.000000000","message":"2017","commit_id":"805d774ea549651199b4d4085d41cfe088023e5f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"b9b0d6c597c58449c145ac97ba9acd081a9b476d","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    under the License"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"from autobahn.asyncio import websocket"},{"line_number":18,"context_line":"try:"},{"line_number":19,"context_line":"    import asyncio"},{"line_number":20,"context_line":"except ImportError:"},{"line_number":21,"context_line":"    import trollius as asyncio"},{"line_number":22,"context_line":"from networking_odl.common import client as odl_client"},{"line_number":23,"context_line":"from networking_odl._i18n import _LE, _LI"},{"line_number":24,"context_line":"from oslo_log import log"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_19aa7719","line":21,"range":{"start_line":17,"start_character":0,"end_line":21,"end_character":30},"updated":"2017-01-17 20:25:01.000000000","message":"Please update requirements.txt","commit_id":"805d774ea549651199b4d4085d41cfe088023e5f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"b9b0d6c597c58449c145ac97ba9acd081a9b476d","unresolved":false,"context_lines":[{"line_number":19,"context_line":"    import asyncio"},{"line_number":20,"context_line":"except ImportError:"},{"line_number":21,"context_line":"    import trollius as asyncio"},{"line_number":22,"context_line":"from networking_odl.common import client as odl_client"},{"line_number":23,"context_line":"from networking_odl._i18n import _LE, _LI"},{"line_number":24,"context_line":"from oslo_log import log"},{"line_number":25,"context_line":"import six.moves.urllib.parse as urlparse"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_5966bf2a","line":25,"range":{"start_line":22,"start_character":0,"end_line":25,"end_character":41},"updated":"2017-01-17 20:25:01.000000000","message":"pep8. imports.","commit_id":"805d774ea549651199b4d4085d41cfe088023e5f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"b9b0d6c597c58449c145ac97ba9acd081a9b476d","unresolved":false,"context_lines":[{"line_number":38,"context_line":"    odl_stream_url \u003d \"\"\"streams/stream/\"\"\""},{"line_number":39,"context_line":""},{"line_number":40,"context_line":"    odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client(odl_url)"},{"line_number":41,"context_line":"    response \u003d odl_rest_client.sendjson(\u0027post\u0027, odl_websocket_url, path)"},{"line_number":42,"context_line":"    try:"},{"line_number":43,"context_line":"        stream_name \u003d response.json()"},{"line_number":44,"context_line":"    except ValueError:"}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_fc3f59b1","line":41,"range":{"start_line":41,"start_character":41,"end_line":41,"end_character":45},"updated":"2017-01-17 20:25:01.000000000","message":"With this, ODL would create/allocate some resource? So don\u0027t we need cleanup part?\nAlthough it\u0027s acceptable to keep the resource in ODL as long as openstack is running, should we provide independent clean up script?","commit_id":"805d774ea549651199b4d4085d41cfe088023e5f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"b9b0d6c597c58449c145ac97ba9acd081a9b476d","unresolved":false,"context_lines":[{"line_number":57,"context_line":"class MessagingProtocol(websocket.WebSocketClientProtocol):"},{"line_number":58,"context_line":"    \"\"\"Class defines Messaging Protocol to be used with asyncio\"\"\""},{"line_number":59,"context_line":"    def __init__(self, path, handler):"},{"line_number":60,"context_line":"        websocket.WebSocketClientProtocol.__init__(self)"},{"line_number":61,"context_line":"        self.path \u003d path"},{"line_number":62,"context_line":"        self.handler \u003d handler"},{"line_number":63,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_9c6d75ce","line":60,"updated":"2017-01-17 20:25:01.000000000","message":"super().__init__()","commit_id":"805d774ea549651199b4d4085d41cfe088023e5f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"b9b0d6c597c58449c145ac97ba9acd081a9b476d","unresolved":false,"context_lines":[{"line_number":81,"context_line":"    protocol \u003d MessagingProtocol"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    def __init__(self, path, handler):"},{"line_number":84,"context_line":"        websocket.WebSocketClientFactory.__init__(self)"},{"line_number":85,"context_line":"        self.handler \u003d handler"},{"line_number":86,"context_line":"        self.path \u003d path"},{"line_number":87,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"7a3c09a3_7c7a8989","line":84,"updated":"2017-01-17 20:25:01.000000000","message":"super().__init__()","commit_id":"805d774ea549651199b4d4085d41cfe088023e5f"},{"author":{"_account_id":7921,"name":"Mike Kolesnik","email":"mkolesni@redhat.com","username":"mkolesni"},"change_message_id":"a8d1d90737642e733a60ca5705ffe6ad9501899b","unresolved":false,"context_lines":[{"line_number":125,"context_line":"                coro \u003d self.loop.create_connection(factory, hostname, port)"},{"line_number":126,"context_line":"                self.loop.run_until_complete(coro)"},{"line_number":127,"context_line":"            except Exception:"},{"line_number":128,"context_line":"                LOG.error(_LE(\"Enable to process Websocket Client request\"))"},{"line_number":129,"context_line":"        self._start_event_loop()"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    # Event loop waits for all URL\u0027s in the dict in the same thread"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_17ceec81","line":128,"range":{"start_line":128,"start_character":31,"end_line":128,"end_character":37},"updated":"2017-01-29 13:02:34.000000000","message":"Unable?","commit_id":"805d774ea549651199b4d4085d41cfe088023e5f"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"87b95d37f11428e946674419f247507e8aa1197c","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":5,"id":"1a430d35_a5766903","line":1,"updated":"2017-02-09 07:44:53.000000000","message":"2017","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","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":5,"id":"fa31d9ce_2fe3f4a4","line":1,"in_reply_to":"1a430d35_a5766903","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":18,"context_line":"from oslo_log import log"},{"line_number":19,"context_line":"from oslo_serialization import jsonutils"},{"line_number":20,"context_line":"import threading"},{"line_number":21,"context_line":"from websocket import create_connection"},{"line_number":22,"context_line":"from websocket import WebSocketTimeoutException"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_7b1146ac","line":22,"range":{"start_line":21,"start_character":0,"end_line":22,"end_character":47},"updated":"2017-02-03 20:44:20.000000000","message":"Please import only module.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from networking_odl.common import client as odl_client"},{"line_number":17,"context_line":"from networking_odl._i18n import _LE, _LW"},{"line_number":18,"context_line":"from oslo_log import log"},{"line_number":19,"context_line":"from oslo_serialization import jsonutils"},{"line_number":20,"context_line":"import threading"},{"line_number":21,"context_line":"from websocket import create_connection"},{"line_number":22,"context_line":"from websocket import WebSocketTimeoutException"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_fb00d6ac","line":22,"range":{"start_line":16,"start_character":0,"end_line":22,"end_character":47},"updated":"2017-02-03 20:44:20.000000000","message":"pep8.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License"},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from networking_odl.common import client as odl_client"},{"line_number":17,"context_line":"from networking_odl._i18n import _LE, _LW"},{"line_number":18,"context_line":"from oslo_log import log"},{"line_number":19,"context_line":"from oslo_serialization import jsonutils"},{"line_number":20,"context_line":"import threading"},{"line_number":21,"context_line":"from websocket import create_connection"},{"line_number":22,"context_line":"from websocket import WebSocketTimeoutException"},{"line_number":23,"context_line":""},{"line_number":24,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":25,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_0fe630b4","line":22,"range":{"start_line":16,"start_character":0,"end_line":22,"end_character":47},"in_reply_to":"1a430d35_fb00d6ac","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":31,"context_line":"ODL_NOTIFICATION_SCOPE_SUBTREE \u003d \"SUBTREE\""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def odl_create_websocket_url(odl_url, path, datastore, scope):"},{"line_number":35,"context_line":"    \"\"\"ODL Websocket change notification subscription\"\"\""},{"line_number":36,"context_line":"    # Check ODL URL for details on this process"},{"line_number":37,"context_line":"    # https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_db587a59","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":29},"updated":"2017-02-03 20:44:20.000000000","message":"This seems like a factory method for OpendaylightWebsocketThread.\nSo make this method static method of the class.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":31,"context_line":"ODL_NOTIFICATION_SCOPE_SUBTREE \u003d \"SUBTREE\""},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"def odl_create_websocket_url(odl_url, path, datastore, scope):"},{"line_number":35,"context_line":"    \"\"\"ODL Websocket change notification subscription\"\"\""},{"line_number":36,"context_line":"    # Check ODL URL for details on this process"},{"line_number":37,"context_line":"    # https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_6ff32c74","line":34,"range":{"start_line":34,"start_character":4,"end_line":34,"end_character":29},"in_reply_to":"1a430d35_db587a59","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        + \"\"\"sal-remote:create-data-change-event-subscription\"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    odl_stream_url \u003d \"\"\"restconf/streams/stream/\"\"\""},{"line_number":44,"context_line":"    odl_subscription_data \u003d \"\"\""},{"line_number":45,"context_line":"                {\"input\": {"},{"line_number":46,"context_line":"                        \"path\": \"\","},{"line_number":47,"context_line":"                        \"sal-remote-augment:datastore\": \"\","},{"line_number":48,"context_line":"                        \"sal-remote-augment:scope\": \"\","},{"line_number":49,"context_line":"                        \"sal-remote-augment:notification-output-type\": \"JSON\""},{"line_number":50,"context_line":"                } }\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    data \u003d jsonutils.loads(odl_subscription_data)"},{"line_number":53,"context_line":"    data[\u0027input\u0027][\u0027path\u0027] \u003d path"},{"line_number":54,"context_line":"    data[\u0027input\u0027][\u0027sal-remote-augment:datastore\u0027] \u003d datastore"},{"line_number":55,"context_line":"    data[\u0027input\u0027][\u0027sal-remote-augment:scope\u0027] \u003d scope"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client(odl_url)"},{"line_number":58,"context_line":"    response \u003d odl_rest_client.sendjson(\u0027post\u0027, odl_websocket_url, data)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_5be72ae4","line":55,"range":{"start_line":44,"start_character":0,"end_line":55,"end_character":53},"updated":"2017-02-03 20:44:20.000000000","message":"python dict can be constructed directly.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":41,"context_line":"        + \"\"\"sal-remote:create-data-change-event-subscription\"\"\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":"    odl_stream_url \u003d \"\"\"restconf/streams/stream/\"\"\""},{"line_number":44,"context_line":"    odl_subscription_data \u003d \"\"\""},{"line_number":45,"context_line":"                {\"input\": {"},{"line_number":46,"context_line":"                        \"path\": \"\","},{"line_number":47,"context_line":"                        \"sal-remote-augment:datastore\": \"\","},{"line_number":48,"context_line":"                        \"sal-remote-augment:scope\": \"\","},{"line_number":49,"context_line":"                        \"sal-remote-augment:notification-output-type\": \"JSON\""},{"line_number":50,"context_line":"                } }\"\"\""},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"    data \u003d jsonutils.loads(odl_subscription_data)"},{"line_number":53,"context_line":"    data[\u0027input\u0027][\u0027path\u0027] \u003d path"},{"line_number":54,"context_line":"    data[\u0027input\u0027][\u0027sal-remote-augment:datastore\u0027] \u003d datastore"},{"line_number":55,"context_line":"    data[\u0027input\u0027][\u0027sal-remote-augment:scope\u0027] \u003d scope"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client(odl_url)"},{"line_number":58,"context_line":"    response \u003d odl_rest_client.sendjson(\u0027post\u0027, odl_websocket_url, data)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_8fe8607e","line":55,"range":{"start_line":44,"start_character":0,"end_line":55,"end_character":53},"in_reply_to":"1a430d35_5be72ae4","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        stream_name \u003d stream_name[\u0027output\u0027][\u0027stream-name\u0027]"},{"line_number":62,"context_line":"        # Subscribe to stream. Returns websocket URL to listen to"},{"line_number":63,"context_line":"        url \u003d odl_stream_url + stream_name"},{"line_number":64,"context_line":"        response \u003d odl_rest_client.sendjson(\u0027get\u0027, url, None)"},{"line_number":65,"context_line":"        stream_url \u003d response.headers[\u0027location\u0027]"},{"line_number":66,"context_line":"        return stream_url"},{"line_number":67,"context_line":"    except ValueError:"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_7b9ea657","line":64,"range":{"start_line":64,"start_character":35,"end_line":64,"end_character":61},"updated":"2017-02-03 20:44:20.000000000","message":"get() method can be used.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        stream_name \u003d stream_name[\u0027output\u0027][\u0027stream-name\u0027]"},{"line_number":62,"context_line":"        # Subscribe to stream. Returns websocket URL to listen to"},{"line_number":63,"context_line":"        url \u003d odl_stream_url + stream_name"},{"line_number":64,"context_line":"        response \u003d odl_rest_client.sendjson(\u0027get\u0027, url, None)"},{"line_number":65,"context_line":"        stream_url \u003d response.headers[\u0027location\u0027]"},{"line_number":66,"context_line":"        return stream_url"},{"line_number":67,"context_line":"    except ValueError:"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_afed248d","line":64,"range":{"start_line":64,"start_character":35,"end_line":64,"end_character":61},"in_reply_to":"1a430d35_7b9ea657","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                # Call handler for data received"},{"line_number":123,"context_line":"                self.handler(data)"},{"line_number":124,"context_line":"            except WebSocketTimeoutException:"},{"line_number":125,"context_line":"                if self.exit_websocket_thread:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"            except Exception:"},{"line_number":128,"context_line":"                # Catch exceptions to protect the thread while running"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_bb6ace18","line":125,"range":{"start_line":125,"start_character":19,"end_line":125,"end_character":44},"updated":"2017-02-03 20:44:20.000000000","message":"This can be done at line 119.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                # Call handler for data received"},{"line_number":123,"context_line":"                self.handler(data)"},{"line_number":124,"context_line":"            except WebSocketTimeoutException:"},{"line_number":125,"context_line":"                if self.exit_websocket_thread:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"            except Exception:"},{"line_number":128,"context_line":"                # Catch exceptions to protect the thread while running"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_cf02583e","line":125,"range":{"start_line":125,"start_character":19,"end_line":125,"end_character":44},"in_reply_to":"1a430d35_bb6ace18","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"87b95d37f11428e946674419f247507e8aa1197c","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                self.handler(data)"},{"line_number":124,"context_line":"            except WebSocketTimeoutException:"},{"line_number":125,"context_line":"                if self.exit_websocket_thread:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"            except Exception:"},{"line_number":128,"context_line":"                # Catch exceptions to protect the thread while running"},{"line_number":129,"context_line":"                LOG.exception(_LE(\"Error on run_websocket_thread\"))"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_45ea2575","line":126,"updated":"2017-02-09 07:44:53.000000000","message":"Hmmmm...Connections can and do die. In this case the thread will exit and no one will know. Is there a reason there\u0027s no reconnect logic?","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                self.handler(data)"},{"line_number":124,"context_line":"            except WebSocketTimeoutException:"},{"line_number":125,"context_line":"                if self.exit_websocket_thread:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"            except Exception:"},{"line_number":128,"context_line":"                # Catch exceptions to protect the thread while running"},{"line_number":129,"context_line":"                LOG.exception(_LE(\"Error on run_websocket_thread\"))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_efff1c32","line":126,"in_reply_to":"1a430d35_45ea2575","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            except WebSocketTimeoutException:"},{"line_number":125,"context_line":"                if self.exit_websocket_thread:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"            except Exception:"},{"line_number":128,"context_line":"                # Catch exceptions to protect the thread while running"},{"line_number":129,"context_line":"                LOG.exception(_LE(\"Error on run_websocket_thread\"))"},{"line_number":130,"context_line":"        ws.close()"},{"line_number":131,"context_line":"        LOG.debug(\"Stoping websocket thread\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_1bee828b","line":129,"range":{"start_line":127,"start_character":0,"end_line":129,"end_character":67},"updated":"2017-02-03 20:44:20.000000000","message":"Masking Exception unconditionally is usually bad idea.\ne.g. what if the socket is reset?","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            except WebSocketTimeoutException:"},{"line_number":125,"context_line":"                if self.exit_websocket_thread:"},{"line_number":126,"context_line":"                    break"},{"line_number":127,"context_line":"            except Exception:"},{"line_number":128,"context_line":"                # Catch exceptions to protect the thread while running"},{"line_number":129,"context_line":"                LOG.exception(_LE(\"Error on run_websocket_thread\"))"},{"line_number":130,"context_line":"        ws.close()"},{"line_number":131,"context_line":"        LOG.debug(\"Stoping websocket thread\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_0ffd503a","line":129,"range":{"start_line":127,"start_character":0,"end_line":129,"end_character":67},"in_reply_to":"1a430d35_1bee828b","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            except Exception:"},{"line_number":128,"context_line":"                # Catch exceptions to protect the thread while running"},{"line_number":129,"context_line":"                LOG.exception(_LE(\"Error on run_websocket_thread\"))"},{"line_number":130,"context_line":"        ws.close()"},{"line_number":131,"context_line":"        LOG.debug(\"Stoping websocket thread\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_7b5f8672","line":130,"range":{"start_line":130,"start_character":7,"end_line":130,"end_character":18},"updated":"2017-02-03 20:44:20.000000000","message":"In order to ensure that wc is cloased, try-finally is better.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"c5a5c3e861512d330e9e00bdf79de4427be7b329","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:"},{"line_number":53,"context_line":"        # Change_event_notification_subscription#rpc_create-data-change-event-subscription"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        odl_websocket_url \u003d \"\"\"restconf/operations/\"\"\" \\"},{"line_number":56,"context_line":"            + \"\"\"sal-remote:create-data-change-event-subscription\"\"\""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        odl_stream_url \u003d \"\"\"restconf/streams/stream/\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_06423dae","line":55,"updated":"2017-02-23 10:08:59.000000000","message":"I think this is not the best name for this variable because it does not describe what it is. In fact it\u0027s wrong. It\u0027s not the websocket_url (ws://etc). I suggest create_dce_sub_url.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"ead1a5904fc463ed538c9c3796579873b7187a61","unresolved":false,"context_lines":[{"line_number":52,"context_line":"        # https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:"},{"line_number":53,"context_line":"        # Change_event_notification_subscription#rpc_create-data-change-event-subscription"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"        odl_websocket_url \u003d \"\"\"restconf/operations/\"\"\" \\"},{"line_number":56,"context_line":"            + \"\"\"sal-remote:create-data-change-event-subscription\"\"\""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        odl_stream_url \u003d \"\"\"restconf/streams/stream/\"\"\""}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_0664afb6","line":55,"in_reply_to":"da36d5c6_06423dae","updated":"2017-02-26 01:19:49.000000000","message":"Done","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"c5a5c3e861512d330e9e00bdf79de4427be7b329","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        odl_websocket_url \u003d \"\"\"restconf/operations/\"\"\" \\"},{"line_number":56,"context_line":"            + \"\"\"sal-remote:create-data-change-event-subscription\"\"\""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        odl_stream_url \u003d \"\"\"restconf/streams/stream/\"\"\""},{"line_number":59,"context_line":"        odl_subscription_data \u003d {\u0027input\u0027: {"},{"line_number":60,"context_line":"            \u0027path\u0027: \u0027\u0027,"},{"line_number":61,"context_line":"            \u0027sal-remote-augment:datastore\u0027: \u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_c68105c5","line":58,"updated":"2017-02-23 10:08:59.000000000","message":"similar to above, the name here is not so great. How about \"dce_sub_url\" (the first \"creates\" the subscription and this one does the actual subscription, I guess).","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"ead1a5904fc463ed538c9c3796579873b7187a61","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        odl_websocket_url \u003d \"\"\"restconf/operations/\"\"\" \\"},{"line_number":56,"context_line":"            + \"\"\"sal-remote:create-data-change-event-subscription\"\"\""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"        odl_stream_url \u003d \"\"\"restconf/streams/stream/\"\"\""},{"line_number":59,"context_line":"        odl_subscription_data \u003d {\u0027input\u0027: {"},{"line_number":60,"context_line":"            \u0027path\u0027: \u0027\u0027,"},{"line_number":61,"context_line":"            \u0027sal-remote-augment:datastore\u0027: \u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_2657f3ca","line":58,"in_reply_to":"da36d5c6_c68105c5","updated":"2017-02-26 01:19:49.000000000","message":"Done","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"c5a5c3e861512d330e9e00bdf79de4427be7b329","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            stream_name \u003d response.json()"},{"line_number":94,"context_line":"            stream_name \u003d stream_name[\u0027output\u0027][\u0027stream-name\u0027]"},{"line_number":95,"context_line":"            # Subscribe to stream. Returns websocket URL to listen to"},{"line_number":96,"context_line":"            url \u003d odl_stream_url + stream_name"},{"line_number":97,"context_line":"            response \u003d odl_rest_client.get(url)"},{"line_number":98,"context_line":"            response.raise_for_status()"},{"line_number":99,"context_line":"            stream_url \u003d response.headers[\u0027location\u0027]"}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_668f79cc","line":96,"updated":"2017-02-23 10:08:59.000000000","message":"As discussed in the email thread to netvirt-dev I pushed a gerrit to netconf that would enable a parameter option to receive notifications just for leaf nodes [1]. If/when that patch gets merged we will need a way of enabling this feature in the websocket client. This is relatively simple to do. This function would need to take a boolean flag as a parameter and if the option is enabled simply append \"?odlLeafNodesOnly\u003dtrue\" to the above line. I\u0027m happy to make the change when the time comes. \n\n[1]https://git.opendaylight.org/gerrit/#/c/52173/","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"ead1a5904fc463ed538c9c3796579873b7187a61","unresolved":false,"context_lines":[{"line_number":93,"context_line":"            stream_name \u003d response.json()"},{"line_number":94,"context_line":"            stream_name \u003d stream_name[\u0027output\u0027][\u0027stream-name\u0027]"},{"line_number":95,"context_line":"            # Subscribe to stream. Returns websocket URL to listen to"},{"line_number":96,"context_line":"            url \u003d odl_stream_url + stream_name"},{"line_number":97,"context_line":"            response \u003d odl_rest_client.get(url)"},{"line_number":98,"context_line":"            response.raise_for_status()"},{"line_number":99,"context_line":"            stream_url \u003d response.headers[\u0027location\u0027]"}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_66756b62","line":96,"in_reply_to":"da36d5c6_668f79cc","updated":"2017-02-26 01:19:49.000000000","message":"Josh I\u0027m reviewing that patch. I tried that patch and that works as described.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"64af44d51b16d2ebf6c6513a93fbe153c30ce1ff","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                LOG.warning(_LW(\"Websocket connection closed, Reconnecting..\"),"},{"line_number":205,"context_line":"                            exc_info\u003dTrue)"},{"line_number":206,"context_line":"                ws \u003d self.connect_ws()"},{"line_number":207,"context_line":"                if ws is None:"},{"line_number":208,"context_line":"                    LOG.error(_LE(\"Websocket thread exiting\"),"},{"line_number":209,"context_line":"                              exc_info\u003dTrue)"},{"line_number":210,"context_line":"                    return"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_925a394f","line":207,"updated":"2017-02-12 09:11:54.000000000","message":"So I\u0027m not quite sure this is a good solution for reconnect. If the primary usage of websocket is to receive notifications I would assume that applications will need this thread to run forever and keep retrying the connection. I think it should, at the very least, retry the connection in a loop with some sort of configurable wait interval or back-off strategy.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"8758c6dfb557b5b802367470f6b2f589384d7647","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                LOG.warning(_LW(\"Websocket connection closed, Reconnecting..\"),"},{"line_number":205,"context_line":"                            exc_info\u003dTrue)"},{"line_number":206,"context_line":"                ws \u003d self.connect_ws()"},{"line_number":207,"context_line":"                if ws is None:"},{"line_number":208,"context_line":"                    LOG.error(_LE(\"Websocket thread exiting\"),"},{"line_number":209,"context_line":"                              exc_info\u003dTrue)"},{"line_number":210,"context_line":"                    return"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_2fe71812","line":207,"in_reply_to":"fa31d9ce_283399f7","updated":"2017-02-14 09:37:27.000000000","message":"Another idea I just had was that perhaps when a disconnect happens the correct thing to do is (a) delete the subscription and then (b) resubscribe. Whoever writes code to use this class will need to be able the initial \"create\" events that happened before the subscription so the code to deal with this will exist already. I think either the callback method or this will work but though I\u0027d just throw this idea out as well.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"69193ca2a5202270178d542c66d6f07d4a5c185b","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                LOG.warning(_LW(\"Websocket connection closed, Reconnecting..\"),"},{"line_number":205,"context_line":"                            exc_info\u003dTrue)"},{"line_number":206,"context_line":"                ws \u003d self.connect_ws()"},{"line_number":207,"context_line":"                if ws is None:"},{"line_number":208,"context_line":"                    LOG.error(_LE(\"Websocket thread exiting\"),"},{"line_number":209,"context_line":"                              exc_info\u003dTrue)"},{"line_number":210,"context_line":"                    return"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_aa767dd4","line":207,"in_reply_to":"fa31d9ce_2fe71812","updated":"2017-02-14 18:40:10.000000000","message":"for neutron HA(multiple instances of neutron server), on disconnection, we need to trigger leader election logic.\nBut it can be attacked after we\u0027re satisfied with websocket logic.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"eafeccec9f372a9db417ed0ccd36ebaf6edcbef8","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                LOG.warning(_LW(\"Websocket connection closed, Reconnecting..\"),"},{"line_number":205,"context_line":"                            exc_info\u003dTrue)"},{"line_number":206,"context_line":"                ws \u003d self.connect_ws()"},{"line_number":207,"context_line":"                if ws is None:"},{"line_number":208,"context_line":"                    LOG.error(_LE(\"Websocket thread exiting\"),"},{"line_number":209,"context_line":"                              exc_info\u003dTrue)"},{"line_number":210,"context_line":"                    return"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_283399f7","line":207,"in_reply_to":"fa31d9ce_7a81dec2","updated":"2017-02-14 05:19:50.000000000","message":"Will add logic to retry with some configurable wait interval. Also will add a callback to be called when the websocket reconnects and this callback will be used to manually sync up state up to that point.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"6f191ee810037482f6e7cfb4cd71aae621634d17","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                LOG.warning(_LW(\"Websocket connection closed, Reconnecting..\"),"},{"line_number":205,"context_line":"                            exc_info\u003dTrue)"},{"line_number":206,"context_line":"                ws \u003d self.connect_ws()"},{"line_number":207,"context_line":"                if ws is None:"},{"line_number":208,"context_line":"                    LOG.error(_LE(\"Websocket thread exiting\"),"},{"line_number":209,"context_line":"                              exc_info\u003dTrue)"},{"line_number":210,"context_line":"                    return"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_7a81dec2","line":207,"in_reply_to":"fa31d9ce_925a394f","updated":"2017-02-14 02:14:36.000000000","message":"+1 for the need for retry","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"93a4735f6c8248e55585cc255449dbd3fafd46e7","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                LOG.warning(_LW(\"Websocket connection closed, Reconnecting..\"),"},{"line_number":205,"context_line":"                            exc_info\u003dTrue)"},{"line_number":206,"context_line":"                ws \u003d self.connect_ws()"},{"line_number":207,"context_line":"                if ws is None:"},{"line_number":208,"context_line":"                    LOG.error(_LE(\"Websocket thread exiting\"),"},{"line_number":209,"context_line":"                              exc_info\u003dTrue)"},{"line_number":210,"context_line":"                    return"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_181c8e11","line":207,"in_reply_to":"fa31d9ce_925a394f","updated":"2017-02-13 12:40:45.000000000","message":"This problem is even more acute, I realize now. As far as I can tell, it the websocket disconnects it can miss notification during that time. I think it is necessary for applications using the websocket_client to be able to receive an indication of (a) when the connection drops and (b) when the connection is re-connected so that the application can manually query for any missed state/config changes.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":22,"context_line":"from requests import exceptions"},{"line_number":23,"context_line":"import threading"},{"line_number":24,"context_line":"import time"},{"line_number":25,"context_line":"import websocket as web_socket"},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"cfg.CONF.import_group(\u0027ml2_odl\u0027, \u0027networking_odl.common.config\u0027)"},{"line_number":28,"context_line":"LOG \u003d log.getLogger(__name__)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_79015c39","line":25,"range":{"start_line":25,"start_character":17,"end_line":25,"end_character":30},"updated":"2017-02-28 02:59:55.000000000","message":"Do we need rename?","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    @classmethod"},{"line_number":54,"context_line":"    def odl_create_websocket(cls, odl_url, path, datastore, scope,"},{"line_number":55,"context_line":"                             packet_handler, reconnect_handler\u003dNone):"},{"line_number":56,"context_line":"        if odl_url is None:"},{"line_number":57,"context_line":"            return None"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        return cls("},{"line_number":60,"context_line":"            odl_url, path, datastore, scope,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_d9f8884c","line":57,"range":{"start_line":56,"start_character":0,"end_line":57,"end_character":23},"updated":"2017-02-28 02:59:55.000000000","message":"log error?","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":62,"context_line":"            cfg.CONF.ml2_odl.timeout"},{"line_number":63,"context_line":"        )"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"    def _subscribe_websocket(self):"},{"line_number":66,"context_line":"        \"\"\"ODL Websocket change notification subscription\"\"\""},{"line_number":67,"context_line":"        # Check ODL URL for details on this process"},{"line_number":68,"context_line":"        # https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_f602bb71","line":65,"range":{"start_line":65,"start_character":0,"end_line":65,"end_character":3},"updated":"2017-02-28 02:59:55.000000000","message":"Can you please sort the following method in meaningful order?","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":68,"context_line":"        # https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:"},{"line_number":69,"context_line":"        # Change_event_notification_subscription#rpc_create-data-change-event-subscription"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"        ws_create_dce_subs_url \u003d \"\"\"restconf/operations/\"\"\" \\"},{"line_number":72,"context_line":"            + \"\"\"sal-remote:create-data-change-event-subscription\"\"\""},{"line_number":73,"context_line":"        ws_dce_subs_url \u003d \"\"\"restconf/streams/stream/\"\"\""},{"line_number":74,"context_line":"        odl_subscription_data \u003d {\u0027input\u0027: {"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_16baefc0","line":71,"range":{"start_line":71,"start_character":60,"end_line":71,"end_character":61},"updated":"2017-02-28 02:59:55.000000000","message":"Please use parens instead of backslash.\nOpenStack conding style is to avoid backslash.","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":78,"context_line":"            \u0027sal-remote-augment:notification-output-type\u0027: \u0027JSON\u0027"},{"line_number":79,"context_line":"        }}"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        odl_subscription_data[\u0027input\u0027][\u0027path\u0027] \u003d self.path"},{"line_number":82,"context_line":"        odl_subscription_data[\u0027input\u0027][\u0027sal-remote-augment:datastore\u0027] \u003d \\"},{"line_number":83,"context_line":"            self.datastore"},{"line_number":84,"context_line":"        odl_subscription_data[\u0027input\u0027][\u0027sal-remote-augment:scope\u0027] \u003d self.scope"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"        odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client("},{"line_number":87,"context_line":"            self.odl_url)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_d6721749","line":84,"range":{"start_line":81,"start_character":0,"end_line":84,"end_character":79},"updated":"2017-02-28 02:59:55.000000000","message":"We can directly put those at line 75-77.","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":157,"context_line":"    def _try_subscribe_websocket(self):"},{"line_number":158,"context_line":"        while True:"},{"line_number":159,"context_line":"            stream_url \u003d self._subscribe_websocket()"},{"line_number":160,"context_line":"            if stream_url is None:"},{"line_number":161,"context_line":"                # Failed to get URl, wait before trying again"},{"line_number":162,"context_line":"                time.sleep(cfg.CONF.ml2_odl.restconf_poll_interval)"},{"line_number":163,"context_line":"            else:"},{"line_number":164,"context_line":"                return stream_url"},{"line_number":165,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_763ecb2a","line":162,"range":{"start_line":160,"start_character":0,"end_line":162,"end_character":67},"updated":"2017-02-28 02:59:55.000000000","message":"If the error is connection error or something, it makes sense to retry. But in case of other errors(http error, keyerror), retry doesn\u0027t make sense. It would result in same issue and loop.\nIn this case, what we can do is to log error. (and abort?)","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def run_websocket_thread(self):"},{"line_number":213,"context_line":"        ws \u003d self.connect_ws()"},{"line_number":214,"context_line":"        reconnect \u003d True"},{"line_number":215,"context_line":"        while not self.exit_websocket_thread:"},{"line_number":216,"context_line":"            try:"},{"line_number":217,"context_line":"                data \u003d ws.recv()"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_1930609e","line":214,"range":{"start_line":214,"start_character":8,"end_line":214,"end_character":24},"updated":"2017-02-28 02:59:55.000000000","message":"What does this mean?\nreconnected? or reconnect is needed?\nPlease clarify the name.","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    @classmethod"},{"line_number":250,"context_line":"    def create_data_change_event_list(cls, payload):"},{"line_number":251,"context_line":"        ODL_WS_NOTIFICATION_TAG \u003d \u0027notification\u0027"},{"line_number":252,"context_line":"        ODL_WS_DC_NOTIFICATION_TAG \u003d \u0027data-changed-notification\u0027"},{"line_number":253,"context_line":"        ODL_WS_DC_EVENT_TAG \u003d \u0027data-change-event\u0027"},{"line_number":254,"context_line":""},{"line_number":255,"context_line":"        try:"},{"line_number":256,"context_line":"            data \u003d jsonutils.loads(payload)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_d9a6c852","line":253,"range":{"start_line":251,"start_character":0,"end_line":253,"end_character":49},"updated":"2017-02-28 02:59:55.000000000","message":"Those also can be class attributes.","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":268,"context_line":"    def get_data_change_event_list(self):"},{"line_number":269,"context_line":"        return self.dn_events"},{"line_number":270,"context_line":""},{"line_number":271,"context_line":"    def get_fields(self, item):"},{"line_number":272,"context_line":"        return self.get_operation(item), \\"},{"line_number":273,"context_line":"            self.get_path(item), self.get_data(item)"},{"line_number":274,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_f472b3af","line":271,"range":{"start_line":271,"start_character":4,"end_line":271,"end_character":31},"updated":"2017-02-28 02:59:55.000000000","message":"static method?","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":273,"context_line":"            self.get_path(item), self.get_data(item)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    def get_path(self, item):"},{"line_number":276,"context_line":"        try:"},{"line_number":277,"context_line":"            return item[\u0027path\u0027]"},{"line_number":278,"context_line":"        except KeyError:"},{"line_number":279,"context_line":"            return None"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"    def get_data(self, item):"},{"line_number":282,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_f9162c57","line":279,"range":{"start_line":276,"start_character":0,"end_line":279,"end_character":23},"updated":"2017-02-28 02:59:55.000000000","message":"return item.get(\u0027path\u0027)","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":279,"context_line":"            return None"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"    def get_data(self, item):"},{"line_number":282,"context_line":"        try:"},{"line_number":283,"context_line":"            return item[\u0027data\u0027]"},{"line_number":284,"context_line":"        except KeyError:"},{"line_number":285,"context_line":"            return None"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def get_operation(self, item):"},{"line_number":288,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_9908d02f","line":285,"range":{"start_line":282,"start_character":0,"end_line":285,"end_character":23},"updated":"2017-02-28 02:59:55.000000000","message":"ditto.","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":285,"context_line":"            return None"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def get_operation(self, item):"},{"line_number":288,"context_line":"        try:"},{"line_number":289,"context_line":"            return item[\u0027operation\u0027]"},{"line_number":290,"context_line":"        except KeyError:"},{"line_number":291,"context_line":"            return None"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"    def extract_field(self, text, key):"},{"line_number":294,"context_line":"        index \u003d text.find(key)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_f4fd5309","line":291,"range":{"start_line":288,"start_character":0,"end_line":291,"end_character":23},"updated":"2017-02-28 02:59:55.000000000","message":"ditto.","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":295,"context_line":"        if index \u003c 0:"},{"line_number":296,"context_line":"            return None"},{"line_number":297,"context_line":"        try:"},{"line_number":298,"context_line":"            sub_str \u003d text[index + len(key) + 2:]"},{"line_number":299,"context_line":"            sub_str \u003d sub_str[0: sub_str.find(\u0027]\u0027)]"},{"line_number":300,"context_line":"            value \u003d sub_str[0: len(sub_str) - 1]"},{"line_number":301,"context_line":"            return value"},{"line_number":302,"context_line":"        except IndexError:"},{"line_number":303,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_b4611bd6","line":300,"range":{"start_line":298,"start_character":0,"end_line":300,"end_character":48},"updated":"2017-02-28 02:59:55.000000000","message":"It\u0027s hard to understand what format is expected.\nCan you please add unit test?","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"a870fe276d067b39cb1abc26f6a3d06f55bbc0a3","unresolved":false,"context_lines":[{"line_number":256,"context_line":"    OPERATION_UPDATE \u003d \u0027updated\u0027"},{"line_number":257,"context_line":""},{"line_number":258,"context_line":"    def __init__(self, payload, dn_events):"},{"line_number":259,"context_line":"        self.payload \u003d payload"},{"line_number":260,"context_line":"        self.dn_events \u003d dn_events"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"    @classmethod"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_f0bb9b73","line":259,"range":{"start_line":259,"start_character":0,"end_line":259,"end_character":30},"updated":"2017-03-01 03:03:00.000000000","message":"this isn\u0027t used.","commit_id":"304e91235eecd0b2d0f8370b7ad5524beff8dc6f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"a870fe276d067b39cb1abc26f6a3d06f55bbc0a3","unresolved":false,"context_lines":[{"line_number":257,"context_line":""},{"line_number":258,"context_line":"    def __init__(self, payload, dn_events):"},{"line_number":259,"context_line":"        self.payload \u003d payload"},{"line_number":260,"context_line":"        self.dn_events \u003d dn_events"},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"    @classmethod"},{"line_number":263,"context_line":"    def create_data_change_event_list(cls, payload):"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_abe7f83e","line":260,"range":{"start_line":260,"start_character":8,"end_line":260,"end_character":34},"updated":"2017-03-01 03:03:00.000000000","message":"The usage pattern, is to call get_fields at first.\nIt can be done by constructor.","commit_id":"304e91235eecd0b2d0f8370b7ad5524beff8dc6f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"a870fe276d067b39cb1abc26f6a3d06f55bbc0a3","unresolved":false,"context_lines":[{"line_number":271,"context_line":"            dn \u003d data[cls.ODL_WS_NOTIFICATION_TAG]"},{"line_number":272,"context_line":"            dn_events \u003d (dn[cls.ODL_WS_DC_NOTIFICATION_TAG]"},{"line_number":273,"context_line":"                         [cls.ODL_WS_DC_EVENT_TAG])"},{"line_number":274,"context_line":"            return cls(payload, dn_events)"},{"line_number":275,"context_line":"        except KeyError:"},{"line_number":276,"context_line":"            LOG.warning(_LW(\"invalid JSON for websocket notification\"))"},{"line_number":277,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_4b811c4a","line":274,"range":{"start_line":274,"start_character":12,"end_line":274,"end_character":42},"updated":"2017-03-01 03:03:00.000000000","message":"Given the usage, probably\nfor e in dn_events:\n    yeild cls(e)\nor return [cls(e) for e in dn_events]\n\nthen, get_fields and extract_fields can be normal method.","commit_id":"304e91235eecd0b2d0f8370b7ad5524beff8dc6f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"a870fe276d067b39cb1abc26f6a3d06f55bbc0a3","unresolved":false,"context_lines":[{"line_number":276,"context_line":"            LOG.warning(_LW(\"invalid JSON for websocket notification\"))"},{"line_number":277,"context_line":"            return None"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"    def get_data_change_event_list(self):"},{"line_number":280,"context_line":"        return self.dn_events"},{"line_number":281,"context_line":""},{"line_number":282,"context_line":"    @staticmethod"},{"line_number":283,"context_line":"    def get_fields(item):"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_70db2bee","line":280,"range":{"start_line":279,"start_character":0,"end_line":280,"end_character":29},"updated":"2017-03-01 03:03:00.000000000","message":"By looking at the user of this method,\nthe api design seems convoluted.\nThe design needs to be sorted out.","commit_id":"304e91235eecd0b2d0f8370b7ad5524beff8dc6f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"a870fe276d067b39cb1abc26f6a3d06f55bbc0a3","unresolved":false,"context_lines":[{"line_number":289,"context_line":"    def get_path(item):"},{"line_number":290,"context_line":"        try:"},{"line_number":291,"context_line":"            return item.get(\u0027path\u0027)"},{"line_number":292,"context_line":"        except KeyError:"},{"line_number":293,"context_line":"            return None"},{"line_number":294,"context_line":""},{"line_number":295,"context_line":"    @staticmethod"},{"line_number":296,"context_line":"    def get_data(item):"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_f078fbfa","line":293,"range":{"start_line":292,"start_character":0,"end_line":293,"end_character":23},"updated":"2017-03-01 03:03:00.000000000","message":"dict.get() doesn\u0027t throw KeyError.","commit_id":"304e91235eecd0b2d0f8370b7ad5524beff8dc6f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"a870fe276d067b39cb1abc26f6a3d06f55bbc0a3","unresolved":false,"context_lines":[{"line_number":296,"context_line":"    def get_data(item):"},{"line_number":297,"context_line":"        try:"},{"line_number":298,"context_line":"            return item.get(\u0027data\u0027)"},{"line_number":299,"context_line":"        except KeyError:"},{"line_number":300,"context_line":"            return None"},{"line_number":301,"context_line":""},{"line_number":302,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_b0776301","line":299,"range":{"start_line":299,"start_character":0,"end_line":299,"end_character":24},"updated":"2017-03-01 03:03:00.000000000","message":"ditto","commit_id":"304e91235eecd0b2d0f8370b7ad5524beff8dc6f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"a870fe276d067b39cb1abc26f6a3d06f55bbc0a3","unresolved":false,"context_lines":[{"line_number":303,"context_line":"    def get_operation(item):"},{"line_number":304,"context_line":"        try:"},{"line_number":305,"context_line":"            return item.get(\u0027operation\u0027)"},{"line_number":306,"context_line":"        except KeyError:"},{"line_number":307,"context_line":"            return None"},{"line_number":308,"context_line":""},{"line_number":309,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":10,"id":"ba2be162_d074d7fe","line":306,"range":{"start_line":306,"start_character":0,"end_line":306,"end_character":24},"updated":"2017-03-01 03:03:00.000000000","message":"ditto","commit_id":"304e91235eecd0b2d0f8370b7ad5524beff8dc6f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    @classmethod"},{"line_number":59,"context_line":"    def odl_create_websocket(cls, odl_url, path, datastore, scope,"},{"line_number":60,"context_line":"                             packet_handler, status_cb\u003dNone):"},{"line_number":61,"context_line":"        if odl_url is None:"},{"line_number":62,"context_line":"            LOG.error(_LE(\"invalid odl url\"), exc_info\u003dTrue)"},{"line_number":63,"context_line":"            return None"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client("},{"line_number":66,"context_line":"            odl_url)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_03560bd2","line":63,"range":{"start_line":61,"start_character":0,"end_line":63,"end_character":23},"updated":"2017-03-07 23:50:54.000000000","message":"This case is clearly callers bug. So exception can be thrown.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":58,"context_line":"    @classmethod"},{"line_number":59,"context_line":"    def odl_create_websocket(cls, odl_url, path, datastore, scope,"},{"line_number":60,"context_line":"                             packet_handler, status_cb\u003dNone):"},{"line_number":61,"context_line":"        if odl_url is None:"},{"line_number":62,"context_line":"            LOG.error(_LE(\"invalid odl url\"), exc_info\u003dTrue)"},{"line_number":63,"context_line":"            return None"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client("},{"line_number":66,"context_line":"            odl_url)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_319a6b64","line":63,"range":{"start_line":61,"start_character":0,"end_line":63,"end_character":23},"in_reply_to":"9a30ddce_03560bd2","updated":"2017-03-08 07:43:11.000000000","message":"Not so familiar with openstack so what exception should be thrown. Is there a standard exception for \"bad input\"?","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            packet_handler, cfg.CONF.ml2_odl.timeout, status_cb"},{"line_number":71,"context_line":"        )"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def _subscribe_websocket(self):"},{"line_number":74,"context_line":"        \"\"\"ODL Websocket change notification subscription\"\"\""},{"line_number":75,"context_line":"        # Check ODL URL for details on this process"},{"line_number":76,"context_line":"        # https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_03f28bd2","line":73,"updated":"2017-03-07 23:50:54.000000000","message":"Can you please sort these methods in meaningful order?\ninstead of random/implemented order.\nfor example, groupping helper methods and grouping main logic.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":70,"context_line":"            packet_handler, cfg.CONF.ml2_odl.timeout, status_cb"},{"line_number":71,"context_line":"        )"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"    def _subscribe_websocket(self):"},{"line_number":74,"context_line":"        \"\"\"ODL Websocket change notification subscription\"\"\""},{"line_number":75,"context_line":"        # Check ODL URL for details on this process"},{"line_number":76,"context_line":"        # https://wiki.opendaylight.org/view/OpenDaylight_Controller:MD-SAL:Restconf:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_d1a90f7d","line":73,"in_reply_to":"9a30ddce_03f28bd2","updated":"2017-03-08 07:43:11.000000000","message":"Since that will make it hard to track diffs perhaps it is a better idea to do that at the end of the review process?","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                LOG.warning(_LW(\"websocket connection failed, \"),"},{"line_number":105,"context_line":"                            exc_info\u003dTrue)"},{"line_number":106,"context_line":"                return None"},{"line_number":107,"context_line":"        except Exception:"},{"line_number":108,"context_line":"            return None"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        # Subscribing to stream. Returns websocket URL to listen to"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_43dd6313","line":107,"range":{"start_line":107,"start_character":9,"end_line":107,"end_character":25},"updated":"2017-03-07 23:50:54.000000000","message":"Although it\u0027s bad practice to unconditionally catch any exception, please log the error at least.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                LOG.warning(_LW(\"websocket connection failed, \"),"},{"line_number":105,"context_line":"                            exc_info\u003dTrue)"},{"line_number":106,"context_line":"                return None"},{"line_number":107,"context_line":"        except Exception:"},{"line_number":108,"context_line":"            return None"},{"line_number":109,"context_line":""},{"line_number":110,"context_line":"        # Subscribing to stream. Returns websocket URL to listen to"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_118c8734","line":107,"range":{"start_line":107,"start_character":9,"end_line":107,"end_character":25},"in_reply_to":"9a30ddce_43dd6313","updated":"2017-03-08 07:43:11.000000000","message":"Done","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            if e.response.status_code \u003d\u003d codes.not_found:"},{"line_number":128,"context_line":"                LOG.debug(\"response code not_found (404)\""},{"line_number":129,"context_line":"                          \"unable to websocket connection url\")"},{"line_number":130,"context_line":"                raise ValueError(_(\"bad_request (http400), check path\"))"},{"line_number":131,"context_line":"            else:"},{"line_number":132,"context_line":"                LOG.warning(_LW(\"websocket connection failed\"),"},{"line_number":133,"context_line":"                            exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_23e30fa5","line":130,"range":{"start_line":130,"start_character":16,"end_line":130,"end_character":72},"updated":"2017-03-07 23:50:54.000000000","message":"when to return None and when to throw exception?\nI\u0027m guessing throwring error if it doesn\u0027t make sense to retry. If so, we should throw exception with general catch-all Exception.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":127,"context_line":"            if e.response.status_code \u003d\u003d codes.not_found:"},{"line_number":128,"context_line":"                LOG.debug(\"response code not_found (404)\""},{"line_number":129,"context_line":"                          \"unable to websocket connection url\")"},{"line_number":130,"context_line":"                raise ValueError(_(\"bad_request (http400), check path\"))"},{"line_number":131,"context_line":"            else:"},{"line_number":132,"context_line":"                LOG.warning(_LW(\"websocket connection failed\"),"},{"line_number":133,"context_line":"                            exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_91507760","line":130,"range":{"start_line":130,"start_character":16,"end_line":130,"end_character":72},"in_reply_to":"9a30ddce_23e30fa5","updated":"2017-03-08 07:43:11.000000000","message":"Hmmm...good catch. Thinking about this I\u0027m not so sure throwing an exception is the best option here. Since this is running in a thread it will not cause everything to stop but it also doesn\u0027t cost anything to keep retrying. Not sure I have a preference, I guess it depends on whether we want to err on the side of robustness or correctness. I think maybe let\u0027s log the exception and continue to try even though it is unlikely this problem will resolve itself. I don\u0027t think throwing the exception will make this any easier to debug since it\u0027ll just cause the thread to exit.\n\nAlso, what do you mean by \"general catch-all Exception?\"","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                      exc_info\u003dTrue)"},{"line_number":142,"context_line":"            raise ValueError(_(\"websocket subscribe invalid stream data\"))"},{"line_number":143,"context_line":"        except Exception:"},{"line_number":144,"context_line":"            LOG.warning(_LW(\"websocket subscription failed\"),"},{"line_number":145,"context_line":"                        exc_info\u003dTrue)"},{"line_number":146,"context_line":"            return None"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_a388dfe8","line":144,"range":{"start_line":144,"start_character":16,"end_line":144,"end_character":23},"updated":"2017-03-07 23:50:54.000000000","message":"error or exception?","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":141,"context_line":"                      exc_info\u003dTrue)"},{"line_number":142,"context_line":"            raise ValueError(_(\"websocket subscribe invalid stream data\"))"},{"line_number":143,"context_line":"        except Exception:"},{"line_number":144,"context_line":"            LOG.warning(_LW(\"websocket subscription failed\"),"},{"line_number":145,"context_line":"                        exc_info\u003dTrue)"},{"line_number":146,"context_line":"            return None"},{"line_number":147,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_f1c7f30f","line":144,"range":{"start_line":144,"start_character":16,"end_line":144,"end_character":23},"in_reply_to":"9a30ddce_a388dfe8","updated":"2017-03-08 07:43:11.000000000","message":"warning because it\u0027s an exception we handle in that we continue to attempt to connect","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":165,"context_line":"        except ValueError:"},{"line_number":166,"context_line":"            LOG.error(_LE(\"websocket create connection invalid URL\"),"},{"line_number":167,"context_line":"                      exc_info\u003dTrue)"},{"line_number":168,"context_line":"            raise ValueError(_(\"websocket create connection invalid URL\"))"},{"line_number":169,"context_line":"        except websocket.WebSocketBadStatusException:"},{"line_number":170,"context_line":"            LOG.error(_LE(\"webSocket bad status exception\"),"},{"line_number":171,"context_line":"                      exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_2304ef15","line":168,"range":{"start_line":168,"start_character":18,"end_line":168,"end_character":74},"updated":"2017-03-07 23:50:54.000000000","message":"Do we want to convert the exception?\nsave_and_reraise can be used.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        except websocket.WebSocketBadStatusException:"},{"line_number":170,"context_line":"            LOG.error(_LE(\"webSocket bad status exception\"),"},{"line_number":171,"context_line":"                      exc_info\u003dTrue)"},{"line_number":172,"context_line":"            return None"},{"line_number":173,"context_line":"        except Exception:"},{"line_number":174,"context_line":"            LOG.exception(_LE(\"websocket create connection failed\"),"},{"line_number":175,"context_line":"                          exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_4f3bc5d1","line":172,"updated":"2017-03-07 23:50:54.000000000","message":"What about websocket.WebsocketException?","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":169,"context_line":"        except websocket.WebSocketBadStatusException:"},{"line_number":170,"context_line":"            LOG.error(_LE(\"webSocket bad status exception\"),"},{"line_number":171,"context_line":"                      exc_info\u003dTrue)"},{"line_number":172,"context_line":"            return None"},{"line_number":173,"context_line":"        except Exception:"},{"line_number":174,"context_line":"            LOG.exception(_LE(\"websocket create connection failed\"),"},{"line_number":175,"context_line":"                          exc_info\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_51719fdf","line":172,"in_reply_to":"9a30ddce_4f3bc5d1","updated":"2017-03-08 07:43:11.000000000","message":"Done","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        if stream_url is None:"},{"line_number":193,"context_line":"            return None"},{"line_number":194,"context_line":"        ws \u003d self.socket_create_connection(stream_url)"},{"line_number":195,"context_line":"        if ws is not None:"},{"line_number":196,"context_line":"            self.set_websocket_status(ODL_WEBSOCKET_CONNECTED)"},{"line_number":197,"context_line":"        return ws"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def close_ws(self, ws):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_0f6f0dc6","line":196,"range":{"start_line":195,"start_character":8,"end_line":196,"end_character":62},"updated":"2017-03-07 23:50:54.000000000","message":"If ws is None, the status should be DISCONNECTED?","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":192,"context_line":"        if stream_url is None:"},{"line_number":193,"context_line":"            return None"},{"line_number":194,"context_line":"        ws \u003d self.socket_create_connection(stream_url)"},{"line_number":195,"context_line":"        if ws is not None:"},{"line_number":196,"context_line":"            self.set_websocket_status(ODL_WEBSOCKET_CONNECTED)"},{"line_number":197,"context_line":"        return ws"},{"line_number":198,"context_line":""},{"line_number":199,"context_line":"    def close_ws(self, ws):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_31426b11","line":196,"range":{"start_line":195,"start_character":8,"end_line":196,"end_character":62},"in_reply_to":"9a30ddce_0f6f0dc6","updated":"2017-03-08 07:43:11.000000000","message":"No, it should stay CONNECTING.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        while not self.exit_websocket_thread:"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"            # connect if necessary"},{"line_number":216,"context_line":"            if ws \u003d\u003d None:"},{"line_number":217,"context_line":"                try:"},{"line_number":218,"context_line":"                    ws \u003d self.connect_ws()"},{"line_number":219,"context_line":"                except ValueError:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_63a6e7c2","line":216,"range":{"start_line":216,"start_character":18,"end_line":216,"end_character":25},"updated":"2017-03-07 23:50:54.000000000","message":"pep8: is None.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        while not self.exit_websocket_thread:"},{"line_number":214,"context_line":""},{"line_number":215,"context_line":"            # connect if necessary"},{"line_number":216,"context_line":"            if ws \u003d\u003d None:"},{"line_number":217,"context_line":"                try:"},{"line_number":218,"context_line":"                    ws \u003d self.connect_ws()"},{"line_number":219,"context_line":"                except ValueError:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_f10533c2","line":216,"range":{"start_line":216,"start_character":18,"end_line":216,"end_character":25},"in_reply_to":"9a30ddce_63a6e7c2","updated":"2017-03-08 07:43:11.000000000","message":"Done","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                    LOG.error(_LE(\"websocket irrecoverable error \"),"},{"line_number":221,"context_line":"                              exc_info\u003dTrue)"},{"line_number":222,"context_line":"                    return"},{"line_number":223,"context_line":"                if ws \u003d\u003d None:"},{"line_number":224,"context_line":"                    time.sleep(cfg.CONF.ml2_odl.restconf_poll_interval)"},{"line_number":225,"context_line":"                    continue"},{"line_number":226,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_03a0cb9e","line":223,"range":{"start_line":223,"start_character":22,"end_line":223,"end_character":29},"updated":"2017-03-07 23:50:54.000000000","message":"ditto","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":220,"context_line":"                    LOG.error(_LE(\"websocket irrecoverable error \"),"},{"line_number":221,"context_line":"                              exc_info\u003dTrue)"},{"line_number":222,"context_line":"                    return"},{"line_number":223,"context_line":"                if ws \u003d\u003d None:"},{"line_number":224,"context_line":"                    time.sleep(cfg.CONF.ml2_odl.restconf_poll_interval)"},{"line_number":225,"context_line":"                    continue"},{"line_number":226,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_1109e7dd","line":223,"range":{"start_line":223,"start_character":22,"end_line":223,"end_character":29},"in_reply_to":"9a30ddce_03a0cb9e","updated":"2017-03-08 07:43:11.000000000","message":"Done","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            except Exception:"},{"line_number":257,"context_line":"                LOG.error(_LE(\"Error in packet_handler\"), exc_info\u003dTrue)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        self.close_ws(ws)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"class EventDataParser(object):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_8fbf7dfa","line":259,"range":{"start_line":259,"start_character":0,"end_line":259,"end_character":25},"updated":"2017-03-07 23:50:54.000000000","message":"Here ws may not be accesible.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f2e169bfea272136a15645993a17d5b671e5d2c6","unresolved":false,"context_lines":[{"line_number":256,"context_line":"            except Exception:"},{"line_number":257,"context_line":"                LOG.error(_LE(\"Error in packet_handler\"), exc_info\u003dTrue)"},{"line_number":258,"context_line":""},{"line_number":259,"context_line":"        self.close_ws(ws)"},{"line_number":260,"context_line":""},{"line_number":261,"context_line":""},{"line_number":262,"context_line":"class EventDataParser(object):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_7121434d","line":259,"range":{"start_line":259,"start_character":0,"end_line":259,"end_character":25},"in_reply_to":"9a30ddce_8fbf7dfa","updated":"2017-03-08 07:43:11.000000000","message":"true. I changed close_ws to check for None. I still want to call close_ws as that will send the final DISCONNECTED event.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":272,"context_line":"    def __init__(self, item):"},{"line_number":273,"context_line":"        self.item \u003d item"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":"    @classmethod"},{"line_number":276,"context_line":"    def get_item(cls, payload):"},{"line_number":277,"context_line":"        for e in cls.create_data_change_event_list(payload):"},{"line_number":278,"context_line":"            yield cls(e)"},{"line_number":279,"context_line":""},{"line_number":280,"context_line":"    @staticmethod"},{"line_number":281,"context_line":"    def create_data_change_event_list(payload):"},{"line_number":282,"context_line":"        try:"},{"line_number":283,"context_line":"            data \u003d jsonutils.loads(payload)"},{"line_number":284,"context_line":"        except ValueError:"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_a3737fb0","line":281,"range":{"start_line":275,"start_character":0,"end_line":281,"end_character":47},"updated":"2017-03-07 23:50:54.000000000","message":"those two methods can be consolidated into single class method.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            data \u003d jsonutils.loads(payload)"},{"line_number":284,"context_line":"        except ValueError:"},{"line_number":285,"context_line":"            LOG.warning(_LW(\"invalid websocket notification\"))"},{"line_number":286,"context_line":"            return None"},{"line_number":287,"context_line":"        try:"},{"line_number":288,"context_line":"            dn_events \u003d (data[EventDataParser.NOTIFICATION_TAG]"},{"line_number":289,"context_line":"                             [EventDataParser.DC_NOTIFICATION_TAG]"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_83a59b05","line":286,"range":{"start_line":286,"start_character":0,"end_line":286,"end_character":23},"updated":"2017-03-07 23:50:54.000000000","message":"None shouldn\u0027t be returned. Just log and ignore.","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":318,"context_line":"        if index \u003c 0:"},{"line_number":319,"context_line":"            return None"},{"line_number":320,"context_line":"        try:"},{"line_number":321,"context_line":"            sub_str \u003d text[index + len(key) + 2:]"},{"line_number":322,"context_line":"            sub_str \u003d sub_str[0: sub_str.find(\u0027]\u0027)]"},{"line_number":323,"context_line":"            value \u003d sub_str[0: len(sub_str) - 1]"},{"line_number":324,"context_line":"            return value"},{"line_number":325,"context_line":"        except IndexError:"},{"line_number":326,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_43d00354","line":323,"range":{"start_line":321,"start_character":0,"end_line":323,"end_character":48},"updated":"2017-03-07 23:50:54.000000000","message":"how about regex match?\nsomething like .*\\[key\u003d(.*)\\].*","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"cc09db3dfcc63c1a1914c747a7b3d48b7232baed","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @classmethod"},{"line_number":62,"context_line":"    def odl_create_websocket(cls, odl_url, path, datastore, scope,"},{"line_number":63,"context_line":"                             leaf_node_only, packet_handler, status_cb\u003dNone):"},{"line_number":64,"context_line":"        if odl_url is None:"},{"line_number":65,"context_line":"            LOG.error(_LE(\"invalid odl url\"), exc_info\u003dTrue)"},{"line_number":66,"context_line":"            raise Exception(_(\"Invalid ODL URL\"))"}],"source_content_type":"text/x-python","patch_set":16,"id":"5a22e58a_13720fe6","line":63,"updated":"2017-03-14 12:05:10.000000000","message":"I think this should be at the end of the argument list and have a default value (False) so it is optional to the callers. I think it\u0027s esoteric enough that most people should not have to think about it.","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ad5f9cc517f67af0052b817bef7207e0667fcae3","unresolved":false,"context_lines":[{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @classmethod"},{"line_number":62,"context_line":"    def odl_create_websocket(cls, odl_url, path, datastore, scope,"},{"line_number":63,"context_line":"                             leaf_node_only, packet_handler, status_cb\u003dNone):"},{"line_number":64,"context_line":"        if odl_url is None:"},{"line_number":65,"context_line":"            LOG.error(_LE(\"invalid odl url\"), exc_info\u003dTrue)"},{"line_number":66,"context_line":"            raise Exception(_(\"Invalid ODL URL\"))"}],"source_content_type":"text/x-python","patch_set":16,"id":"3a1ff146_c03411e0","line":63,"in_reply_to":"5a22e58a_13720fe6","updated":"2017-03-15 01:41:25.000000000","message":"Which argument do you mean?\nleaf_node_only?","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"505ce1f0baead10bb65a78612cd06e4c949ca0d3","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                data \u003d ws.recv()"},{"line_number":112,"context_line":"                if len(data) \u003d\u003d 0:"},{"line_number":113,"context_line":"                    LOG.warning(_LW(\"websocket received 0 bytes\"),"},{"line_number":114,"context_line":"                                exc_info\u003dTrue)"},{"line_number":115,"context_line":"                    continue"},{"line_number":116,"context_line":"            except websocket.WebSocketTimeoutException:"},{"line_number":117,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a30ddce_227004dc","line":114,"range":{"start_line":114,"start_character":32,"end_line":114,"end_character":45},"updated":"2017-03-10 03:22:26.000000000","message":"exception isn\u0027t thrown.","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"505ce1f0baead10bb65a78612cd06e4c949ca0d3","unresolved":false,"context_lines":[{"line_number":135,"context_line":"            try:"},{"line_number":136,"context_line":"                self.packet_handler(data, first_connection)"},{"line_number":137,"context_line":"                first_connection \u003d False"},{"line_number":138,"context_line":"            except Exception:"},{"line_number":139,"context_line":"                LOG.error(_LE(\"Error in packet_handler\"), exc_info\u003dTrue)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        if ws is not None:"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a30ddce_e250ac34","line":138,"range":{"start_line":138,"start_character":12,"end_line":138,"end_character":28},"updated":"2017-03-10 03:22:26.000000000","message":"packet_handler is allowed to raise exception?\nWhat\u0027s the contraction?","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"cc09db3dfcc63c1a1914c747a7b3d48b7232baed","unresolved":false,"context_lines":[{"line_number":135,"context_line":"            try:"},{"line_number":136,"context_line":"                self.packet_handler(data, first_connection)"},{"line_number":137,"context_line":"                first_connection \u003d False"},{"line_number":138,"context_line":"            except Exception:"},{"line_number":139,"context_line":"                LOG.error(_LE(\"Error in packet_handler\"), exc_info\u003dTrue)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        if ws is not None:"}],"source_content_type":"text/x-python","patch_set":16,"id":"5a22e58a_5313a65c","line":138,"range":{"start_line":138,"start_character":12,"end_line":138,"end_character":28},"in_reply_to":"9a30ddce_e250ac34","updated":"2017-03-14 12:05:10.000000000","message":"It definitely should not raise an exception but if it does we don\u0027t want the loop to exit, no?","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"448fd63be9ed4e002ddeab1e2a65ffeacae58ab7","unresolved":false,"context_lines":[{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def _set_websocket_status(self, status):"},{"line_number":145,"context_line":"        if self.status_cb:"},{"line_number":146,"context_line":"            self.status_cb(status)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _subscribe_websocket(self):"},{"line_number":149,"context_line":"        \"\"\"ODL Websocket change notification subscription\"\"\""}],"source_content_type":"text/x-python","patch_set":16,"id":"3a1ff146_5da0fbf4","line":146,"updated":"2017-03-15 09:29:46.000000000","message":"After reviewing and testing https://review.openstack.org/#/c/444047/ I realized that this should also be wrapped in a try/except just like the call to packet_handler (for the same reason.)","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"cc09db3dfcc63c1a1914c747a7b3d48b7232baed","unresolved":false,"context_lines":[{"line_number":191,"context_line":"            stream_name \u003d stream_name[\u0027output\u0027][\u0027stream-name\u0027]"},{"line_number":192,"context_line":"            url \u003d ws_dce_subs_url + stream_name"},{"line_number":193,"context_line":"            if self.leaf_node_only is True:"},{"line_number":194,"context_line":"                url +\u003d \"?odlLeafNodesOnly\u003dtrue\""},{"line_number":195,"context_line":"            response \u003d self.odl_rest_client.get(url)"},{"line_number":196,"context_line":"            response.raise_for_status()"},{"line_number":197,"context_line":"            stream_url \u003d response.headers[\u0027location\u0027]"}],"source_content_type":"text/x-python","patch_set":16,"id":"5a22e58a_13b04ff4","line":194,"updated":"2017-03-14 12:05:10.000000000","message":"Sorry about this but the name of this has changed to \"odl-leaf-nodes-only\" for consistency with the other query params","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"505ce1f0baead10bb65a78612cd06e4c949ca0d3","unresolved":false,"context_lines":[{"line_number":321,"context_line":""},{"line_number":322,"context_line":"    @staticmethod"},{"line_number":323,"context_line":"    def extract_field(text, key):"},{"line_number":324,"context_line":"        pattern \u003d \u0027.*\\[\u0027 + key + \u0027\u003d(.*?)\\]\u0027"},{"line_number":325,"context_line":"        match \u003d re.search(pattern, text)"},{"line_number":326,"context_line":"        if match:"},{"line_number":327,"context_line":"            return match.group(1)"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a30ddce_02106058","line":324,"range":{"start_line":324,"start_character":38,"end_line":324,"end_character":39},"updated":"2017-03-10 03:22:26.000000000","message":"is this needed?","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"a0a1d6425dd1f3c8d01d52188640830b87b14343","unresolved":false,"context_lines":[{"line_number":124,"context_line":"            except (websocket.WebSocketException, Exception):"},{"line_number":125,"context_line":"                # Connection closed trigger reconnection"},{"line_number":126,"context_line":"                LOG.error(_LE(\"websocket unexpected exception, \""},{"line_number":127,"context_line":"                          \"closing and restarting...\"))"},{"line_number":128,"context_line":"                self._close_ws(ws)"},{"line_number":129,"context_line":"                ws \u003d None"},{"line_number":130,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":20,"id":"dfeb2761_ea71d277","line":127,"updated":"2017-04-05 10:55:15.000000000","message":"I think it is important to print the exception here. The reason why the connection failed could be very important to know about","commit_id":"16280b050feb6c40b7b9cef4ec0900916adbfb80"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"a0a1d6425dd1f3c8d01d52188640830b87b14343","unresolved":false,"context_lines":[{"line_number":134,"context_line":"                self.packet_handler(data, first_connection)"},{"line_number":135,"context_line":"                first_connection \u003d False"},{"line_number":136,"context_line":"            except Exception:"},{"line_number":137,"context_line":"                LOG.error(_LE(\"Error in packet_handler callback\"))"},{"line_number":138,"context_line":""},{"line_number":139,"context_line":"        if ws is not None:"},{"line_number":140,"context_line":"            self._close_ws(ws)"}],"source_content_type":"text/x-python","patch_set":20,"id":"dfeb2761_2a11fa04","line":137,"updated":"2017-04-05 10:55:15.000000000","message":"Exceptions should not be swallowed. I hit this. I had a bug in my packet_handler and the exception was being swallowed so I din\u0027t even know what was wrong.","commit_id":"16280b050feb6c40b7b9cef4ec0900916adbfb80"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"a0a1d6425dd1f3c8d01d52188640830b87b14343","unresolved":false,"context_lines":[{"line_number":144,"context_line":"            if self.status_cb:"},{"line_number":145,"context_line":"                self.status_cb(status)"},{"line_number":146,"context_line":"        except Exception:"},{"line_number":147,"context_line":"            LOG.error(_LE(\"Error in status_cb\"))"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def _subscribe_websocket(self):"},{"line_number":150,"context_line":"        \"\"\"ODL Websocket change notification subscription\"\"\""}],"source_content_type":"text/x-python","patch_set":20,"id":"dfeb2761_6a34a293","line":147,"updated":"2017-04-05 10:55:15.000000000","message":"same here. the exception should be logged","commit_id":"16280b050feb6c40b7b9cef4ec0900916adbfb80"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"a0a1d6425dd1f3c8d01d52188640830b87b14343","unresolved":false,"context_lines":[{"line_number":167,"context_line":"                                                     odl_subscription_data)"},{"line_number":168,"context_line":"            response.raise_for_status()"},{"line_number":169,"context_line":"        except exceptions.ConnectionError:"},{"line_number":170,"context_line":"            LOG.error(_LE(\"cannot connect to the opendaylight controller\"))"},{"line_number":171,"context_line":"            return None"},{"line_number":172,"context_line":"        except exceptions.HTTPError as e:"},{"line_number":173,"context_line":"            # restconf returns 400 on operation when path is not available"}],"source_content_type":"text/x-python","patch_set":20,"id":"dfeb2761_ca184e1f","line":170,"updated":"2017-04-05 10:55:15.000000000","message":"here too","commit_id":"16280b050feb6c40b7b9cef4ec0900916adbfb80"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"a0a1d6425dd1f3c8d01d52188640830b87b14343","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                          \"check path for websocket connection\")"},{"line_number":177,"context_line":"                raise ValueError(_(\"bad_request (http400),check path:%s.\") % e)"},{"line_number":178,"context_line":"            else:"},{"line_number":179,"context_line":"                LOG.warning(_LW(\"websocket connection failed, \"))"},{"line_number":180,"context_line":"                return None"},{"line_number":181,"context_line":"        except Exception:"},{"line_number":182,"context_line":"            LOG.error(_LE(\"websocket subscription failed\"))"}],"source_content_type":"text/x-python","patch_set":20,"id":"dfeb2761_8ad48621","line":179,"updated":"2017-04-05 10:55:15.000000000","message":"here too","commit_id":"16280b050feb6c40b7b9cef4ec0900916adbfb80"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"a0a1d6425dd1f3c8d01d52188640830b87b14343","unresolved":false,"context_lines":[{"line_number":179,"context_line":"                LOG.warning(_LW(\"websocket connection failed, \"))"},{"line_number":180,"context_line":"                return None"},{"line_number":181,"context_line":"        except Exception:"},{"line_number":182,"context_line":"            LOG.error(_LE(\"websocket subscription failed\"))"},{"line_number":183,"context_line":"            return None"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        # Subscribing to stream. Returns websocket URL to listen to"}],"source_content_type":"text/x-python","patch_set":20,"id":"dfeb2761_6ad94255","line":182,"updated":"2017-04-05 10:55:15.000000000","message":"here too","commit_id":"16280b050feb6c40b7b9cef4ec0900916adbfb80"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"a0a1d6425dd1f3c8d01d52188640830b87b14343","unresolved":false,"context_lines":[{"line_number":214,"context_line":"            LOG.error(_LE(\"websocket subscribe got bad stream data\"))"},{"line_number":215,"context_line":"            raise ValueError(_(\"websocket subscribe bad stream data:%s.\") % e)"},{"line_number":216,"context_line":"        except Exception:"},{"line_number":217,"context_line":"            LOG.error(_LE(\"websocket subscription failed\"))"},{"line_number":218,"context_line":"            return None"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"    def _socket_create_connection(self, stream_url):"}],"source_content_type":"text/x-python","patch_set":20,"id":"dfeb2761_caedeef0","line":217,"updated":"2017-04-05 10:55:15.000000000","message":"here too and also below but I\u0027m going to make this the last comment ;-)","commit_id":"16280b050feb6c40b7b9cef4ec0900916adbfb80"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"7be8172aaafd3105209342eac52a7afe830dd870","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":"ODL_OPERATIONAL_DATASTORE \u003d \"OPERATIONAL\""},{"line_number":34,"context_line":"ODL_CONFIGURATION_DATASTORE \u003d \"CONFIGURATION\""},{"line_number":35,"context_line":"ODL_NOTIFICATION_SCOPE_BASE \u003d \"BASE\""},{"line_number":36,"context_line":"ODL_NOTIFICATION_SCOPE_ONE \u003d \"ONE\""},{"line_number":37,"context_line":"ODL_NOTIFICATION_SCOPE_SUBTREE \u003d \"SUBTREE\""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"ODL_WEBSOCKET_DISCONNECTED \u003d \"ODL_WEBSOCKET_DISCONNECTED\""},{"line_number":40,"context_line":"ODL_WEBSOCKET_CONNECTING \u003d \"ODL_WEBSOCKET_CONNECTING\""},{"line_number":41,"context_line":"ODL_WEBSOCKET_CONNECTED \u003d \"ODL_WEBSOCKET_CONNECTED\""},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class OpendaylightWebsocketClient(object):"}],"source_content_type":"text/x-python","patch_set":21,"id":"9ff52f3f_643b49d1","line":41,"range":{"start_line":33,"start_character":0,"end_line":41,"end_character":51},"updated":"2017-04-13 16:33:50.000000000","message":"would moving these constants to common/constants make sense ? so that they can referred from there first in future if needed.","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"7be8172aaafd3105209342eac52a7afe830dd870","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        self._odl_sync_thread \u003d self.start_odl_websocket_thread()"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    @classmethod"},{"line_number":62,"context_line":"    def odl_create_websocket(cls, odl_url, path, datastore, scope,"},{"line_number":63,"context_line":"                             packet_handler, status_cb\u003dNone,"},{"line_number":64,"context_line":"                             leaf_node_only\u003dFalse):"},{"line_number":65,"context_line":"        if odl_url is None:"},{"line_number":66,"context_line":"            LOG.error(_LE(\"invalid odl url\"), exc_info\u003dTrue)"},{"line_number":67,"context_line":"            raise Exception(_(\"Invalid ODL URL\"))"}],"source_content_type":"text/x-python","patch_set":21,"id":"9ff52f3f_e483d955","line":64,"range":{"start_line":62,"start_character":4,"end_line":64,"end_character":51},"updated":"2017-04-13 16:33:50.000000000","message":"optional: can a docstring be added ? so that devs can get info about params and return here ?","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"c7152fea72f43230c071629134e7b7391103dc65","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            except websocket.WebSocketConnectionClosedException as e:"},{"line_number":119,"context_line":"                # per websocket-client, \"If remote host closed the connection"},{"line_number":120,"context_line":"                # or some network error happened\""},{"line_number":121,"context_line":"                LOG.warning(_LW(\"websocket connection closed or IO error:%s\") %e)"},{"line_number":122,"context_line":"                self._close_ws(ws)"},{"line_number":123,"context_line":"                ws \u003d None"},{"line_number":124,"context_line":"                continue"}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_30b92278","line":121,"range":{"start_line":121,"start_character":28,"end_line":121,"end_character":80},"updated":"2017-04-12 17:57:07.000000000","message":"don\u0027t use % in log. Let LOG handler format them.","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"c7152fea72f43230c071629134e7b7391103dc65","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            stream_name \u003d response.json()"},{"line_number":190,"context_line":"            stream_name \u003d stream_name[\u0027output\u0027][\u0027stream-name\u0027]"},{"line_number":191,"context_line":"            url \u003d ws_dce_subs_url + stream_name"},{"line_number":192,"context_line":"            if self.leaf_node_only is True:"},{"line_number":193,"context_line":"                url +\u003d \"?odl-leaf-nodes-only\u003dtrue\""},{"line_number":194,"context_line":"            response \u003d self.odl_rest_client.get(url)"},{"line_number":195,"context_line":"            response.raise_for_status()"}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_0b15d33f","line":192,"range":{"start_line":192,"start_character":15,"end_line":192,"end_character":41},"updated":"2017-04-12 17:57:07.000000000","message":"if self.leaf_node_only:\nis True is redundant.","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"c7152fea72f43230c071629134e7b7391103dc65","unresolved":false,"context_lines":[{"line_number":284,"context_line":"                             [EventDataParser.DC_NOTIFICATION_TAG]"},{"line_number":285,"context_line":"                             [EventDataParser.DC_EVENT_TAG])"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"            if isinstance(dn_events, list) is False:"},{"line_number":288,"context_line":"                # Convert single event to a list with 1 event"},{"line_number":289,"context_line":"                new_list \u003d list()"},{"line_number":290,"context_line":"                new_list.append(dn_events)"}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_d0e2f69f","line":287,"range":{"start_line":287,"start_character":16,"end_line":287,"end_character":51},"updated":"2017-04-12 17:57:07.000000000","message":"\"not isinstance()\" is more straightforward.","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"c7152fea72f43230c071629134e7b7391103dc65","unresolved":false,"context_lines":[{"line_number":286,"context_line":""},{"line_number":287,"context_line":"            if isinstance(dn_events, list) is False:"},{"line_number":288,"context_line":"                # Convert single event to a list with 1 event"},{"line_number":289,"context_line":"                new_list \u003d list()"},{"line_number":290,"context_line":"                new_list.append(dn_events)"},{"line_number":291,"context_line":"                dn_events \u003d new_list"},{"line_number":292,"context_line":""},{"line_number":293,"context_line":"            for e in dn_events:"},{"line_number":294,"context_line":"                yield cls(e)"}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_b0f6525c","line":291,"range":{"start_line":289,"start_character":0,"end_line":291,"end_character":36},"updated":"2017-04-12 17:57:07.000000000","message":"dn_events \u003d [dn_events]","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"66c85cd9f087a838657e62ecff23c3b50e2f1128","unresolved":false,"context_lines":[{"line_number":311,"context_line":""},{"line_number":312,"context_line":"    @staticmethod"},{"line_number":313,"context_line":"    def extract_field(text, key):"},{"line_number":314,"context_line":"        pattern \u003d \u0027.*\\[\u0027 + key + \u0027\u003d(.*?)\\]\u0027"},{"line_number":315,"context_line":"        match \u003d re.search(pattern, text)"},{"line_number":316,"context_line":"        if match:"},{"line_number":317,"context_line":"            return match.group(1)"}],"source_content_type":"text/x-python","patch_set":21,"id":"9ff52f3f_4fb5f930","line":314,"range":{"start_line":314,"start_character":19,"end_line":314,"end_character":21},"updated":"2017-04-13 19:28:30.000000000","message":"This doesn\u0027t make sense.\n.* can be removed.","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ff765143d92538ab74c6b1bfc540b5db0e3b5120","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from networking_odl.common import client as odl_client"},{"line_number":17,"context_line":"from oslo_config import cfg"},{"line_number":18,"context_line":"from oslo_log import log"},{"line_number":19,"context_line":"from oslo_serialization import jsonutils"}],"source_content_type":"text/x-python","patch_set":24,"id":"5ff73747_8db91b7a","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":54},"updated":"2017-04-29 06:36:59.000000000","message":"pep8. separate out this line.","commit_id":"415ed78841e01cc4c4c3b8d1f1ae35e01fd47dfe"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ff765143d92538ab74c6b1bfc540b5db0e3b5120","unresolved":false,"context_lines":[{"line_number":257,"context_line":"        try:"},{"line_number":258,"context_line":"            if ws is not None:"},{"line_number":259,"context_line":"                ws.close()"},{"line_number":260,"context_line":"        except (websocket.WebSocketException, Exception):"},{"line_number":261,"context_line":"            LOG.error(\"Error while closing websocket\", exc_info\u003dTrue)"},{"line_number":262,"context_line":"        self._set_websocket_status(ODL_WEBSOCKET_DISCONNECTED)"},{"line_number":263,"context_line":""}],"source_content_type":"text/x-python","patch_set":24,"id":"5ff73747_cd6843f6","line":260,"range":{"start_line":260,"start_character":15,"end_line":260,"end_character":56},"updated":"2017-04-29 06:36:59.000000000","message":"Exception is the base class of exceptions.\nSo no point to list WebSocketException","commit_id":"415ed78841e01cc4c4c3b8d1f1ae35e01fd47dfe"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"c9bfe4c3c80fe9237ca6c6083816d6b0a35a8d4f","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"from networking_odl._i18n import _"},{"line_number":17,"context_line":"from networking_odl.common import client as odl_client"},{"line_number":18,"context_line":"from oslo_config import cfg"},{"line_number":19,"context_line":"from oslo_log import log"}],"source_content_type":"text/x-python","patch_set":27,"id":"5ff73747_21cd5d84","line":16,"range":{"start_line":16,"start_character":0,"end_line":16,"end_character":34},"updated":"2017-05-01 19:45:57.000000000","message":"networking-odl no longer translating log messages. This is removed in my last patch","commit_id":"6cabc3e237d2c73621e2541e35fc9b01f0545920"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"c9bfe4c3c80fe9237ca6c6083816d6b0a35a8d4f","unresolved":false,"context_lines":[{"line_number":64,"context_line":"                             leaf_node_only\u003dFalse):"},{"line_number":65,"context_line":"        if odl_url is None:"},{"line_number":66,"context_line":"            LOG.error(\"invalid odl url\", exc_info\u003dTrue)"},{"line_number":67,"context_line":"            raise Exception(_(\"Invalid ODL URL\"))"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"        odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client("},{"line_number":70,"context_line":"            odl_url)"}],"source_content_type":"text/x-python","patch_set":27,"id":"5ff73747_a1a60dc0","line":67,"range":{"start_line":67,"start_character":28,"end_line":67,"end_character":29},"updated":"2017-05-01 19:45:57.000000000","message":"networking-odl no longer translating log messages. This is removed in my last patch","commit_id":"6cabc3e237d2c73621e2541e35fc9b01f0545920"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"f8ba4de7f4e72bd5094cfcc9bc973a6c0efbc1c1","unresolved":false,"context_lines":[{"line_number":140,"context_line":"                LOG.error(\"Error in packet_handler callback\","},{"line_number":141,"context_line":"                          exc_info\u003dTrue)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"        if ws is not None:"},{"line_number":144,"context_line":"            self._close_ws(ws)"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"    def _set_websocket_status(self, status):"}],"source_content_type":"text/x-python","patch_set":30,"id":"5ff73747_6626bf6b","line":143,"range":{"start_line":143,"start_character":8,"end_line":143,"end_character":26},"updated":"2017-05-02 15:11:37.000000000","message":"_close_ws checks if ws is None.\nEven if ws is None, don\u0027t we want to transition to disconnected state?","commit_id":"05adb97dc20c3bd150de8b6e2d4493a3ffec5e52"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"f8ba4de7f4e72bd5094cfcc9bc973a6c0efbc1c1","unresolved":false,"context_lines":[{"line_number":285,"context_line":"            LOG.warning(\"invalid websocket notification\")"},{"line_number":286,"context_line":"            return"},{"line_number":287,"context_line":"        try:"},{"line_number":288,"context_line":"            dn_events \u003d (data[EventDataParser.NOTIFICATION_TAG]"},{"line_number":289,"context_line":"                             [EventDataParser.DC_NOTIFICATION_TAG]"},{"line_number":290,"context_line":"                             [EventDataParser.DC_EVENT_TAG])"},{"line_number":291,"context_line":""}],"source_content_type":"text/x-python","patch_set":30,"id":"5ff73747_86ec2b2a","line":288,"range":{"start_line":288,"start_character":30,"end_line":288,"end_character":46},"updated":"2017-05-02 15:11:37.000000000","message":"cls.","commit_id":"05adb97dc20c3bd150de8b6e2d4493a3ffec5e52"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"f8ba4de7f4e72bd5094cfcc9bc973a6c0efbc1c1","unresolved":false,"context_lines":[{"line_number":286,"context_line":"            return"},{"line_number":287,"context_line":"        try:"},{"line_number":288,"context_line":"            dn_events \u003d (data[EventDataParser.NOTIFICATION_TAG]"},{"line_number":289,"context_line":"                             [EventDataParser.DC_NOTIFICATION_TAG]"},{"line_number":290,"context_line":"                             [EventDataParser.DC_EVENT_TAG])"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"            if not isinstance(dn_events, list):"}],"source_content_type":"text/x-python","patch_set":30,"id":"5ff73747_66f11f02","line":289,"range":{"start_line":289,"start_character":30,"end_line":289,"end_character":46},"updated":"2017-05-02 15:11:37.000000000","message":"cls.","commit_id":"05adb97dc20c3bd150de8b6e2d4493a3ffec5e52"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"f8ba4de7f4e72bd5094cfcc9bc973a6c0efbc1c1","unresolved":false,"context_lines":[{"line_number":287,"context_line":"        try:"},{"line_number":288,"context_line":"            dn_events \u003d (data[EventDataParser.NOTIFICATION_TAG]"},{"line_number":289,"context_line":"                             [EventDataParser.DC_NOTIFICATION_TAG]"},{"line_number":290,"context_line":"                             [EventDataParser.DC_EVENT_TAG])"},{"line_number":291,"context_line":""},{"line_number":292,"context_line":"            if not isinstance(dn_events, list):"},{"line_number":293,"context_line":"                dn_events \u003d [dn_events]"}],"source_content_type":"text/x-python","patch_set":30,"id":"5ff73747_46f623fc","line":290,"range":{"start_line":290,"start_character":30,"end_line":290,"end_character":46},"updated":"2017-05-02 15:11:37.000000000","message":"cls.","commit_id":"05adb97dc20c3bd150de8b6e2d4493a3ffec5e52"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"5e4da8ebe056ee9336f8a24e620f6baefa6fa251","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        while not self.exit_websocket_thread:"},{"line_number":97,"context_line":"            if exit_after_run:"},{"line_number":98,"context_line":"                # Permanently waiting thread model breaks unit tests"},{"line_number":99,"context_line":"                # Adding this arg to exit after one run for unit tests"},{"line_number":100,"context_line":"                self.set_exit_flag()"},{"line_number":101,"context_line":"            # connect if necessary"},{"line_number":102,"context_line":"            if ws is None:"}],"source_content_type":"text/x-python","patch_set":31,"id":"3f044301_08bffdfb","line":99,"updated":"2017-05-04 11:23:36.000000000","message":"Wouldn\u0027t it be better to have the unit test call set_exit_flag?","commit_id":"41743cfc867b6dadf629a22a2033a7e61b977dba"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"b73e640cd90d5bf480add9e5c61e3435e21069cb","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        self._odl_sync_thread \u003d self.start_odl_websocket_thread()"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"    @classmethod"},{"line_number":63,"context_line":"    def odl_create_websocket(cls, odl_url, path, datastore, scope,"},{"line_number":64,"context_line":"                             packet_handler, status_cb\u003dNone,"},{"line_number":65,"context_line":"                             leaf_node_only\u003dFalse):"},{"line_number":66,"context_line":"        if odl_url is None:"},{"line_number":67,"context_line":"            LOG.error(\"invalid odl url\", exc_info\u003dTrue)"},{"line_number":68,"context_line":"            raise Exception(_(\"Invalid ODL URL\"))"}],"source_content_type":"text/x-python","patch_set":32,"id":"3f044301_3d1c2469","line":65,"range":{"start_line":63,"start_character":4,"end_line":65,"end_character":51},"updated":"2017-05-04 20:42:37.000000000","message":"This method deserves a docstring as it will make little easy for understanding, this client has so many helper methods, some base should have docstrings.","commit_id":"e28e759a197520906f8b4e037b0b69ab92b2102b"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"b73e640cd90d5bf480add9e5c61e3435e21069cb","unresolved":false,"context_lines":[{"line_number":63,"context_line":"    def odl_create_websocket(cls, odl_url, path, datastore, scope,"},{"line_number":64,"context_line":"                             packet_handler, status_cb\u003dNone,"},{"line_number":65,"context_line":"                             leaf_node_only\u003dFalse):"},{"line_number":66,"context_line":"        if odl_url is None:"},{"line_number":67,"context_line":"            LOG.error(\"invalid odl url\", exc_info\u003dTrue)"},{"line_number":68,"context_line":"            raise Exception(_(\"Invalid ODL URL\"))"},{"line_number":69,"context_line":""}],"source_content_type":"text/x-python","patch_set":32,"id":"3f044301_8a7650d8","line":66,"range":{"start_line":66,"start_character":8,"end_line":66,"end_character":27},"updated":"2017-05-04 20:42:37.000000000","message":"this validation does not seems enough along with i think it should actually validate url for now any string input if it is url or not can skip this block.","commit_id":"e28e759a197520906f8b4e037b0b69ab92b2102b"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"b73e640cd90d5bf480add9e5c61e3435e21069cb","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        # Change_event_notification_subscription#rpc_create-data-change-event-subscription"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        # Invoke rpc create-data-change-event-subscription"},{"line_number":159,"context_line":"        ws_create_dce_subs_url \u003d (\"restconf/operations/sal-remote:\""},{"line_number":160,"context_line":"                                  \"create-data-change-event-subscription\")"},{"line_number":161,"context_line":"        odl_subscription_data \u003d {\u0027input\u0027: {"},{"line_number":162,"context_line":"            \u0027path\u0027: self.path,"},{"line_number":163,"context_line":"            \u0027sal-remote-augment:datastore\u0027: self.datastore,"}],"source_content_type":"text/x-python","patch_set":32,"id":"3f044301_ca457872","line":160,"range":{"start_line":159,"start_character":34,"end_line":160,"end_character":74},"updated":"2017-05-04 20:42:37.000000000","message":"as it is going to stay same i guess constant can be used for different types of notifications.","commit_id":"e28e759a197520906f8b4e037b0b69ab92b2102b"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"b73e640cd90d5bf480add9e5c61e3435e21069cb","unresolved":false,"context_lines":[{"line_number":187,"context_line":"            return None"},{"line_number":188,"context_line":""},{"line_number":189,"context_line":"        # Subscribing to stream. Returns websocket URL to listen to"},{"line_number":190,"context_line":"        ws_dce_subs_url \u003d \"\"\"restconf/streams/stream/\"\"\""},{"line_number":191,"context_line":"        try:"},{"line_number":192,"context_line":"            stream_name \u003d response.json()"},{"line_number":193,"context_line":"            stream_name \u003d stream_name[\u0027output\u0027][\u0027stream-name\u0027]"}],"source_content_type":"text/x-python","patch_set":32,"id":"3f044301_2a561c2b","line":190,"range":{"start_line":190,"start_character":26,"end_line":190,"end_character":56},"updated":"2017-05-04 20:42:37.000000000","message":"\"restconf/streams/stream\" would be same as this and this doesn\u0027t look docstring either","commit_id":"e28e759a197520906f8b4e037b0b69ab92b2102b"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"b73e640cd90d5bf480add9e5c61e3435e21069cb","unresolved":false,"context_lines":[{"line_number":236,"context_line":"            LOG.exception(\"websocket create connection failed\","},{"line_number":237,"context_line":"                          exc_info\u003dTrue)"},{"line_number":238,"context_line":"            return None"},{"line_number":239,"context_line":"        if ws is None or not ws.connected:"},{"line_number":240,"context_line":"            LOG.error(\"websocket create connection unsuccessful\")"},{"line_number":241,"context_line":"            return None"},{"line_number":242,"context_line":""},{"line_number":243,"context_line":"        LOG.debug(\"websocket connection established\")"},{"line_number":244,"context_line":"        return ws"}],"source_content_type":"text/x-python","patch_set":32,"id":"3f044301_4a2e08a6","line":241,"range":{"start_line":239,"start_character":7,"end_line":241,"end_character":23},"updated":"2017-05-04 20:42:37.000000000","message":"if error has happened would have been already logged it can be moved to try block right after L227 so that if ws gets none it does not need to execute after that.","commit_id":"e28e759a197520906f8b4e037b0b69ab92b2102b"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"b73e640cd90d5bf480add9e5c61e3435e21069cb","unresolved":false,"context_lines":[{"line_number":245,"context_line":""},{"line_number":246,"context_line":"    def _connect_ws(self):"},{"line_number":247,"context_line":"        self._set_websocket_status(ODL_WEBSOCKET_CONNECTING)"},{"line_number":248,"context_line":"        stream_url \u003d self._subscribe_websocket()"},{"line_number":249,"context_line":"        if stream_url is None:"},{"line_number":250,"context_line":"            return None"},{"line_number":251,"context_line":"        ws \u003d self._socket_create_connection(stream_url)"}],"source_content_type":"text/x-python","patch_set":32,"id":"3f044301_ca133866","line":248,"range":{"start_line":248,"start_character":21,"end_line":248,"end_character":48},"updated":"2017-05-04 20:42:37.000000000","message":"so by default it would be subscribed to both create and streams or we can have optional argument to subscirbe?","commit_id":"e28e759a197520906f8b4e037b0b69ab92b2102b"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"98e7975858b6420961a06daae0ad340e7ca5fa06","unresolved":false,"context_lines":[{"line_number":74,"context_line":""},{"line_number":75,"context_line":"        if odl_url is None:"},{"line_number":76,"context_line":"            LOG.error(\"invalid odl url\", exc_info\u003dTrue)"},{"line_number":77,"context_line":"            raise Exception(_(\"Invalid ODL URL\"))"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        odl_rest_client \u003d odl_client.OpenDaylightRestClient.create_client("},{"line_number":80,"context_line":"            odl_url)"}],"source_content_type":"text/x-python","patch_set":34,"id":"3f044301_86029908","line":77,"range":{"start_line":77,"start_character":18,"end_line":77,"end_character":27},"updated":"2017-05-08 04:21:16.000000000","message":"ValueError.\nAt least Exception is not good practice.","commit_id":"a080ef8333f5b72aea1375861f9a9e87a78f52ee"}],"networking_odl/ml2/pseudo_agentdb_binding.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            return  # Retry on next poll"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        for host_config in hostconfigs:"},{"line_number":176,"context_line":"            try:"},{"line_number":177,"context_line":"                self.agentdb_row[\u0027host\u0027] \u003d host_config[\u0027host-id\u0027]"},{"line_number":178,"context_line":"                self.agentdb_row[\u0027agent_type\u0027] \u003d host_config[\u0027host-type\u0027]"},{"line_number":179,"context_line":"                self.agentdb_row[\u0027configurations\u0027] \u003d jsonutils.loads("},{"line_number":180,"context_line":"                    host_config[\u0027config\u0027])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"                agents_db.create_or_update_agent("},{"line_number":183,"context_line":"                    context.get_admin_context(), self.agentdb_row)"},{"line_number":184,"context_line":"            except Exception:"},{"line_number":185,"context_line":"                LOG.exception(_LE(\"Unable to update agentdb.\"))"},{"line_number":186,"context_line":"                continue  # try next hostcofig"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def _update_agents_db_row(self, hostid, hosttype, config):"},{"line_number":189,"context_line":"        LOG.debug(\"ODLPORTBINDING Updating agents DB with ODL hostconfig\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_ee8d767c","line":186,"range":{"start_line":176,"start_character":0,"end_line":186,"end_character":46},"updated":"2017-02-03 20:44:20.000000000","message":"Let\u0027s consolidate the logic.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":173,"context_line":"            return  # Retry on next poll"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        for host_config in hostconfigs:"},{"line_number":176,"context_line":"            try:"},{"line_number":177,"context_line":"                self.agentdb_row[\u0027host\u0027] \u003d host_config[\u0027host-id\u0027]"},{"line_number":178,"context_line":"                self.agentdb_row[\u0027agent_type\u0027] \u003d host_config[\u0027host-type\u0027]"},{"line_number":179,"context_line":"                self.agentdb_row[\u0027configurations\u0027] \u003d jsonutils.loads("},{"line_number":180,"context_line":"                    host_config[\u0027config\u0027])"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":"                agents_db.create_or_update_agent("},{"line_number":183,"context_line":"                    context.get_admin_context(), self.agentdb_row)"},{"line_number":184,"context_line":"            except Exception:"},{"line_number":185,"context_line":"                LOG.exception(_LE(\"Unable to update agentdb.\"))"},{"line_number":186,"context_line":"                continue  # try next hostcofig"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def _update_agents_db_row(self, hostid, hosttype, config):"},{"line_number":189,"context_line":"        LOG.debug(\"ODLPORTBINDING Updating agents DB with ODL hostconfig\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_8f9f8002","line":186,"range":{"start_line":176,"start_character":0,"end_line":186,"end_character":46},"in_reply_to":"1a430d35_ee8d767c","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            return"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            self.agentdb_row[\u0027host\u0027] \u003d hostid"},{"line_number":199,"context_line":"            self.agentdb_row[\u0027agent_type\u0027] \u003d hosttype"},{"line_number":200,"context_line":"            self.agentdb_row[\u0027configurations\u0027] \u003d jsonutils.loads(config)"},{"line_number":201,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_2e877e62","line":198,"range":{"start_line":198,"start_character":12,"end_line":198,"end_character":28},"updated":"2017-02-03 20:44:20.000000000","message":"agentdb_row can be a local variable.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":195,"context_line":"            return"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"        try:"},{"line_number":198,"context_line":"            self.agentdb_row[\u0027host\u0027] \u003d hostid"},{"line_number":199,"context_line":"            self.agentdb_row[\u0027agent_type\u0027] \u003d hosttype"},{"line_number":200,"context_line":"            self.agentdb_row[\u0027configurations\u0027] \u003d jsonutils.loads(config)"},{"line_number":201,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_ef863cb8","line":198,"range":{"start_line":198,"start_character":12,"end_line":198,"end_character":28},"in_reply_to":"1a430d35_2e877e62","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":308,"context_line":"    def _start_websocket(self, odl_url):"},{"line_number":309,"context_line":"        # Opendaylight path to recieve websocket notifications on"},{"line_number":310,"context_line":"        neutron_hostconfigs_path \u003d \"\"\"/neutron:neutron/neutron:hostconfigs\"\"\""},{"line_number":311,"context_line":"        stream_url \u003d odl_ws_client.odl_create_websocket_url("},{"line_number":312,"context_line":"            odl_url, neutron_hostconfigs_path,"},{"line_number":313,"context_line":"            odl_ws_client.ODL_OPERATIONAL_DATASTORE,"},{"line_number":314,"context_line":"            odl_ws_client.ODL_NOTIFICATION_SCOPE_SUBTREE"},{"line_number":315,"context_line":"        )"},{"line_number":316,"context_line":"        if not stream_url:"},{"line_number":317,"context_line":"            LOG.error(_LE(\"Cannot connect to the ODL Websocket interface\"),"},{"line_number":318,"context_line":"                      exc_info\u003dTrue)"},{"line_number":319,"context_line":"            return"},{"line_number":320,"context_line":"        LOG.debug(\"ODLPORTBINDING websocket stream URL: %s\", stream_url)"},{"line_number":321,"context_line":"        odl_ws_client.OpendaylightWebsocketThread("},{"line_number":322,"context_line":"            stream_url,"},{"line_number":323,"context_line":"            self._process_websocket_notification,"},{"line_number":324,"context_line":"            cfg.CONF.ml2_odl.timeout"},{"line_number":325,"context_line":"        )"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    def _extract_field(self, text, key):"},{"line_number":328,"context_line":"        index \u003d text.find(key)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_bb22ceb7","line":325,"range":{"start_line":311,"start_character":0,"end_line":325,"end_character":9},"updated":"2017-02-03 20:44:20.000000000","message":"This logic can be consolidated into odl websocket class as factory method.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":308,"context_line":"    def _start_websocket(self, odl_url):"},{"line_number":309,"context_line":"        # Opendaylight path to recieve websocket notifications on"},{"line_number":310,"context_line":"        neutron_hostconfigs_path \u003d \"\"\"/neutron:neutron/neutron:hostconfigs\"\"\""},{"line_number":311,"context_line":"        stream_url \u003d odl_ws_client.odl_create_websocket_url("},{"line_number":312,"context_line":"            odl_url, neutron_hostconfigs_path,"},{"line_number":313,"context_line":"            odl_ws_client.ODL_OPERATIONAL_DATASTORE,"},{"line_number":314,"context_line":"            odl_ws_client.ODL_NOTIFICATION_SCOPE_SUBTREE"},{"line_number":315,"context_line":"        )"},{"line_number":316,"context_line":"        if not stream_url:"},{"line_number":317,"context_line":"            LOG.error(_LE(\"Cannot connect to the ODL Websocket interface\"),"},{"line_number":318,"context_line":"                      exc_info\u003dTrue)"},{"line_number":319,"context_line":"            return"},{"line_number":320,"context_line":"        LOG.debug(\"ODLPORTBINDING websocket stream URL: %s\", stream_url)"},{"line_number":321,"context_line":"        odl_ws_client.OpendaylightWebsocketThread("},{"line_number":322,"context_line":"            stream_url,"},{"line_number":323,"context_line":"            self._process_websocket_notification,"},{"line_number":324,"context_line":"            cfg.CONF.ml2_odl.timeout"},{"line_number":325,"context_line":"        )"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"    def _extract_field(self, text, key):"},{"line_number":328,"context_line":"        index \u003d text.find(key)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_2f9134f1","line":325,"range":{"start_line":311,"start_character":0,"end_line":325,"end_character":9},"in_reply_to":"1a430d35_bb22ceb7","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"75809441955c7999a9a219e4fc10862cc7af7283","unresolved":false,"context_lines":[{"line_number":343,"context_line":"            LOG.warning(_LW(\"Invalid websocket notification\"))"},{"line_number":344,"context_line":"            return"},{"line_number":345,"context_line":"        try:"},{"line_number":346,"context_line":"            dn \u003d data[\u0027notification\u0027]"},{"line_number":347,"context_line":"            dn_event \u003d dn[\u0027data-changed-notification\u0027][\u0027data-change-event\u0027]"},{"line_number":348,"context_line":"        except KeyError:"},{"line_number":349,"context_line":"            LOG.warning(_LW(\"Invalid JSON for websocket notification\"))"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_0eff2202","line":346,"range":{"start_line":346,"start_character":22,"end_line":346,"end_character":36},"updated":"2017-02-03 20:44:20.000000000","message":"Let\u0027s define constants for those strings.","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"5dadc66a7b6eef5cf6cd18d7e8355b367efcc93c","unresolved":false,"context_lines":[{"line_number":343,"context_line":"            LOG.warning(_LW(\"Invalid websocket notification\"))"},{"line_number":344,"context_line":"            return"},{"line_number":345,"context_line":"        try:"},{"line_number":346,"context_line":"            dn \u003d data[\u0027notification\u0027]"},{"line_number":347,"context_line":"            dn_event \u003d dn[\u0027data-changed-notification\u0027][\u0027data-change-event\u0027]"},{"line_number":348,"context_line":"        except KeyError:"},{"line_number":349,"context_line":"            LOG.warning(_LW(\"Invalid JSON for websocket notification\"))"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa31d9ce_4fbca86c","line":346,"range":{"start_line":346,"start_character":22,"end_line":346,"end_character":36},"in_reply_to":"1a430d35_0eff2202","updated":"2017-02-11 01:01:53.000000000","message":"Done","commit_id":"ea6ba4d2e1afb10d363f49cbeca5ea97a2a30ec1"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"d3c935aa5a19c4d044c9f4abfc4058f615ecbd84","unresolved":false,"context_lines":[{"line_number":324,"context_line":"    def _process_websocket_notification(self, payload):"},{"line_number":325,"context_line":"        # Callback for websocket notification"},{"line_number":326,"context_line":"        LOG.debug(\"Websocket notification for hostconfig update\")"},{"line_number":327,"context_line":"        ODL_WS_NF_OPERATION_TAG \u003d \u0027operation\u0027"},{"line_number":328,"context_line":"        ODL_WS_NF_OPERATION_DELETE \u003d \u0027deleted\u0027"},{"line_number":329,"context_line":"        ODL_WS_NF_OPERATION_CREATE \u003d \u0027created\u0027"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        dn_event \u003d odl_ws_client.OpendaylightWebsocketClient.\\"},{"line_number":332,"context_line":"            get_data_change_event_list(payload)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_63e4fc3a","line":329,"range":{"start_line":327,"start_character":1,"end_line":329,"end_character":46},"updated":"2017-02-13 12:02:12.000000000","message":"I think these should be constants in websocket_client.py","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"ead1a5904fc463ed538c9c3796579873b7187a61","unresolved":false,"context_lines":[{"line_number":324,"context_line":"    def _process_websocket_notification(self, payload):"},{"line_number":325,"context_line":"        # Callback for websocket notification"},{"line_number":326,"context_line":"        LOG.debug(\"Websocket notification for hostconfig update\")"},{"line_number":327,"context_line":"        ODL_WS_NF_OPERATION_TAG \u003d \u0027operation\u0027"},{"line_number":328,"context_line":"        ODL_WS_NF_OPERATION_DELETE \u003d \u0027deleted\u0027"},{"line_number":329,"context_line":"        ODL_WS_NF_OPERATION_CREATE \u003d \u0027created\u0027"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        dn_event \u003d odl_ws_client.OpendaylightWebsocketClient.\\"},{"line_number":332,"context_line":"            get_data_change_event_list(payload)"}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_e62ebb41","line":329,"range":{"start_line":327,"start_character":1,"end_line":329,"end_character":46},"in_reply_to":"da36d5c6_888b8667","updated":"2017-02-26 01:19:49.000000000","message":"Done","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f6967d271a7748dda1584616f2a155cf9de3db21","unresolved":false,"context_lines":[{"line_number":324,"context_line":"    def _process_websocket_notification(self, payload):"},{"line_number":325,"context_line":"        # Callback for websocket notification"},{"line_number":326,"context_line":"        LOG.debug(\"Websocket notification for hostconfig update\")"},{"line_number":327,"context_line":"        ODL_WS_NF_OPERATION_TAG \u003d \u0027operation\u0027"},{"line_number":328,"context_line":"        ODL_WS_NF_OPERATION_DELETE \u003d \u0027deleted\u0027"},{"line_number":329,"context_line":"        ODL_WS_NF_OPERATION_CREATE \u003d \u0027created\u0027"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        dn_event \u003d odl_ws_client.OpendaylightWebsocketClient.\\"},{"line_number":332,"context_line":"            get_data_change_event_list(payload)"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_03d34005","line":329,"range":{"start_line":327,"start_character":1,"end_line":329,"end_character":46},"in_reply_to":"fa31d9ce_63e4fc3a","updated":"2017-02-13 12:14:05.000000000","message":"and it needs \"updated\" as well.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"b35246e23b06c32adfd54a8e941df7f77e748672","unresolved":false,"context_lines":[{"line_number":324,"context_line":"    def _process_websocket_notification(self, payload):"},{"line_number":325,"context_line":"        # Callback for websocket notification"},{"line_number":326,"context_line":"        LOG.debug(\"Websocket notification for hostconfig update\")"},{"line_number":327,"context_line":"        ODL_WS_NF_OPERATION_TAG \u003d \u0027operation\u0027"},{"line_number":328,"context_line":"        ODL_WS_NF_OPERATION_DELETE \u003d \u0027deleted\u0027"},{"line_number":329,"context_line":"        ODL_WS_NF_OPERATION_CREATE \u003d \u0027created\u0027"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        dn_event \u003d odl_ws_client.OpendaylightWebsocketClient.\\"},{"line_number":332,"context_line":"            get_data_change_event_list(payload)"}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_888b8667","line":329,"range":{"start_line":327,"start_character":1,"end_line":329,"end_character":46},"in_reply_to":"fa31d9ce_63e4fc3a","updated":"2017-02-23 19:03:09.000000000","message":"or may be in common/constants ?","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f6967d271a7748dda1584616f2a155cf9de3db21","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        ODL_WS_NF_OPERATION_DELETE \u003d \u0027deleted\u0027"},{"line_number":329,"context_line":"        ODL_WS_NF_OPERATION_CREATE \u003d \u0027created\u0027"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        dn_event \u003d odl_ws_client.OpendaylightWebsocketClient.\\"},{"line_number":332,"context_line":"            get_data_change_event_list(payload)"},{"line_number":333,"context_line":"        for item in dn_event:"},{"line_number":334,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_03cc2069","line":331,"updated":"2017-02-13 12:14:05.000000000","message":"nit: shouldn\u0027t this be called dn_events with an \u0027s\u0027 since there are more than one of them?","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"ead1a5904fc463ed538c9c3796579873b7187a61","unresolved":false,"context_lines":[{"line_number":328,"context_line":"        ODL_WS_NF_OPERATION_DELETE \u003d \u0027deleted\u0027"},{"line_number":329,"context_line":"        ODL_WS_NF_OPERATION_CREATE \u003d \u0027created\u0027"},{"line_number":330,"context_line":""},{"line_number":331,"context_line":"        dn_event \u003d odl_ws_client.OpendaylightWebsocketClient.\\"},{"line_number":332,"context_line":"            get_data_change_event_list(payload)"},{"line_number":333,"context_line":"        for item in dn_event:"},{"line_number":334,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_6623ab56","line":331,"in_reply_to":"fa31d9ce_03cc2069","updated":"2017-02-26 01:19:49.000000000","message":"Done","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"f6967d271a7748dda1584616f2a155cf9de3db21","unresolved":false,"context_lines":[{"line_number":334,"context_line":"            try:"},{"line_number":335,"context_line":"                if item[ODL_WS_NF_OPERATION_TAG] \u003d\u003d ODL_WS_NF_OPERATION_DELETE:"},{"line_number":336,"context_line":"                    content \u003d item[\u0027path\u0027]"},{"line_number":337,"context_line":"                    host_id \u003d self._extract_field(content, \"host-id\")"},{"line_number":338,"context_line":"                    host_type \u003d self._extract_field(content, \"host-type\")"},{"line_number":339,"context_line":"                    # TODO(rsood): Add delete from Agent DB"},{"line_number":340,"context_line":"                    if not host_id or not host_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_6355dc1b","line":337,"updated":"2017-02-13 12:14:05.000000000","message":"I think it\u0027s good that get_data_change_event_list is defined in OpendaylightWebsocketClient because everyone who uses the websocket client will need to extract the data change event list. By that same logic, however, I think that _extract_field will also be required by anyone who uses the websocket client. I think convenience method should at a minimum be moved to OpendaylightWebsocketClient. It may also make sense to have a DataChangeEvent class that is returned by get_data_change_event_list that can have an extract_field member.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"ead1a5904fc463ed538c9c3796579873b7187a61","unresolved":false,"context_lines":[{"line_number":334,"context_line":"            try:"},{"line_number":335,"context_line":"                if item[ODL_WS_NF_OPERATION_TAG] \u003d\u003d ODL_WS_NF_OPERATION_DELETE:"},{"line_number":336,"context_line":"                    content \u003d item[\u0027path\u0027]"},{"line_number":337,"context_line":"                    host_id \u003d self._extract_field(content, \"host-id\")"},{"line_number":338,"context_line":"                    host_type \u003d self._extract_field(content, \"host-type\")"},{"line_number":339,"context_line":"                    # TODO(rsood): Add delete from Agent DB"},{"line_number":340,"context_line":"                    if not host_id or not host_type:"}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_c6fd37b2","line":337,"in_reply_to":"fa31d9ce_6355dc1b","updated":"2017-02-26 01:19:49.000000000","message":"Done","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"69193ca2a5202270178d542c66d6f07d4a5c185b","unresolved":false,"context_lines":[{"line_number":340,"context_line":"                    if not host_id or not host_type:"},{"line_number":341,"context_line":"                        LOG.warning(_LW(\"Invalid delete notification\"))"},{"line_number":342,"context_line":"                        continue"},{"line_number":343,"context_line":"                if item[ODL_WS_NF_OPERATION_TAG] \u003d\u003d ODL_WS_NF_OPERATION_CREATE:"},{"line_number":344,"context_line":"                    if \u0027hostconfig\u0027 in item[\u0027data\u0027]:"},{"line_number":345,"context_line":"                        hostconfig \u003d item[\u0027data\u0027][\u0027hostconfig\u0027]"},{"line_number":346,"context_line":"                        self._old_agents \u003d self._known_agents"}],"source_content_type":"text/x-python","patch_set":8,"id":"fa31d9ce_2da2a7fd","line":343,"range":{"start_line":343,"start_character":52,"end_line":343,"end_character":78},"updated":"2017-02-14 18:40:10.000000000","message":"the same following logic will do in UPDATE case.","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":20208,"name":"Ritu Sood","email":"ritu.sood@intel.com","username":"rsood"},"change_message_id":"ead1a5904fc463ed538c9c3796579873b7187a61","unresolved":false,"context_lines":[{"line_number":340,"context_line":"                    if not host_id or not host_type:"},{"line_number":341,"context_line":"                        LOG.warning(_LW(\"Invalid delete notification\"))"},{"line_number":342,"context_line":"                        continue"},{"line_number":343,"context_line":"                if item[ODL_WS_NF_OPERATION_TAG] \u003d\u003d ODL_WS_NF_OPERATION_CREATE:"},{"line_number":344,"context_line":"                    if \u0027hostconfig\u0027 in item[\u0027data\u0027]:"},{"line_number":345,"context_line":"                        hostconfig \u003d item[\u0027data\u0027][\u0027hostconfig\u0027]"},{"line_number":346,"context_line":"                        self._old_agents \u003d self._known_agents"}],"source_content_type":"text/x-python","patch_set":8,"id":"da36d5c6_46286733","line":343,"range":{"start_line":343,"start_character":52,"end_line":343,"end_character":78},"in_reply_to":"fa31d9ce_2da2a7fd","updated":"2017-02-26 01:19:49.000000000","message":"Ignoring update case for hostconfig. Any change in configuration is treated as \"create\" also. Update is only for already existing configurations","commit_id":"c91a49d408610fb69c71f1a45bce901235b52ba5"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"2f24a5b9e80fb13667340ffb3341ae10f50f7c19","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            return"},{"line_number":183,"context_line":"        try:"},{"line_number":184,"context_line":"            agentdb_row \u003d self._AGENTDB_ROW.copy()"},{"line_number":185,"context_line":"            agent_type \u003d host_type"},{"line_number":186,"context_line":"            agentdb_row[\u0027host\u0027] \u003d host_id"},{"line_number":187,"context_line":"            agentdb_row[\u0027agent_type\u0027] \u003d agent_type"},{"line_number":188,"context_line":"            agentdb_row[\u0027configurations\u0027] \u003d jsonutils.loads(config)"}],"source_content_type":"text/x-python","patch_set":9,"id":"da36d5c6_b6192325","line":185,"range":{"start_line":185,"start_character":12,"end_line":185,"end_character":34},"updated":"2017-02-28 02:59:55.000000000","message":"This line seems useless. We can opencode at line 187 and line 193.","commit_id":"ac1355b8e3c4bf181ff68e1522b0f8ecb7af0c4f"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":350,"context_line":"                                                   hostconfig[\u0027host-type\u0027],"},{"line_number":351,"context_line":"                                                   hostconfig[\u0027config\u0027])"},{"line_number":352,"context_line":"            except KeyError:"},{"line_number":353,"context_line":"                LOG.warning(_LW(\"Invalid JSON for websocket notification\"))"},{"line_number":354,"context_line":"                continue"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    def _process_websocket_reconnect(self):"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_83203b9d","line":353,"range":{"start_line":353,"start_character":16,"end_line":353,"end_character":75},"updated":"2017-03-07 23:50:54.000000000","message":"Can you please include the content of the event for debug?","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"52fda5f813c9448234b4bc3d761bf35eb11cdcc4","unresolved":false,"context_lines":[{"line_number":353,"context_line":"                LOG.warning(_LW(\"Invalid JSON for websocket notification\"))"},{"line_number":354,"context_line":"                continue"},{"line_number":355,"context_line":""},{"line_number":356,"context_line":"    def _process_websocket_reconnect(self):"},{"line_number":357,"context_line":"        # Get hostconfig data using restconf"},{"line_number":358,"context_line":"        LOG.debug(\"Websocket notification on reconnection\")"},{"line_number":359,"context_line":"        self._get_and_update_hostconfigs()"}],"source_content_type":"text/x-python","patch_set":14,"id":"9a30ddce_6836c404","line":356,"range":{"start_line":356,"start_character":8,"end_line":356,"end_character":36},"updated":"2017-03-07 23:50:54.000000000","message":"Although this causes race condition, I don\u0027t see a good way to solve this with the current odl netconf.\nCan you please add comment on race condition and future TODO to track the issue?","commit_id":"a7111464b740ac4e6f761e186d7a2b000a7c64a1"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"505ce1f0baead10bb65a78612cd06e4c949ca0d3","unresolved":false,"context_lines":[{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        # extract ODL_IP and ODL_PORT from ODL_ENDPOINT"},{"line_number":103,"context_line":"        # urlsplit and urlunparse don\u0027t throw exceptions"},{"line_number":104,"context_line":"        purl \u003d urlparse.urlsplit(odl_url)"},{"line_number":105,"context_line":"        return urlparse.urlunparse((purl.scheme, purl.netloc,"},{"line_number":106,"context_line":"                                    \u0027\u0027, \u0027\u0027, \u0027\u0027, \u0027\u0027))"},{"line_number":107,"context_line":""},{"line_number":108,"context_line":"    def _start_maintenance_thread(self, poll_interval):"},{"line_number":109,"context_line":"        self._mainth \u003d mt.MaintenanceThread()"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a30ddce_6253dc6b","line":106,"range":{"start_line":104,"start_character":0,"end_line":106,"end_character":52},"updated":"2017-03-10 03:22:26.000000000","message":"maybe it would make sense to introduce helper method instead of repeating two lines.","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"505ce1f0baead10bb65a78612cd06e4c949ca0d3","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        try:"},{"line_number":203,"context_line":"            filters \u003d {\u0027agent_type\u0027: [host_type],"},{"line_number":204,"context_line":"                       \u0027host\u0027: [host_id]}"},{"line_number":205,"context_line":"            agent \u003d agents_db.get_agents_db("},{"line_number":206,"context_line":"                context.get_admin_context(), filters\u003dfilters)"},{"line_number":207,"context_line":"            if not agent:"},{"line_number":208,"context_line":"                return"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a30ddce_c2ef2885","line":205,"range":{"start_line":205,"start_character":30,"end_line":205,"end_character":43},"updated":"2017-03-10 03:22:26.000000000","message":"get_agent() can be used.","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"505ce1f0baead10bb65a78612cd06e4c949ca0d3","unresolved":false,"context_lines":[{"line_number":202,"context_line":"        try:"},{"line_number":203,"context_line":"            filters \u003d {\u0027agent_type\u0027: [host_type],"},{"line_number":204,"context_line":"                       \u0027host\u0027: [host_id]}"},{"line_number":205,"context_line":"            agent \u003d agents_db.get_agents_db("},{"line_number":206,"context_line":"                context.get_admin_context(), filters\u003dfilters)"},{"line_number":207,"context_line":"            if not agent:"},{"line_number":208,"context_line":"                return"},{"line_number":209,"context_line":""},{"line_number":210,"context_line":"            LOG.debug(\"Deleting Agent with Agent id: %s\", agent[0][\u0027id\u0027])"},{"line_number":211,"context_line":"            agents_db.delete_agent(context.get_admin_context(), agent[0][\u0027id\u0027])"}],"source_content_type":"text/x-python","patch_set":16,"id":"9a30ddce_22eba479","line":208,"range":{"start_line":205,"start_character":0,"end_line":208,"end_character":22},"updated":"2017-03-10 03:22:26.000000000","message":"Can we just unconditionally delete agent?","commit_id":"9565a5538ea1ba26f14e929df0deef8aed784038"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"c7152fea72f43230c071629134e7b7391103dc65","unresolved":false,"context_lines":[{"line_number":173,"context_line":"                                       host_config[\u0027host-type\u0027],"},{"line_number":174,"context_line":"                                       host_config[\u0027config\u0027])"},{"line_number":175,"context_line":""},{"line_number":176,"context_line":"    def _update_agents_db_row(self, host_id, host_type, config):"},{"line_number":177,"context_line":"        # Update one row in agent db"},{"line_number":178,"context_line":"        agents_db \u003d self._get_neutron_db_plugin()"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_0bfcb36d","line":176,"range":{"start_line":176,"start_character":36,"end_line":176,"end_character":62},"updated":"2017-04-12 17:57:07.000000000","message":"host_config can be passed. so that line 172-175 and line 358-360 can be simplified.","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"c7152fea72f43230c071629134e7b7391103dc65","unresolved":false,"context_lines":[{"line_number":209,"context_line":""},{"line_number":210,"context_line":"            LOG.debug(\"Deleting Agent with Agent id: %s\", agent[0][\u0027id\u0027])"},{"line_number":211,"context_line":"            agents_db.delete_agent(context.get_admin_context(), agent[0][\u0027id\u0027])"},{"line_number":212,"context_line":"            self._known_agents.remove((host_id, host_type))"},{"line_number":213,"context_line":"        except Exception:"},{"line_number":214,"context_line":"            LOG.exception(_LE(\"Unable to delete from agentdb.\"))"},{"line_number":215,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_2b1097ff","line":212,"range":{"start_line":212,"start_character":31,"end_line":212,"end_character":37},"updated":"2017-04-12 17:57:07.000000000","message":"remove() may cause exception.\ndiscard()?","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"c7152fea72f43230c071629134e7b7391103dc65","unresolved":false,"context_lines":[{"line_number":350,"context_line":"                    if not host_id or not host_type:"},{"line_number":351,"context_line":"                        LOG.warning(_LW(\"Invalid delete notification\"))"},{"line_number":352,"context_line":"                        continue"},{"line_number":353,"context_line":"                    self._delete_agents_db_row(host_id[1:-1], host_type[1:-1])"},{"line_number":354,"context_line":"                if operation \u003d\u003d event.OPERATION_CREATE:"},{"line_number":355,"context_line":"                    if \u0027hostconfig\u0027 in data:"},{"line_number":356,"context_line":"                        hostconfig \u003d data[\u0027hostconfig\u0027]"}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_eb9f4f4d","line":353,"range":{"start_line":353,"start_character":54,"end_line":353,"end_character":60},"updated":"2017-04-12 17:57:07.000000000","message":"Is this for removing surrounding quotation or something?\nIf so, strip() is suitable.","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"c7152fea72f43230c071629134e7b7391103dc65","unresolved":false,"context_lines":[{"line_number":351,"context_line":"                        LOG.warning(_LW(\"Invalid delete notification\"))"},{"line_number":352,"context_line":"                        continue"},{"line_number":353,"context_line":"                    self._delete_agents_db_row(host_id[1:-1], host_type[1:-1])"},{"line_number":354,"context_line":"                if operation \u003d\u003d event.OPERATION_CREATE:"},{"line_number":355,"context_line":"                    if \u0027hostconfig\u0027 in data:"},{"line_number":356,"context_line":"                        hostconfig \u003d data[\u0027hostconfig\u0027]"},{"line_number":357,"context_line":"                        self._old_agents \u003d self._known_agents"}],"source_content_type":"text/x-python","patch_set":21,"id":"bff0334d_4bb4fbf1","line":354,"range":{"start_line":354,"start_character":16,"end_line":354,"end_character":18},"updated":"2017-04-12 17:57:07.000000000","message":"elif","commit_id":"c09c7ac02f26c12508442c41f78d9856659f1f42"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ff765143d92538ab74c6b1bfc540b5db0e3b5120","unresolved":false,"context_lines":[{"line_number":357,"context_line":"                        self._old_agents \u003d self._known_agents"},{"line_number":358,"context_line":"                        self._update_agents_db_row(hostconfig)"},{"line_number":359,"context_line":"            except KeyError:"},{"line_number":360,"context_line":"                LOG.warning(\"Invalid JSON for websocket notification\")"},{"line_number":361,"context_line":"                continue"},{"line_number":362,"context_line":""},{"line_number":363,"context_line":"    def _process_websocket_reconnect(self, status):"}],"source_content_type":"text/x-python","patch_set":24,"id":"5ff73747_8d47db77","line":360,"range":{"start_line":360,"start_character":16,"end_line":360,"end_character":70},"updated":"2017-04-29 06:36:59.000000000","message":"Please record exception to show what key caused this exception.","commit_id":"415ed78841e01cc4c4c3b8d1f1ae35e01fd47dfe"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"f8ba4de7f4e72bd5094cfcc9bc973a6c0efbc1c1","unresolved":false,"context_lines":[{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def _update_agents_db_row(self, host_config):"},{"line_number":173,"context_line":"        # Update one row in agent db"},{"line_number":174,"context_line":"        agents_db \u003d self._get_neutron_db_plugin()"},{"line_number":175,"context_line":"        if not agents_db:  # if ML2 is still initializing"},{"line_number":176,"context_line":"            LOG.error(\"ML2 still initializing, Missed an update\")"},{"line_number":177,"context_line":"            return"},{"line_number":178,"context_line":"        host_id \u003d host_config[\u0027host-id\u0027]"},{"line_number":179,"context_line":"        host_type \u003d host_config[\u0027host-type\u0027]"},{"line_number":180,"context_line":"        config \u003d host_config[\u0027config\u0027]"}],"source_content_type":"text/x-python","patch_set":30,"id":"5ff73747_8692eb4a","line":177,"range":{"start_line":174,"start_character":0,"end_line":177,"end_character":18},"updated":"2017-05-02 15:11:37.000000000","message":"registry callback with PROCESS, AFTER_INIT can be used.\nIt can be addressed by follow up patches.\nMaybe worker can be utilized.","commit_id":"05adb97dc20c3bd150de8b6e2d4493a3ffec5e52"}],"networking_odl/tests/unit/common/test_websocket_client.py":[{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"d6d68dd8bad4678bf2cbed8ea9d757b3cf3be93a","unresolved":false,"context_lines":[{"line_number":249,"context_line":"                           [wsc.EventDataParser.DC_EVENT_TAG])"},{"line_number":250,"context_line":"        event_0 \u003d expected_events[0]"},{"line_number":251,"context_line":"        event \u003d wsc.EventDataParser.get_item(self.sample_port_status_payload)"},{"line_number":252,"context_line":"        operation, path, data \u003d event.next().get_fields()"},{"line_number":253,"context_line":""},{"line_number":254,"context_line":"        self.assertEqual(operation, event_0.get(\u0027operation\u0027))"},{"line_number":255,"context_line":"        self.assertEqual(path, event_0.get(\u0027path\u0027))"}],"source_content_type":"text/x-python","patch_set":23,"id":"5ff73747_1fe9dab5","line":252,"range":{"start_line":252,"start_character":32,"end_line":252,"end_character":44},"updated":"2017-04-28 00:45:50.000000000","message":"next(event) for python3.","commit_id":"796abca2d45be86058ae489edf0f71f3be260ac3"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ff765143d92538ab74c6b1bfc540b5db0e3b5120","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":14,"context_line":"#    under the License."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"import mock"},{"line_number":17,"context_line":"from networking_odl.common import websocket_client as wsc"},{"line_number":18,"context_line":"from networking_odl.common.client import OpenDaylightRestClient as odl_client"},{"line_number":19,"context_line":"from networking_odl.tests import base"},{"line_number":20,"context_line":"from oslo_config import cfg"},{"line_number":21,"context_line":"from oslo_serialization import jsonutils"},{"line_number":22,"context_line":"import requests"},{"line_number":23,"context_line":"from requests.exceptions import HTTPError"},{"line_number":24,"context_line":"import websocket"},{"line_number":25,"context_line":""},{"line_number":26,"context_line":""},{"line_number":27,"context_line":"class TestWebsocketClient(base.DietTestCase):"}],"source_content_type":"text/x-python","patch_set":24,"id":"5ff73747_2d58c753","line":24,"range":{"start_line":16,"start_character":0,"end_line":24,"end_character":16},"updated":"2017-04-29 06:36:59.000000000","message":"please follow pep8 order.","commit_id":"415ed78841e01cc4c4c3b8d1f1ae35e01fd47dfe"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"ff765143d92538ab74c6b1bfc540b5db0e3b5120","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        self.mgr.run_websocket_thread(True)"},{"line_number":189,"context_line":"        self.assertEqual(1, TestWebsocketClient.CALLBACK_COUNT)"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def _test_handler(self, payload, first_connection):"},{"line_number":192,"context_line":"        TestWebsocketClient.CALLBACK_COUNT +\u003d 1"},{"line_number":193,"context_line":"        return None"},{"line_number":194,"context_line":""},{"line_number":195,"context_line":""},{"line_number":196,"context_line":"class TestEventDataParser(base.DietTestCase):"}],"source_content_type":"text/x-python","patch_set":24,"id":"5ff73747_ed33ff12","line":193,"range":{"start_line":191,"start_character":0,"end_line":193,"end_character":19},"updated":"2017-04-29 06:36:59.000000000","message":"Mock object can be created by setUp() method.\nand assert_called_once() can be used.","commit_id":"415ed78841e01cc4c4c3b8d1f1ae35e01fd47dfe"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"f8ba4de7f4e72bd5094cfcc9bc973a6c0efbc1c1","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                self.status_code \u003d status_code"},{"line_number":70,"context_line":"                self.response \u003d self"},{"line_number":71,"context_line":""},{"line_number":72,"context_line":"        class MockResponse(object):"},{"line_number":73,"context_line":"            def __init__(self, json_data, status_code):"},{"line_number":74,"context_line":"                self.raise_obj \u003d MockHTTPError(json_data, status_code)"},{"line_number":75,"context_line":""},{"line_number":76,"context_line":"            def raise_for_status(self):"},{"line_number":77,"context_line":"                raise self.raise_obj"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        return MockResponse(json_data, status_code)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    _status_code_msgs \u003d {"},{"line_number":82,"context_line":"        200: \u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":30,"id":"5ff73747_e62c0fae","line":79,"range":{"start_line":72,"start_character":0,"end_line":79,"end_character":51},"updated":"2017-05-02 15:11:37.000000000","message":"Can Response be used instead of mock?","commit_id":"05adb97dc20c3bd150de8b6e2d4493a3ffec5e52"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"f8ba4de7f4e72bd5094cfcc9bc973a6c0efbc1c1","unresolved":false,"context_lines":[{"line_number":78,"context_line":""},{"line_number":79,"context_line":"        return MockResponse(json_data, status_code)"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"    _status_code_msgs \u003d {"},{"line_number":82,"context_line":"        200: \u0027\u0027,"},{"line_number":83,"context_line":"        201: \u0027\u0027,"},{"line_number":84,"context_line":"        204: \u0027\u0027,"}],"source_content_type":"text/x-python","patch_set":30,"id":"5ff73747_063a5b33","line":81,"range":{"start_line":81,"start_character":3,"end_line":81,"end_character":25},"updated":"2017-05-02 15:11:37.000000000","message":"Is this stolen from requests.status_codes?\nIf so, it can be directly used.","commit_id":"05adb97dc20c3bd150de8b6e2d4493a3ffec5e52"},{"author":{"_account_id":333,"name":"Isaku Yamahata","email":"isaku.yamahata@gmail.com","username":"yamahata"},"change_message_id":"1e8a25a96df8cc515a57baedba0939da29b926ae","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        event \u003d wsc.EventDataParser.get_item(self.sample_port_status_payload)"},{"line_number":223,"context_line":"        operation, path, data \u003d next(event).get_fields()"},{"line_number":224,"context_line":""},{"line_number":225,"context_line":"        self.assertEqual(operation, event_0.get(\u0027operation\u0027))"},{"line_number":226,"context_line":"        self.assertEqual(path, event_0.get(\u0027path\u0027))"},{"line_number":227,"context_line":"        self.assertEqual(data, event_0.get(\u0027data\u0027))"},{"line_number":228,"context_line":""}],"source_content_type":"text/x-python","patch_set":31,"id":"3f044301_ab836004","line":225,"range":{"start_line":225,"start_character":25,"end_line":225,"end_character":60},"updated":"2017-05-04 13:35:56.000000000","message":"The order is\n(expected, observed)\n\nsame below.","commit_id":"41743cfc867b6dadf629a22a2033a7e61b977dba"},{"author":{"_account_id":17120,"name":"Manjeet Singh Bhatia","email":"manjeet.s.bhatia@intel.com","username":"manjeets"},"change_message_id":"b73e640cd90d5bf480add9e5c61e3435e21069cb","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":32,"id":"3f044301_3d77843d","line":1,"range":{"start_line":1,"start_character":16,"end_line":1,"end_character":20},"updated":"2017-05-04 20:42:37.000000000","message":"2017","commit_id":"e28e759a197520906f8b4e037b0b69ab92b2102b"}],"releasenotes/notes/websocket-client-7c8117671aeea181.yaml":[{"author":{"_account_id":22380,"name":"Josh Hershberg","email":"jhershbe@redhat.com","username":"jhershbe"},"change_message_id":"cbc0228382b6aaa3952f4754c952c63081cf3a60","unresolved":false,"context_lines":[{"line_number":6,"context_line":"  - Features include callback on new notifications"},{"line_number":7,"context_line":"    and callback on reconnection which includes"},{"line_number":8,"context_line":"    status information."},{"line_number":9,"context_line":"issues:"},{"line_number":10,"context_line":"  - Race conditions possible between websocket"},{"line_number":11,"context_line":"    notifications and data retrieved using"},{"line_number":12,"context_line":"    restconf during reconnection."}],"source_content_type":"text/x-yaml","patch_set":35,"id":"3f044301_f39fc400","line":9,"updated":"2017-05-09 09:41:24.000000000","message":"Personally, I don\u0027t think this is a limitation of *this* code. Whether or not the user of the websocket client you provide here decides to use rest after a reconnect is not your problem here, IMHO. This should be noted in the port status gerrits and is (in comments in the code, IIRC). IMHO, this part can be omitted from this review.","commit_id":"60d745bb94b85e4f04157d5f60569a7a85c72cab"}]}
