)]}'
{"neutron/plugins/ml2/drivers/type_flat.py":[{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"8076d649115090d72b1d385087fa1cae869ffec1","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"class GetContext(object):"},{"line_number":49,"context_line":"    def __init__(self, **entries):"},{"line_number":50,"context_line":"        print(entries)"},{"line_number":51,"context_line":"        self.__dict__.update(entries)"},{"line_number":52,"context_line":"        self.is_admin \u003d False"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"9a89bdaa_be119554","line":50,"range":{"start_line":50,"start_character":8,"end_line":50,"end_character":22},"updated":"2016-09-12 15:34:20.000000000","message":"Leftover?","commit_id":"bcfe8f63496554aeba75c614f65ead1cd82f26fa"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"3fb076bbe60238bdab13a78a1de664e2ccca43a6","unresolved":false,"context_lines":[{"line_number":47,"context_line":""},{"line_number":48,"context_line":"class GetContext(object):"},{"line_number":49,"context_line":"    def __init__(self, **entries):"},{"line_number":50,"context_line":"        print(entries)"},{"line_number":51,"context_line":"        self.__dict__.update(entries)"},{"line_number":52,"context_line":"        self.is_admin \u003d False"},{"line_number":53,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_f75e2d44","line":50,"range":{"start_line":50,"start_character":8,"end_line":50,"end_character":22},"in_reply_to":"9a89bdaa_be119554","updated":"2016-09-14 14:41:16.000000000","message":"yes. will remove it.","commit_id":"bcfe8f63496554aeba75c614f65ead1cd82f26fa"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"8076d649115090d72b1d385087fa1cae869ffec1","unresolved":false,"context_lines":[{"line_number":48,"context_line":"class GetContext(object):"},{"line_number":49,"context_line":"    def __init__(self, **entries):"},{"line_number":50,"context_line":"        print(entries)"},{"line_number":51,"context_line":"        self.__dict__.update(entries)"},{"line_number":52,"context_line":"        self.is_admin \u003d False"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def to_dict(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a89bdaa_5e6b29b9","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":37},"updated":"2016-09-12 15:34:20.000000000","message":"Cannot it be done differently? What is the `entries`? Is this property?\nIf yes, maybe it can be done as:\n\n self.entries.update(entries)","commit_id":"bcfe8f63496554aeba75c614f65ead1cd82f26fa"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"3fb076bbe60238bdab13a78a1de664e2ccca43a6","unresolved":false,"context_lines":[{"line_number":48,"context_line":"class GetContext(object):"},{"line_number":49,"context_line":"    def __init__(self, **entries):"},{"line_number":50,"context_line":"        print(entries)"},{"line_number":51,"context_line":"        self.__dict__.update(entries)"},{"line_number":52,"context_line":"        self.is_admin \u003d False"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def to_dict(self):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_daaa38d4","line":51,"range":{"start_line":51,"start_character":8,"end_line":51,"end_character":37},"in_reply_to":"9a89bdaa_5e6b29b9","updated":"2016-09-14 14:41:16.000000000","message":"`entries` holds the session value.","commit_id":"bcfe8f63496554aeba75c614f65ead1cd82f26fa"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"8076d649115090d72b1d385087fa1cae869ffec1","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        self.__dict__.update(entries)"},{"line_number":52,"context_line":"        self.is_admin \u003d False"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def to_dict(self):"},{"line_number":55,"context_line":"        return self.__dict__"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"class FlatTypeDriver(helpers.BaseTypeDriver):"}],"source_content_type":"text/x-python","patch_set":1,"id":"9a89bdaa_be24350d","line":55,"range":{"start_line":54,"start_character":0,"end_line":55,"end_character":28},"updated":"2016-09-12 15:34:20.000000000","message":"Do you really need this? It\u0027s context, not object. Why are you using this?","commit_id":"bcfe8f63496554aeba75c614f65ead1cd82f26fa"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"3fb076bbe60238bdab13a78a1de664e2ccca43a6","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        self.__dict__.update(entries)"},{"line_number":52,"context_line":"        self.is_admin \u003d False"},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"    def to_dict(self):"},{"line_number":55,"context_line":"        return self.__dict__"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"class FlatTypeDriver(helpers.BaseTypeDriver):"}],"source_content_type":"text/x-python","patch_set":1,"id":"7a8ec9b2_5ae388a3","line":55,"range":{"start_line":54,"start_character":0,"end_line":55,"end_character":28},"in_reply_to":"9a89bdaa_be24350d","updated":"2016-09-14 14:41:16.000000000","message":"No. Will not be using this method as I am hard coding \u0027is_admin\u0027 to false.","commit_id":"bcfe8f63496554aeba75c614f65ead1cd82f26fa"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"1e5610bcc295c11109215a1f18982ea6cacc24cf","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def reserve_provider_segment(self, session, segment):"},{"line_number":104,"context_line":"        physical_network \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":105,"context_line":"        context1 \u003d context.get_admin_context()"},{"line_number":106,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":107,"context_line":"            try:"},{"line_number":108,"context_line":"                LOG.debug(\"Reserving flat network on physical \""}],"source_content_type":"text/x-python","patch_set":3,"id":"5a8bc5a2_dade29dc","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":16},"updated":"2016-09-27 19:59:13.000000000","message":"Could you change it to `admin_context`?\nWhy escalation of privileges is needed? Could you add info, why are you doing this?","commit_id":"cbdd031ae2ff01f032d021d67a69669a8830f19b"},{"author":{"_account_id":8726,"name":"Victor Morales","email":"chipahuac@hotmail.com","username":"electrocucaracha"},"change_message_id":"edb93ff0bda969400ef706fdce565b82fffe661a","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def reserve_provider_segment(self, session, segment):"},{"line_number":104,"context_line":"        physical_network \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":105,"context_line":"        context1 \u003d context.get_admin_context()"},{"line_number":106,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":107,"context_line":"            try:"},{"line_number":108,"context_line":"                LOG.debug(\"Reserving flat network on physical \""}],"source_content_type":"text/x-python","patch_set":3,"id":"fa6399be_d0db00ec","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":16},"in_reply_to":"1a95cdbc_8acbca1d","updated":"2016-10-11 14:20:47.000000000","message":"I\u0027ve used the construction of the Context class which has a singleton function to get the DB session, maybe that also works for you.","commit_id":"cbdd031ae2ff01f032d021d67a69669a8830f19b"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"a479c8877856afe182aa1e6af4ab1909b055e90e","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def reserve_provider_segment(self, session, segment):"},{"line_number":104,"context_line":"        physical_network \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":105,"context_line":"        context1 \u003d context.get_admin_context()"},{"line_number":106,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":107,"context_line":"            try:"},{"line_number":108,"context_line":"                LOG.debug(\"Reserving flat network on physical \""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a98d1f4_aacd085f","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":16},"in_reply_to":"3a98d1f4_12556e4f","updated":"2016-09-29 14:53:25.000000000","message":"Yes. Used this to get context. I tried getting context by changing the function signature in the base drivers_api file. But \"reserve_provider_segment\" is being used by various files e.g., type_local, type_tunnel, type_vlan. So was not sure of changing. What would be the right method to go about this?","commit_id":"cbdd031ae2ff01f032d021d67a69669a8830f19b"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"e6d3e8eaf03eae7dee480f3707115a5c0327410d","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def reserve_provider_segment(self, session, segment):"},{"line_number":104,"context_line":"        physical_network \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":105,"context_line":"        context1 \u003d context.get_admin_context()"},{"line_number":106,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":107,"context_line":"            try:"},{"line_number":108,"context_line":"                LOG.debug(\"Reserving flat network on physical \""}],"source_content_type":"text/x-python","patch_set":3,"id":"1a95cdbc_8acbca1d","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":16},"in_reply_to":"3a98d1f4_3e83d357","updated":"2016-10-06 13:44:41.000000000","message":"Hi Artur, I tried reworking the reserve_provider_segment to take context as an attribute, but that particular function is being used in lot of files resulting in lot of errors and chaos. Yes, this is exposed to plugins [1]\n\n[1]https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/driver_api.py#L103\n\n[2]https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/type_tunnel.py#L196\n\n[3]https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/drivers/type_vlan.py#L163\n\nShall I continue with the rework?","commit_id":"cbdd031ae2ff01f032d021d67a69669a8830f19b"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"904e96dbe2f7fdef1403337f3ca5b62d72080cbc","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def reserve_provider_segment(self, session, segment):"},{"line_number":104,"context_line":"        physical_network \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":105,"context_line":"        context1 \u003d context.get_admin_context()"},{"line_number":106,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":107,"context_line":"            try:"},{"line_number":108,"context_line":"                LOG.debug(\"Reserving flat network on physical \""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a98d1f4_3e83d357","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":16},"in_reply_to":"3a98d1f4_aacd085f","updated":"2016-09-30 07:17:19.000000000","message":"You should rework the reserve_provider_segment to take context as an attribute. But it also depends on where this method is used and is it exposed to plugins?","commit_id":"cbdd031ae2ff01f032d021d67a69669a8830f19b"},{"author":{"_account_id":15518,"name":"Artur Korzeniewski","email":"artur.korzen@wp.pl","username":"akorzeni"},"change_message_id":"e8601f68ed930bd1a8013e65b6f160bc2db3b265","unresolved":false,"context_lines":[{"line_number":102,"context_line":""},{"line_number":103,"context_line":"    def reserve_provider_segment(self, session, segment):"},{"line_number":104,"context_line":"        physical_network \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":105,"context_line":"        context1 \u003d context.get_admin_context()"},{"line_number":106,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":107,"context_line":"            try:"},{"line_number":108,"context_line":"                LOG.debug(\"Reserving flat network on physical \""}],"source_content_type":"text/x-python","patch_set":3,"id":"3a98d1f4_12556e4f","line":105,"range":{"start_line":105,"start_character":8,"end_line":105,"end_character":16},"in_reply_to":"5a8bc5a2_dade29dc","updated":"2016-09-29 06:53:17.000000000","message":"It seems like we do not have context here available for OVO usage, because reserve_provider_segment is taking only session as argument. We need to change that, to have context passes when invoking this method.","commit_id":"cbdd031ae2ff01f032d021d67a69669a8830f19b"},{"author":{"_account_id":14611,"name":"dasm","display_name":"dasm","email":"dsmigiel@redhat.com","username":"dasm"},"change_message_id":"1e5610bcc295c11109215a1f18982ea6cacc24cf","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    def release_segment(self, session, segment):"},{"line_number":125,"context_line":"        physical_network \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":126,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":127,"context_line":"            context1 \u003d context.get_admin_context()"},{"line_number":128,"context_line":"            count \u003d flat_obj.FlatAllocation.get_object("},{"line_number":129,"context_line":"                context1,"},{"line_number":130,"context_line":"                physical_network\u003dphysical_network)"}],"source_content_type":"text/x-python","patch_set":3,"id":"5a8bc5a2_1a81718f","line":127,"range":{"start_line":127,"start_character":12,"end_line":127,"end_character":20},"updated":"2016-09-27 19:59:13.000000000","message":"ditto","commit_id":"cbdd031ae2ff01f032d021d67a69669a8830f19b"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"e8c118ac1acb9412af37b4be0a19396c0f732640","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                LOG.debug(\"Reserving flat network on physical \""},{"line_number":101,"context_line":"                          \"network %s\", physical_network)"},{"line_number":102,"context_line":"                alloc \u003d flat_obj.FlatAllocation("},{"line_number":103,"context_line":"                    context1,"},{"line_number":104,"context_line":"                    physical_network\u003dphysical_network)"},{"line_number":105,"context_line":"                alloc.create()"},{"line_number":106,"context_line":"            except obj_base.NeutronDbObjectDuplicateEntry:"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa6399be_8c0da992","line":103,"range":{"start_line":103,"start_character":20,"end_line":103,"end_character":28},"updated":"2016-10-12 23:18:23.000000000","message":"since the create method will use the session from this context, this actually changes the previous code a bit.  The session thats passed into this method (reserve_provider_segment) is only being used to start a transaction, but since context1 has an entirely different transaction, the create takes place in a totally different transaction.\n\nWhat you need to do is: Change this method to take in context instead of session and change all the code that calls this method to pass in a context.  This probably requires creating a new context where that happens, but it all depends on how that code looks.\n\nAnother thing to add is since this is just creating the object in the transaction and nothing more, you don\u0027t need to do the with session.begin (or when you get the context passed in with context.session.begin).  You will just need to try except around the alloc.create() call and catch the DuplicateEntry exception.","commit_id":"068d8e202366dcc96b972cf52ba5b21e518911fc"},{"author":{"_account_id":22218,"name":"Sindhu Devale","email":"sindhu.devale@intel.com","username":"sindhudevale"},"change_message_id":"a5d68cfbafafe0253203e3bb1917b2a755dc64f0","unresolved":false,"context_lines":[{"line_number":100,"context_line":"                LOG.debug(\"Reserving flat network on physical \""},{"line_number":101,"context_line":"                          \"network %s\", physical_network)"},{"line_number":102,"context_line":"                alloc \u003d flat_obj.FlatAllocation("},{"line_number":103,"context_line":"                    context1,"},{"line_number":104,"context_line":"                    physical_network\u003dphysical_network)"},{"line_number":105,"context_line":"                alloc.create()"},{"line_number":106,"context_line":"            except obj_base.NeutronDbObjectDuplicateEntry:"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a629dbe_b21ca914","line":103,"range":{"start_line":103,"start_character":20,"end_line":103,"end_character":28},"in_reply_to":"fa6399be_8c0da992","updated":"2016-11-08 16:34:24.000000000","message":"Hi Brandon, have addressed the second issue. The next patch will have the change from session to context for this method.","commit_id":"068d8e202366dcc96b972cf52ba5b21e518911fc"},{"author":{"_account_id":6951,"name":"Brandon Logan","email":"brandon.logan@rackspace.com","username":"brandon-logan"},"change_message_id":"e8c118ac1acb9412af37b4be0a19396c0f732640","unresolved":false,"context_lines":[{"line_number":116,"context_line":"    def release_segment(self, session, segment):"},{"line_number":117,"context_line":"        physical_network \u003d segment[api.PHYSICAL_NETWORK]"},{"line_number":118,"context_line":"        with session.begin(subtransactions\u003dTrue):"},{"line_number":119,"context_line":"            context1 \u003d context.Context()"},{"line_number":120,"context_line":"            count \u003d flat_obj.FlatAllocation.get_object("},{"line_number":121,"context_line":"                context1,"},{"line_number":122,"context_line":"                physical_network\u003dphysical_network)"}],"source_content_type":"text/x-python","patch_set":4,"id":"fa6399be_ac10ada9","line":119,"updated":"2016-10-12 23:18:23.000000000","message":"similar comments as above","commit_id":"068d8e202366dcc96b972cf52ba5b21e518911fc"}]}
