)]}'
{"neutron/objects/agent.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"b8314c7fd931e2f749325484c0d89f03720c0923","unresolved":false,"context_lines":[{"line_number":31,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":32,"context_line":"class Agent(base.NeutronDbObject):"},{"line_number":33,"context_line":"    # Version 1.0: Initial version"},{"line_number":34,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    db_model \u003d agent_model.Agent"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"ff5d4b2f_673b659c","line":34,"updated":"2017-09-19 11:13:43.000000000","message":"why are we not bumping the version? a new method is added","commit_id":"1e5f37b3edaa50e63d2a7f3c1e6ff0c26bd4e20f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"0e5683f96ee0bd25c70a31e119e1c18e73c08ee3","unresolved":false,"context_lines":[{"line_number":31,"context_line":"@obj_base.VersionedObjectRegistry.register"},{"line_number":32,"context_line":"class Agent(base.NeutronDbObject):"},{"line_number":33,"context_line":"    # Version 1.0: Initial version"},{"line_number":34,"context_line":"    VERSION \u003d \u00271.0\u0027"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"    db_model \u003d agent_model.Agent"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"9f5c4f37_25355bdb","line":34,"in_reply_to":"ff5d4b2f_673b659c","updated":"2017-09-21 14:14:43.000000000","message":"For OVO, version defines fields and their types, not methods available. Those are not part of RPC interface.","commit_id":"1e5f37b3edaa50e63d2a7f3c1e6ff0c26bd4e20f"},{"author":{"_account_id":17491,"name":"Lujin Luo","email":"luo.lujin@jp.fujitsu.com","username":"Lujin"},"change_message_id":"a57948219a93d85727730a8a99e7d1168ee364a3","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        return agents"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    @classmethod"},{"line_number":123,"context_line":"    def get_ha_agents(cls, session, network_id\u003dNone, router_id\u003dNone):"},{"line_number":124,"context_line":"        query \u003d session.query(agent_model.Agent.host)"},{"line_number":125,"context_line":"        query \u003d query.join(l3ha_model.L3HARouterAgentPortBinding,"},{"line_number":126,"context_line":"                           l3ha_model.L3HARouterAgentPortBinding.l3_agent_id \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f5c4f37_2988a41d","line":123,"range":{"start_line":123,"start_character":8,"end_line":123,"end_character":22},"updated":"2017-09-21 06:30:28.000000000","message":"I am not sure if it is a good idea to use the same name as it is used in neutron/plugins/ml2/drivers/l2pop/db.py","commit_id":"1e5f37b3edaa50e63d2a7f3c1e6ff0c26bd4e20f"},{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"d3891dfba4730b08e1455d9d2dee6368d4255121","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        return agents"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    @classmethod"},{"line_number":123,"context_line":"    def get_ha_agents(cls, session, network_id\u003dNone, router_id\u003dNone):"},{"line_number":124,"context_line":"        query \u003d session.query(agent_model.Agent.host)"},{"line_number":125,"context_line":"        query \u003d query.join(l3ha_model.L3HARouterAgentPortBinding,"},{"line_number":126,"context_line":"                           l3ha_model.L3HARouterAgentPortBinding.l3_agent_id \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f5c4f37_05049716","line":123,"range":{"start_line":123,"start_character":27,"end_line":123,"end_character":34},"updated":"2017-09-21 14:40:50.000000000","message":"all OVO methods usually accept context object, not session. You can then extract it from context via .session attribute access.","commit_id":"1e5f37b3edaa50e63d2a7f3c1e6ff0c26bd4e20f"},{"author":{"_account_id":25903,"name":"Vu Cong Tuan","email":"tuanvc@vn.fujitsu.com","username":"tuanvu"},"change_message_id":"890c6d99f837fc88b519414305775760826a1d91","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        return agents"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    @classmethod"},{"line_number":123,"context_line":"    def get_ha_agents(cls, session, network_id\u003dNone, router_id\u003dNone):"},{"line_number":124,"context_line":"        query \u003d session.query(agent_model.Agent.host)"},{"line_number":125,"context_line":"        query \u003d query.join(l3ha_model.L3HARouterAgentPortBinding,"},{"line_number":126,"context_line":"                           l3ha_model.L3HARouterAgentPortBinding.l3_agent_id \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_5af717f7","line":123,"range":{"start_line":123,"start_character":27,"end_line":123,"end_character":34},"in_reply_to":"9f5c4f37_05049716","updated":"2017-09-22 08:20:12.000000000","message":"Done","commit_id":"1e5f37b3edaa50e63d2a7f3c1e6ff0c26bd4e20f"},{"author":{"_account_id":25903,"name":"Vu Cong Tuan","email":"tuanvc@vn.fujitsu.com","username":"tuanvu"},"change_message_id":"890c6d99f837fc88b519414305775760826a1d91","unresolved":false,"context_lines":[{"line_number":120,"context_line":"        return agents"},{"line_number":121,"context_line":""},{"line_number":122,"context_line":"    @classmethod"},{"line_number":123,"context_line":"    def get_ha_agents(cls, session, network_id\u003dNone, router_id\u003dNone):"},{"line_number":124,"context_line":"        query \u003d session.query(agent_model.Agent.host)"},{"line_number":125,"context_line":"        query \u003d query.join(l3ha_model.L3HARouterAgentPortBinding,"},{"line_number":126,"context_line":"                           l3ha_model.L3HARouterAgentPortBinding.l3_agent_id \u003d\u003d"}],"source_content_type":"text/x-python","patch_set":8,"id":"7f515b1d_fa900398","line":123,"range":{"start_line":123,"start_character":8,"end_line":123,"end_character":22},"in_reply_to":"9f5c4f37_2988a41d","updated":"2017-09-22 08:20:12.000000000","message":"Could you please suggest another name?\nI\u0027ve been trying to come up with a new name for this method, however I haven\u0027t found any appropriate name yet.\nBy the way, I think there\u0027s no problem with using the same name. Above methods (eg: get_l3_agents_ordered_by_num_routers), use the same name as well.","commit_id":"1e5f37b3edaa50e63d2a7f3c1e6ff0c26bd4e20f"},{"author":{"_account_id":15471,"name":"Nguyen Phuong An","email":"annp.cs51@gmail.com","username":"An-FVL"},"change_message_id":"5ee5c739a3ba15e86091e6cf0495d6c7fa4861cc","unresolved":false,"context_lines":[{"line_number":13,"context_line":"#    under the License."},{"line_number":14,"context_line":""},{"line_number":15,"context_line":"from neutron_lib import constants as const"},{"line_number":16,"context_line":"from neutron_lib import context as n_context"},{"line_number":17,"context_line":"from oslo_versionedobjects import base as obj_base"},{"line_number":18,"context_line":"from oslo_versionedobjects import fields as obj_fields"},{"line_number":19,"context_line":"from sqlalchemy import func"}],"source_content_type":"text/x-python","patch_set":10,"id":"7f515b1d_da55471f","line":16,"range":{"start_line":16,"start_character":1,"end_line":16,"end_character":44},"updated":"2017-09-22 08:42:52.000000000","message":"please remove it!","commit_id":"5dbbb0824d08d552a63030a8fdd6f3eb836ee3e8"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"060e58c254f4710b2b49683dd285013e55da981c","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                                 models_v2.Port.device_owner.in_("},{"line_number":138,"context_line":"                                     (const.DEVICE_OWNER_HA_REPLICATED_INT,"},{"line_number":139,"context_line":"                                      const.DEVICE_OWNER_ROUTER_SNAT))).all()"},{"line_number":140,"context_line":"        else:"},{"line_number":141,"context_line":"            return []"},{"line_number":142,"context_line":"        # L3HARouterAgentPortBinding will have l3 agent ids of hosting agents."},{"line_number":143,"context_line":"        # But we need l2 agent(for tunneling ip) while creating FDB entries."},{"line_number":144,"context_line":"        hosts \u003d [host[0] for host in query]"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f4b6375_b3d95023","line":141,"range":{"start_line":140,"start_character":0,"end_line":141,"end_character":21},"updated":"2017-10-31 21:14:31.000000000","message":"wouldn\u0027t it make more sense to remove this and have the following after L122 above:\n\n    if not (network_id or router_id):\n        return []\n\nThis way we don\u0027t query the DB and execute a join just to return an empty list","commit_id":"e12db5e29f2c63bdea9a66686248a8c277304ffd"},{"author":{"_account_id":25903,"name":"Vu Cong Tuan","email":"tuanvc@vn.fujitsu.com","username":"tuanvu"},"change_message_id":"8b8043b094477450f9ec9066319b3f681e25f876","unresolved":false,"context_lines":[{"line_number":137,"context_line":"                                 models_v2.Port.device_owner.in_("},{"line_number":138,"context_line":"                                     (const.DEVICE_OWNER_HA_REPLICATED_INT,"},{"line_number":139,"context_line":"                                      const.DEVICE_OWNER_ROUTER_SNAT))).all()"},{"line_number":140,"context_line":"        else:"},{"line_number":141,"context_line":"            return []"},{"line_number":142,"context_line":"        # L3HARouterAgentPortBinding will have l3 agent ids of hosting agents."},{"line_number":143,"context_line":"        # But we need l2 agent(for tunneling ip) while creating FDB entries."},{"line_number":144,"context_line":"        hosts \u003d [host[0] for host in query]"}],"source_content_type":"text/x-python","patch_set":15,"id":"3f4b6375_54b1dfe0","line":141,"range":{"start_line":140,"start_character":0,"end_line":141,"end_character":21},"in_reply_to":"3f4b6375_b3d95023","updated":"2017-11-01 02:34:23.000000000","message":"Done","commit_id":"e12db5e29f2c63bdea9a66686248a8c277304ffd"}],"neutron/plugins/ml2/drivers/l2pop/db.py":[{"author":{"_account_id":9656,"name":"Ihar Hrachyshka","email":"ihrachys@redhat.com","username":"ihrachys","status":"Red Hat Networking Systems Engineer"},"change_message_id":"c99ef573f8ee73341044e97f0115673893d4b5f4","unresolved":false,"context_lines":[{"line_number":140,"context_line":""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"def get_ha_agents(session, network_id\u003dNone, router_id\u003dNone):"},{"line_number":143,"context_line":"    context \u003d n_context.get_admin_context()"},{"line_number":144,"context_line":"    agents \u003d agent_objs.Agent.get_ha_agents(context,"},{"line_number":145,"context_line":"                                            network_id\u003dnetwork_id,"},{"line_number":146,"context_line":"                                            router_id\u003drouter_id)"}],"source_content_type":"text/x-python","patch_set":12,"id":"7f515b1d_67465324","line":143,"updated":"2017-09-26 19:31:47.000000000","message":"this potentially exposes objects not owned by the caller. I think what we should do instead is to pass context object into get_ha_agents instead of session, and then use it.","commit_id":"a987e2a6ca3b0efed659e6977a5ff5004ca56080"}],"neutron/plugins/ml2/drivers/l2pop/mech_driver.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"aa7306f7bcef96713a3b8a908f3542243268ee04","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        port \u003d context.current"},{"line_number":261,"context_line":"        agent_host \u003d context.host"},{"line_number":262,"context_line":"        port_context \u003d context._plugin_context"},{"line_number":263,"context_line":"        agent \u003d l2pop_db.get_agent_by_host(context, agent_host)"},{"line_number":264,"context_line":"        if not agent:"},{"line_number":265,"context_line":"            LOG.warning(\"Unable to retrieve active L2 agent on host %s\","},{"line_number":266,"context_line":"                        agent_host)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f4b6375_3d70ce72","line":263,"range":{"start_line":263,"start_character":43,"end_line":263,"end_character":50},"updated":"2017-10-18 20:28:25.000000000","message":"If you look here http://logs.openstack.org/90/501190/14/check/openstack-tox-py27/11ce532/job-output.txt.gz#_2017-10-17_08_09_20_355177, you will see that this line is triggering a traceback. Note that the \u0027context\u0027 argument of this method is not the plugin context. It is a ML2 PortContext (https://github.com/openstack/neutron/blob/master/neutron/plugins/ml2/driver_context.py#L116), which, as the bottom of the traceback tells you, doesn\u0027t have a \u0027session\u0027 attribute. You can find the plugin context, which has a \u0027session\u0027 attribute in context._plugin_context, as can be seen in L262 immediately above. So next step is pass \u0027port_context\u0027 here, instead of context. Note that you might be confusing PortContext and context in other places in this patch. Please make sure you fix those too","commit_id":"1909d7248b97eb3cd138271e5343afa7c9b1436c"},{"author":{"_account_id":15471,"name":"Nguyen Phuong An","email":"annp.cs51@gmail.com","username":"An-FVL"},"change_message_id":"de28088b3ff6c1c3e945fd6d3ee066f51bba7830","unresolved":false,"context_lines":[{"line_number":260,"context_line":"        port \u003d context.current"},{"line_number":261,"context_line":"        agent_host \u003d context.host"},{"line_number":262,"context_line":"        port_context \u003d context._plugin_context"},{"line_number":263,"context_line":"        agent \u003d l2pop_db.get_agent_by_host(context, agent_host)"},{"line_number":264,"context_line":"        if not agent:"},{"line_number":265,"context_line":"            LOG.warning(\"Unable to retrieve active L2 agent on host %s\","},{"line_number":266,"context_line":"                        agent_host)"}],"source_content_type":"text/x-python","patch_set":14,"id":"3f4b6375_ca52793b","line":263,"range":{"start_line":263,"start_character":43,"end_line":263,"end_character":50},"in_reply_to":"3f4b6375_3d70ce72","updated":"2017-10-25 07:02:59.000000000","message":"Thanks for your great teaching, Miguel. Done.","commit_id":"1909d7248b97eb3cd138271e5343afa7c9b1436c"}]}
