)]}'
{"neutron/plugins/ml2/plugin.py":[{"author":{"_account_id":15554,"name":"Bence Romsics","email":"bence.romsics@gmail.com","username":"ebenrom","status":"inactive contributor"},"change_message_id":"75c739365d11dab8dc671c58679de029ef3cc849","unresolved":false,"context_lines":[{"line_number":990,"context_line":"        with db_api.CONTEXT_WRITER.using(context):"},{"line_number":991,"context_line":"            try:"},{"line_number":992,"context_line":"                provider._raise_if_updates_provider_attributes(net_data)"},{"line_number":993,"context_line":"            except exc.InvalidInput as e:"},{"line_number":994,"context_line":"                net \u003d self.get_network(context, id)"},{"line_number":995,"context_line":"                for attr in provider_net.ATTRIBUTES:"},{"line_number":996,"context_line":"                    if attr in net_data and net_data[attr] \u003d\u003d net[attr]:"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_dadd4270","line":993,"range":{"start_line":993,"start_character":12,"end_line":993,"end_character":41},"updated":"2019-03-29 10:00:11.000000000","message":"While agreeing with Akihiro on the validator function, there\u0027s a tiny python fyi:\n\n except exc.InvalidInput as e:\n     ...\n     raise e\n\nCan be written as:\n\n except exc.InvalidInput:\n     ...\n     raise","commit_id":"7aa78de1578a968ba9c4e007044bfcedae4bfb29"},{"author":{"_account_id":841,"name":"Akihiro Motoki","email":"amotoki@gmail.com","username":"amotoki"},"change_message_id":"3dee066818457d59ac63d2d264be2b2a63a42855","unresolved":false,"context_lines":[{"line_number":996,"context_line":"                    if attr in net_data and net_data[attr] \u003d\u003d net[attr]:"},{"line_number":997,"context_line":"                        net_data.pop(attr)"},{"line_number":998,"context_line":"                    elif attr in net_data:"},{"line_number":999,"context_line":"                        raise e"},{"line_number":1000,"context_line":"            original_network \u003d super(Ml2Plugin, self).get_network(context, id)"},{"line_number":1001,"context_line":"            updated_network \u003d super(Ml2Plugin, self).update_network(context,"},{"line_number":1002,"context_line":"                                                                    id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_04ab71d5","line":999,"updated":"2019-03-29 07:49:02.000000000","message":"I think we should implement a validation function something like:\n\n def _check_if_updates_provider_attributes(...):\n     requested_provider_attrs \u003d set(net_data) \u0026 set(provider_net.ATTRIBUTES)\n     if not requested_provider_attrs:\n         return\n     current \u003d self.get_network(context, id)\n     for attr in requested_provider_attrs:\n       if (validators.is_attr_set(net_data.get(attr)) and\n               net_data[attr] !\u003d current[attr]):\n           raise n_exc.InvalidInput(error_message\u003dmsg)\n\nI haven\u0027t checked the place of is_attr() is right or not though.","commit_id":"7aa78de1578a968ba9c4e007044bfcedae4bfb29"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"ef616dcd1c1b046a0c991d9713d5a00938f20332","unresolved":false,"context_lines":[{"line_number":996,"context_line":"                    if attr in net_data and net_data[attr] \u003d\u003d net[attr]:"},{"line_number":997,"context_line":"                        net_data.pop(attr)"},{"line_number":998,"context_line":"                    elif attr in net_data:"},{"line_number":999,"context_line":"                        raise e"},{"line_number":1000,"context_line":"            original_network \u003d super(Ml2Plugin, self).get_network(context, id)"},{"line_number":1001,"context_line":"            updated_network \u003d super(Ml2Plugin, self).update_network(context,"},{"line_number":1002,"context_line":"                                                                    id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_b04e5636","line":999,"in_reply_to":"5fc1f717_04ab71d5","updated":"2019-03-29 13:07:10.000000000","message":"We kind of have one:\n  provider._raise_if_updates_provider_attributes(net_data) ??\n\nIt lives in neutron-lib, and is used by other plugins like vmware-nsx.\n\nShould we extend that function in lib so that we pass current to it and let it handle doing the comparision as well?\n\n  provider._raise_if_updates_provider_attributes(net_data, current_net)\n\nThen re-implement it as:\n\n  def _raise_if_updates_provider_attributes(net_data, current_net\u003dNone):\n      ( ... )\n\n\nwdyt?","commit_id":"7aa78de1578a968ba9c4e007044bfcedae4bfb29"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"30c947920efb7b85108ddedacf633aa7860c06b4","unresolved":false,"context_lines":[{"line_number":996,"context_line":"                    if attr in net_data and net_data[attr] \u003d\u003d net[attr]:"},{"line_number":997,"context_line":"                        net_data.pop(attr)"},{"line_number":998,"context_line":"                    elif attr in net_data:"},{"line_number":999,"context_line":"                        raise e"},{"line_number":1000,"context_line":"            original_network \u003d super(Ml2Plugin, self).get_network(context, id)"},{"line_number":1001,"context_line":"            updated_network \u003d super(Ml2Plugin, self).update_network(context,"},{"line_number":1002,"context_line":"                                                                    id,"}],"source_content_type":"text/x-python","patch_set":1,"id":"5fc1f717_4e507d0b","line":999,"in_reply_to":"5fc1f717_b04e5636","updated":"2019-04-02 13:45:52.000000000","message":"Turn\u0027s out I was mistaken the _raise_if_updates_provider_attributes method is not in neutron_lib. I\u0027ve updated it to implement the check there instead.","commit_id":"7aa78de1578a968ba9c4e007044bfcedae4bfb29"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"e1287d18afe6ed74113a3ff17852537b43b9b8d6","unresolved":false,"context_lines":[{"line_number":846,"context_line":"        requested_provider_net_attrs \u003d set(net_data) \u0026 provider_net_attrs"},{"line_number":847,"context_line":"        for attr in requested_provider_net_attrs:"},{"line_number":848,"context_line":"            if (validators.is_attr_set(net_data.get(attr)) and"},{"line_number":849,"context_line":"                    net_data.get(attr) !\u003d network[attr]):"},{"line_number":850,"context_line":"                msg \u003d (_(\u0027Plugin does not support updating the following \u0027"},{"line_number":851,"context_line":"                         \u0027provider network attributes: %s\u0027) %"},{"line_number":852,"context_line":"                       \u0027, \u0027.join(provider_net_attrs))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_f961b0a9","line":849,"range":{"start_line":849,"start_character":42,"end_line":849,"end_character":55},"updated":"2019-04-05 07:37:21.000000000","message":"i\u0027m investingating bug 1823294.\nhow are provider network attributes supposed to be populated into this \u0027network\u0027?\nnote that the caller gets this network using super\u0027s get_network, not ml2\u0027s.","commit_id":"20743350b9b40fd7a2cff074bb2c877ea36c5914"},{"author":{"_account_id":6854,"name":"YAMAMOTO Takashi","email":"yamamoto@midokura.com","username":"yamamoto"},"change_message_id":"876941e29c481369366f55f7e51da413c5c78174","unresolved":false,"context_lines":[{"line_number":846,"context_line":"        requested_provider_net_attrs \u003d set(net_data) \u0026 provider_net_attrs"},{"line_number":847,"context_line":"        for attr in requested_provider_net_attrs:"},{"line_number":848,"context_line":"            if (validators.is_attr_set(net_data.get(attr)) and"},{"line_number":849,"context_line":"                    net_data.get(attr) !\u003d network[attr]):"},{"line_number":850,"context_line":"                msg \u003d (_(\u0027Plugin does not support updating the following \u0027"},{"line_number":851,"context_line":"                         \u0027provider network attributes: %s\u0027) %"},{"line_number":852,"context_line":"                       \u0027, \u0027.join(provider_net_attrs))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_a0cbce50","line":849,"range":{"start_line":849,"start_character":42,"end_line":849,"end_character":55},"in_reply_to":"5fc1f717_99442c76","updated":"2019-04-08 05:32:38.000000000","message":"i submitted a patch. https://review.openstack.org/#/c/650599/","commit_id":"20743350b9b40fd7a2cff074bb2c877ea36c5914"},{"author":{"_account_id":24245,"name":"Harald Jensås","email":"hjensas@redhat.com","username":"harald.jensas"},"change_message_id":"f3086d87bac99ba9ec03d048057d3b6d6744dc3b","unresolved":false,"context_lines":[{"line_number":846,"context_line":"        requested_provider_net_attrs \u003d set(net_data) \u0026 provider_net_attrs"},{"line_number":847,"context_line":"        for attr in requested_provider_net_attrs:"},{"line_number":848,"context_line":"            if (validators.is_attr_set(net_data.get(attr)) and"},{"line_number":849,"context_line":"                    net_data.get(attr) !\u003d network[attr]):"},{"line_number":850,"context_line":"                msg \u003d (_(\u0027Plugin does not support updating the following \u0027"},{"line_number":851,"context_line":"                         \u0027provider network attributes: %s\u0027) %"},{"line_number":852,"context_line":"                       \u0027, \u0027.join(provider_net_attrs))"}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_99442c76","line":849,"range":{"start_line":849,"start_character":42,"end_line":849,"end_character":55},"in_reply_to":"5fc1f717_f961b0a9","updated":"2019-04-05 08:17:16.000000000","message":"Right, the unit tests in patchet 1 would have cought this. Patch set 1 also used the ml2\u0027s get_network.","commit_id":"20743350b9b40fd7a2cff074bb2c877ea36c5914"}],"neutron/tests/unit/plugins/ml2/test_plugin.py":[{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"9cb20abe6f30dcf90288305c68c3a82eddffc776","unresolved":false,"context_lines":[{"line_number":428,"context_line":"        with self.network(**kwargs) as net:"},{"line_number":429,"context_line":"            for attribute in set(pnet.ATTRIBUTES) - {pnet.SEGMENTATION_ID}:"},{"line_number":430,"context_line":"                net_data \u003d {attribute: net[\u0027network\u0027][attribute]}"},{"line_number":431,"context_line":"                self.assertIsNone("},{"line_number":432,"context_line":"                    plugin._update_provider_network_attributes("},{"line_number":433,"context_line":"                        self.context, net[\u0027network\u0027], net_data))"},{"line_number":434,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_e8901d99","line":431,"updated":"2019-04-03 20:44:37.000000000","message":"nit: this assertIsNone is not necessary here. I think that maybe something like:\n\n    try:\n        plugin._update_provider_network_attribute()\n    except InvalidInput:\n        self.fail(\"InvalidInput raised unexpectedly\")\n\nor something like that would be better.","commit_id":"20743350b9b40fd7a2cff074bb2c877ea36c5914"},{"author":{"_account_id":11975,"name":"Slawek Kaplonski","email":"skaplons@redhat.com","username":"slaweq"},"change_message_id":"165c80bc429d8bb58d57252cf801cbf61019fddc","unresolved":false,"context_lines":[{"line_number":428,"context_line":"        with self.network(**kwargs) as net:"},{"line_number":429,"context_line":"            for attribute in set(pnet.ATTRIBUTES) - {pnet.SEGMENTATION_ID}:"},{"line_number":430,"context_line":"                net_data \u003d {attribute: net[\u0027network\u0027][attribute]}"},{"line_number":431,"context_line":"                self.assertIsNone("},{"line_number":432,"context_line":"                    plugin._update_provider_network_attributes("},{"line_number":433,"context_line":"                        self.context, net[\u0027network\u0027], net_data))"},{"line_number":434,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_d838853c","line":431,"in_reply_to":"5fc1f717_38a0a9a5","updated":"2019-04-04 10:00:39.000000000","message":"If You prefer that way, I can live with this :)","commit_id":"20743350b9b40fd7a2cff074bb2c877ea36c5914"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"3d9ee2c79f2ed685ce52e9fbe410af33c6a34f5f","unresolved":false,"context_lines":[{"line_number":428,"context_line":"        with self.network(**kwargs) as net:"},{"line_number":429,"context_line":"            for attribute in set(pnet.ATTRIBUTES) - {pnet.SEGMENTATION_ID}:"},{"line_number":430,"context_line":"                net_data \u003d {attribute: net[\u0027network\u0027][attribute]}"},{"line_number":431,"context_line":"                self.assertIsNone("},{"line_number":432,"context_line":"                    plugin._update_provider_network_attributes("},{"line_number":433,"context_line":"                        self.context, net[\u0027network\u0027], net_data))"},{"line_number":434,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5fc1f717_38a0a9a5","line":431,"in_reply_to":"5fc1f717_e8901d99","updated":"2019-04-04 09:52:13.000000000","message":"Hmmmm I don\u0027t agree: the expected output of this function is None. If we have an exception, the test will exit and the exception will be reported.\n\nIMO, this code is correct.","commit_id":"20743350b9b40fd7a2cff074bb2c877ea36c5914"}]}
