)]}'
{"nova/network/neutronv2/api.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a0239194a43abd0a168893775501631e3282737d","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    session \u003d _get_session()"},{"line_number":224,"context_line":"    client \u003d utils.get_ksa_adapter("},{"line_number":225,"context_line":"        \u0027network\u0027, ksa_auth\u003dauth_plugin, ksa_session\u003dsession)"},{"line_number":226,"context_line":"    client.global_request_id \u003d context.global_id"},{"line_number":227,"context_line":"    client.additional_headers \u003d {\u0027accept\u0027: \u0027application/json\u0027}"},{"line_number":228,"context_line":"    return client"},{"line_number":229,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fb8cfa7_786f56c5","line":226,"updated":"2019-06-03 15:56:16.000000000","message":"This should work:\n\nhttps://github.com/openstack/keystoneauth/blob/bde07bc95b5b5d16b829f72be7aaa62fab9d716a/keystoneauth1/adapter.py#L70\n\nI\u0027m not sure if Eric would prefer that we add a global_request_id kwarg to utils.get_ksa_adapter so we can pass it through to KSA directly when initializing the Adapter object.\n\nAlso note that this will be on every request using this Adapter, unlike how the SchedulerReportClient get/put/post/delete methods add a per-request header rather than on the client init, but this is probably OK given the short-term lifespan of this adapter for per-operation usage in the neutron client code.","commit_id":"1a48679c3066ec12376e6eced788d309d312bdd2"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"98ff231c33da4de4a6d86cb55454ad5e8fbb2f2a","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    session \u003d _get_session()"},{"line_number":224,"context_line":"    client \u003d utils.get_ksa_adapter("},{"line_number":225,"context_line":"        \u0027network\u0027, ksa_auth\u003dauth_plugin, ksa_session\u003dsession,"},{"line_number":226,"context_line":"        global_request_id\u003dcontext.global_id)"},{"line_number":227,"context_line":"    client.additional_headers \u003d {\u0027accept\u0027: \u0027application/json\u0027}"},{"line_number":228,"context_line":"    return client"},{"line_number":229,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_06384fd1","line":226,"updated":"2019-07-04 07:08:03.000000000","message":"Note: this kind of approach would not do the right thing if a ksa adapter were instantiated once and reused for multiple separate requests across the lifetime of a nova service. I realize that\u0027s not what\u0027s happening in this file, but I do wonder, in general, whether a change to utils.get_ksa_adapter to save away a request_id is the way to go.\n\nBecause I\u0027m not so well-versed in our usage of ksa adapters, I won\u0027t vote on this patch, but I\u0027m interested to hear what peeps with more expertise think.","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"35e4d29c4416e314412386248fd55f0a023c10ba","unresolved":false,"context_lines":[{"line_number":223,"context_line":"    session \u003d _get_session()"},{"line_number":224,"context_line":"    client \u003d utils.get_ksa_adapter("},{"line_number":225,"context_line":"        \u0027network\u0027, ksa_auth\u003dauth_plugin, ksa_session\u003dsession,"},{"line_number":226,"context_line":"        global_request_id\u003dcontext.global_id)"},{"line_number":227,"context_line":"    client.additional_headers \u003d {\u0027accept\u0027: \u0027application/json\u0027}"},{"line_number":228,"context_line":"    return client"},{"line_number":229,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_55cbfa1c","line":226,"in_reply_to":"7faddb67_06384fd1","updated":"2019-07-10 13:51:07.000000000","message":"Good call, Melanie.\n\nIn this case it happens to work because, for neutron, we get a fresh Adapter for every call. But adding global_request_id to get_ksa_adapter sets a bad precedent for other usages where we do reuse the same Adapter across multiple unrelated requests.\n\nThe right thing is to pass global_request_id into the Adapter REST methods...","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"35e4d29c4416e314412386248fd55f0a023c10ba","unresolved":false,"context_lines":[{"line_number":1325,"context_line":"                {\u0027binding\u0027: {\u0027host\u0027: \u0027dest.host.com\u0027}}"},{"line_number":1326,"context_line":"        :return: requests.Response object"},{"line_number":1327,"context_line":"        \"\"\""},{"line_number":1328,"context_line":"        return client.post(\u0027/v2.0/ports/%s/bindings\u0027 % port_id,"},{"line_number":1329,"context_line":"                           json\u003ddata, raise_exc\u003dFalse)"},{"line_number":1330,"context_line":""},{"line_number":1331,"context_line":"    def delete_port_binding(self, context, port_id, host):"},{"line_number":1332,"context_line":"        \"\"\"Delete the port binding for the given port ID and host"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_f59f8600","line":1329,"range":{"start_line":1328,"start_character":0,"end_line":1329,"end_character":54},"updated":"2019-07-10 13:51:07.000000000","message":"...here, ...","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"eef548eb83fe0f2b3fb5f52561dea462312f58c8","unresolved":false,"context_lines":[{"line_number":1325,"context_line":"                {\u0027binding\u0027: {\u0027host\u0027: \u0027dest.host.com\u0027}}"},{"line_number":1326,"context_line":"        :return: requests.Response object"},{"line_number":1327,"context_line":"        \"\"\""},{"line_number":1328,"context_line":"        return client.post(\u0027/v2.0/ports/%s/bindings\u0027 % port_id,"},{"line_number":1329,"context_line":"                           json\u003ddata, raise_exc\u003dFalse)"},{"line_number":1330,"context_line":""},{"line_number":1331,"context_line":"    def delete_port_binding(self, context, port_id, host):"},{"line_number":1332,"context_line":"        \"\"\"Delete the port binding for the given port ID and host"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_0990fb42","line":1329,"range":{"start_line":1328,"start_character":0,"end_line":1329,"end_character":54},"in_reply_to":"7faddb67_f59f8600","updated":"2019-07-11 09:04:17.000000000","message":"Done","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"35e4d29c4416e314412386248fd55f0a023c10ba","unresolved":false,"context_lines":[{"line_number":1366,"context_line":"        :param host: A string name of the host on which the port is bound"},{"line_number":1367,"context_line":"        :return: requests.Response object"},{"line_number":1368,"context_line":"        \"\"\""},{"line_number":1369,"context_line":"        return client.delete(\u0027/v2.0/ports/%s/bindings/%s\u0027 % (port_id, host),"},{"line_number":1370,"context_line":"                             raise_exc\u003dFalse)"},{"line_number":1371,"context_line":""},{"line_number":1372,"context_line":"    def activate_port_binding(self, context, port_id, host):"},{"line_number":1373,"context_line":"        \"\"\"Activates an inactive port binding."}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_958e52ce","line":1370,"range":{"start_line":1369,"start_character":0,"end_line":1370,"end_character":45},"updated":"2019-07-10 13:51:07.000000000","message":"...here, ...","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"eef548eb83fe0f2b3fb5f52561dea462312f58c8","unresolved":false,"context_lines":[{"line_number":1366,"context_line":"        :param host: A string name of the host on which the port is bound"},{"line_number":1367,"context_line":"        :return: requests.Response object"},{"line_number":1368,"context_line":"        \"\"\""},{"line_number":1369,"context_line":"        return client.delete(\u0027/v2.0/ports/%s/bindings/%s\u0027 % (port_id, host),"},{"line_number":1370,"context_line":"                             raise_exc\u003dFalse)"},{"line_number":1371,"context_line":""},{"line_number":1372,"context_line":"    def activate_port_binding(self, context, port_id, host):"},{"line_number":1373,"context_line":"        \"\"\"Activates an inactive port binding."}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_29937751","line":1370,"range":{"start_line":1369,"start_character":0,"end_line":1370,"end_character":45},"in_reply_to":"7faddb67_958e52ce","updated":"2019-07-11 09:04:17.000000000","message":"Done","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"35e4d29c4416e314412386248fd55f0a023c10ba","unresolved":false,"context_lines":[{"line_number":1386,"context_line":"        client \u003d _get_ksa_client(context, admin\u003dTrue)"},{"line_number":1387,"context_line":"        # This is a bit weird in that we don\u0027t PUT and update the status"},{"line_number":1388,"context_line":"        # to ACTIVE, it\u0027s more like a POST action method in the compute API."},{"line_number":1389,"context_line":"        resp \u003d client.put("},{"line_number":1390,"context_line":"            \u0027/v2.0/ports/%s/bindings/%s/activate\u0027 % (port_id, host),"},{"line_number":1391,"context_line":"            raise_exc\u003dFalse)"},{"line_number":1392,"context_line":"        if resp:"},{"line_number":1393,"context_line":"            LOG.debug(\u0027Activated binding for port %s and host %s.\u0027,"},{"line_number":1394,"context_line":"                      port_id, host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_95f9724e","line":1391,"range":{"start_line":1389,"start_character":0,"end_line":1391,"end_character":28},"updated":"2019-07-10 13:51:07.000000000","message":"...here, ...","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"eef548eb83fe0f2b3fb5f52561dea462312f58c8","unresolved":false,"context_lines":[{"line_number":1386,"context_line":"        client \u003d _get_ksa_client(context, admin\u003dTrue)"},{"line_number":1387,"context_line":"        # This is a bit weird in that we don\u0027t PUT and update the status"},{"line_number":1388,"context_line":"        # to ACTIVE, it\u0027s more like a POST action method in the compute API."},{"line_number":1389,"context_line":"        resp \u003d client.put("},{"line_number":1390,"context_line":"            \u0027/v2.0/ports/%s/bindings/%s/activate\u0027 % (port_id, host),"},{"line_number":1391,"context_line":"            raise_exc\u003dFalse)"},{"line_number":1392,"context_line":"        if resp:"},{"line_number":1393,"context_line":"            LOG.debug(\u0027Activated binding for port %s and host %s.\u0027,"},{"line_number":1394,"context_line":"                      port_id, host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_c999836e","line":1391,"range":{"start_line":1389,"start_character":0,"end_line":1391,"end_character":28},"in_reply_to":"7faddb67_95f9724e","updated":"2019-07-11 09:04:17.000000000","message":"Done","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"35e4d29c4416e314412386248fd55f0a023c10ba","unresolved":false,"context_lines":[{"line_number":2694,"context_line":"            # Not all compute migration flows use the port binding-extended"},{"line_number":2695,"context_line":"            # API yet, so first check to see if there is a binding for the"},{"line_number":2696,"context_line":"            # port and destination host."},{"line_number":2697,"context_line":"            resp \u003d client.get(\u0027/v2.0/ports/%s/bindings/%s\u0027 %"},{"line_number":2698,"context_line":"                              (vif[\u0027id\u0027], dest_host), raise_exc\u003dFalse)"},{"line_number":2699,"context_line":"            if resp:"},{"line_number":2700,"context_line":"                if resp.json()[\u0027binding\u0027][\u0027status\u0027] !\u003d \u0027ACTIVE\u0027:"},{"line_number":2701,"context_line":"                    self.activate_port_binding(context, vif[\u0027id\u0027], dest_host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_75acf633","line":2698,"range":{"start_line":2697,"start_character":0,"end_line":2698,"end_character":70},"updated":"2019-07-10 13:51:07.000000000","message":"...and here.\n\n...or if that\u0027s really distasteful to you, you could do what you had originally in PS2 and explicitly set client.global_request_id after you\u0027ve instantiated it. If you do that, it should be with a comment stating a) why that\u0027s okay in this case (each usage gets a fresh Adapter); and b) that it needs to be changed if we ever decide to cache/singleton the Adapter.","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"eef548eb83fe0f2b3fb5f52561dea462312f58c8","unresolved":false,"context_lines":[{"line_number":2694,"context_line":"            # Not all compute migration flows use the port binding-extended"},{"line_number":2695,"context_line":"            # API yet, so first check to see if there is a binding for the"},{"line_number":2696,"context_line":"            # port and destination host."},{"line_number":2697,"context_line":"            resp \u003d client.get(\u0027/v2.0/ports/%s/bindings/%s\u0027 %"},{"line_number":2698,"context_line":"                              (vif[\u0027id\u0027], dest_host), raise_exc\u003dFalse)"},{"line_number":2699,"context_line":"            if resp:"},{"line_number":2700,"context_line":"                if resp.json()[\u0027binding\u0027][\u0027status\u0027] !\u003d \u0027ACTIVE\u0027:"},{"line_number":2701,"context_line":"                    self.activate_port_binding(context, vif[\u0027id\u0027], dest_host)"}],"source_content_type":"text/x-python","patch_set":6,"id":"7faddb67_a99e8751","line":2698,"range":{"start_line":2697,"start_character":0,"end_line":2698,"end_character":70},"in_reply_to":"7faddb67_75acf633","updated":"2019-07-11 09:04:17.000000000","message":"Done","commit_id":"bb3607bc0ee0ef295e7581fd6316c7f65ed59746"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a9c4c0fa3cce38c00e42b82281b03a526cb23be4","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"                {\u0027binding\u0027: {\u0027host\u0027: \u0027dest.host.com\u0027}}"},{"line_number":1327,"context_line":"        :return: requests.Response object"},{"line_number":1328,"context_line":"        \"\"\""},{"line_number":1329,"context_line":"        return client.post("},{"line_number":1330,"context_line":"            \u0027/v2.0/ports/%s/bindings\u0027 % port_id, json\u003ddata, raise_exc\u003dFalse,"},{"line_number":1331,"context_line":"            headers\u003d{request_id.INBOUND_HEADER: context.global_id})"},{"line_number":1332,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_cfb983e9","line":1329,"range":{"start_line":1329,"start_character":22,"end_line":1329,"end_character":26},"updated":"2019-07-11 10:49:22.000000000","message":"Groan, I thought these methods had a global_request_id kwarg, but I was confusing them with the shims we have for placement.\n\n/me goes on crusade to add global_request_id to Adapter primitives...","commit_id":"451400bef913c3d8cf9ad2bdfae947b6150471c5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"60e38c1b5bfeca94c5f72a5ddf6b9dd624e4464a","unresolved":false,"context_lines":[{"line_number":1326,"context_line":"                {\u0027binding\u0027: {\u0027host\u0027: \u0027dest.host.com\u0027}}"},{"line_number":1327,"context_line":"        :return: requests.Response object"},{"line_number":1328,"context_line":"        \"\"\""},{"line_number":1329,"context_line":"        return client.post("},{"line_number":1330,"context_line":"            \u0027/v2.0/ports/%s/bindings\u0027 % port_id, json\u003ddata, raise_exc\u003dFalse,"},{"line_number":1331,"context_line":"            headers\u003d{request_id.INBOUND_HEADER: context.global_id})"},{"line_number":1332,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_60ddf96e","line":1329,"range":{"start_line":1329,"start_character":22,"end_line":1329,"end_character":26},"in_reply_to":"7faddb67_cfb983e9","updated":"2019-07-11 16:00:08.000000000","message":"I have proposed [1] in ksa. Once that lands and is released, we can fix up these as well as the placement shims.\n\n[1] https://review.opendev.org/670341","commit_id":"451400bef913c3d8cf9ad2bdfae947b6150471c5"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"a9c4c0fa3cce38c00e42b82281b03a526cb23be4","unresolved":false,"context_lines":[{"line_number":246,"context_line":"        client.additional_headers \u003d {\u0027accept\u0027: \u0027application/json\u0027}"},{"line_number":247,"context_line":"        return client"},{"line_number":248,"context_line":""},{"line_number":249,"context_line":"    def get(self, url, version\u003dNone, global_request_id\u003dNone):"},{"line_number":250,"context_line":"        headers \u003d ({request_id.INBOUND_HEADER: global_request_id}"},{"line_number":251,"context_line":"                   if global_request_id else {})"},{"line_number":252,"context_line":"        return self._client.get(url, microversion\u003dversion, headers\u003dheaders)"}],"source_content_type":"text/x-python","patch_set":7,"id":"7faddb67_4f691389","line":249,"range":{"start_line":249,"start_character":37,"end_line":249,"end_character":54},"updated":"2019-07-11 10:49:22.000000000","message":"O_O","commit_id":"451400bef913c3d8cf9ad2bdfae947b6150471c5"}],"nova/tests/unit/network/test_neutronv2.py":[{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"a1c71da606d58f87a38291bbeaac3c967e815b46","unresolved":false,"context_lines":[{"line_number":5790,"context_line":""},{"line_number":5791,"context_line":"        self.assertEqual(l, [{\u0027id\u0027: 1}, {\u0027id\u0027: 2}, {\u0027id\u0027: 3}])"},{"line_number":5792,"context_line":""},{"line_number":5793,"context_line":"    def test__get_ksa_client_global_request_id(self):"},{"line_number":5794,"context_line":"        ctxt \u003d context.RequestContext("},{"line_number":5795,"context_line":"            uuids.user_id, uuids.project_id,"},{"line_number":5796,"context_line":"            auth_token\u003d\u0027token\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_a0f8cb7a","line":5793,"updated":"2019-06-10 02:25:11.000000000","message":"Nit: Extra underline here (test_get...)","commit_id":"40032fb9884aca8457ca3e012bab4706605e151c"},{"author":{"_account_id":7634,"name":"Takashi Natsume","email":"takanattie@gmail.com","username":"natsumet"},"change_message_id":"75b4334d1243c73649c4e97266f91a27f14a2dd9","unresolved":false,"context_lines":[{"line_number":5790,"context_line":""},{"line_number":5791,"context_line":"        self.assertEqual(l, [{\u0027id\u0027: 1}, {\u0027id\u0027: 2}, {\u0027id\u0027: 3}])"},{"line_number":5792,"context_line":""},{"line_number":5793,"context_line":"    def test__get_ksa_client_global_request_id(self):"},{"line_number":5794,"context_line":"        ctxt \u003d context.RequestContext("},{"line_number":5795,"context_line":"            uuids.user_id, uuids.project_id,"},{"line_number":5796,"context_line":"            auth_token\u003d\u0027token\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_dc0cb242","line":5793,"in_reply_to":"9fb8cfa7_2f960441","updated":"2019-06-11 05:26:28.000000000","message":"There are many examples in nova project:\n\nhttp://paste.openstack.org/show/752712/","commit_id":"40032fb9884aca8457ca3e012bab4706605e151c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"51fbd68bd019e0e951015e0e643d068112cc21bb","unresolved":false,"context_lines":[{"line_number":5790,"context_line":""},{"line_number":5791,"context_line":"        self.assertEqual(l, [{\u0027id\u0027: 1}, {\u0027id\u0027: 2}, {\u0027id\u0027: 3}])"},{"line_number":5792,"context_line":""},{"line_number":5793,"context_line":"    def test__get_ksa_client_global_request_id(self):"},{"line_number":5794,"context_line":"        ctxt \u003d context.RequestContext("},{"line_number":5795,"context_line":"            uuids.user_id, uuids.project_id,"},{"line_number":5796,"context_line":"            auth_token\u003d\u0027token\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_2f960441","line":5793,"in_reply_to":"9fb8cfa7_a0f8cb7a","updated":"2019-06-10 11:48:33.000000000","message":"I think this is done deliberately to distinguish tests of _thing from tests of thing (which may or may not exist (yet)). It\u0027s not a convention that\u0027s followed everywhere.","commit_id":"40032fb9884aca8457ca3e012bab4706605e151c"},{"author":{"_account_id":22623,"name":"Erik Olof Gunnar Andersson","email":"eandersson@blizzard.com","username":"eoandersson"},"change_message_id":"9d6ae209cc78ef83daef4e9b8abd68dcca5c855d","unresolved":false,"context_lines":[{"line_number":5790,"context_line":""},{"line_number":5791,"context_line":"        self.assertEqual(l, [{\u0027id\u0027: 1}, {\u0027id\u0027: 2}, {\u0027id\u0027: 3}])"},{"line_number":5792,"context_line":""},{"line_number":5793,"context_line":"    def test__get_ksa_client_global_request_id(self):"},{"line_number":5794,"context_line":"        ctxt \u003d context.RequestContext("},{"line_number":5795,"context_line":"            uuids.user_id, uuids.project_id,"},{"line_number":5796,"context_line":"            auth_token\u003d\u0027token\u0027,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fb8cfa7_b796b94b","line":5793,"in_reply_to":"9fb8cfa7_dc0cb242","updated":"2019-06-11 06:05:14.000000000","message":"Sure - I would say it\u0027s the exception, not the rule thou. \u003d]","commit_id":"40032fb9884aca8457ca3e012bab4706605e151c"}]}
