)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     kebo duan \u003cduankebo@outlook.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-02-29 11:44:36 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"[WIP] Code for selective topology distribution"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"1. Add a new module named topology. it will process southbound"},{"line_number":10,"context_line":"   topology change events such as add/del/mod ovs ports."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"9aed3d3a_09486dcb","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":6},"updated":"2016-02-29 07:32:30.000000000","message":"Is this still work in progress?","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"}],"dragonflow/common/common_params.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    cfg.FloatOpt(\u0027monitor_table_poll_time\u0027,"},{"line_number":61,"context_line":"                default\u003d30,"},{"line_number":62,"context_line":"                help\u003d_(\u0027Poll monitored tables every this number of seconds\u0027)),"},{"line_number":63,"context_line":"    cfg.BoolOpt(\u0027enable_selective_topo_dist\u0027,"},{"line_number":64,"context_line":"                default\u003dFalse,"},{"line_number":65,"context_line":"                help\u003d_(\"Enable use of selective topology distribution\")),"},{"line_number":66,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_890abd77","line":63,"updated":"2016-02-29 07:32:30.000000000","message":"Consider renaming to \u0027enable_selective_topology_distribution\u0027","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":60,"context_line":"    cfg.FloatOpt(\u0027monitor_table_poll_time\u0027,"},{"line_number":61,"context_line":"                default\u003d30,"},{"line_number":62,"context_line":"                help\u003d_(\u0027Poll monitored tables every this number of seconds\u0027)),"},{"line_number":63,"context_line":"    cfg.BoolOpt(\u0027enable_selective_topo_dist\u0027,"},{"line_number":64,"context_line":"                default\u003dFalse,"},{"line_number":65,"context_line":"                help\u003d_(\"Enable use of selective topology distribution\")),"},{"line_number":66,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_9515a24a","line":63,"in_reply_to":"9aed3d3a_890abd77","updated":"2016-03-10 09:45:08.000000000","message":"Done","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                help\u003d_(\u0027Poll monitored tables every this number of seconds\u0027)),"},{"line_number":81,"context_line":"    cfg.BoolOpt(\u0027enable_selective_topology_distribution\u0027,"},{"line_number":82,"context_line":"                default\u003dFalse,"},{"line_number":83,"context_line":"                help\u003d_(\"When enabled, topology will be published only \""},{"line_number":84,"context_line":"                       \"to related local controllers.\")),"},{"line_number":85,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_1e0622ce","line":84,"range":{"start_line":83,"start_character":39,"end_line":84,"end_character":53},"updated":"2016-03-14 08:49:07.000000000","message":"Consider changing to:\neach controller will get only the part of the topology that is relevant to it","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":80,"context_line":"                help\u003d_(\u0027Poll monitored tables every this number of seconds\u0027)),"},{"line_number":81,"context_line":"    cfg.BoolOpt(\u0027enable_selective_topology_distribution\u0027,"},{"line_number":82,"context_line":"                default\u003dFalse,"},{"line_number":83,"context_line":"                help\u003d_(\"When enabled, topology will be published only \""},{"line_number":84,"context_line":"                       \"to related local controllers.\")),"},{"line_number":85,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_9b92354a","line":84,"range":{"start_line":83,"start_character":39,"end_line":84,"end_character":53},"in_reply_to":"3afc51ec_1e0622ce","updated":"2016-03-14 13:35:38.000000000","message":"Done","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"}],"dragonflow/controller/df_local_controller.py":[{"author":{"_account_id":11364,"name":"Fei Rao","email":"milo.frao@gmail.com","username":"milo.frao"},"change_message_id":"d35a724421726a501ced7b8600773f2647c14ed1","unresolved":false,"context_lines":[{"line_number":122,"context_line":"                self.port_mappings()"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"                self.read_routers()"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"            self.read_floatingip()"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"            self.read_floatingip()"},{"line_number":129,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"bae84128_e1df1967","line":126,"range":{"start_line":125,"start_character":0,"end_line":126,"end_character":34},"updated":"2016-02-23 03:17:22.000000000","message":"read_floatingip is duplicate","commit_id":"25f3b637169bb17ccece88c1f5af60dca1d047f5"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        self.chassis_name \u003d chassis_name"},{"line_number":56,"context_line":"        self.ip \u003d cfg.CONF.df.local_ip"},{"line_number":57,"context_line":"        self.tunnel_type \u003d cfg.CONF.df.tunnel_type"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        self.sync_finished \u003d False"},{"line_number":60,"context_line":"        kwargs \u003d dict("},{"line_number":61,"context_line":"            db_store\u003dself.db_store"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_690f7988","line":58,"updated":"2016-02-29 07:32:30.000000000","message":"Why is this added?","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":55,"context_line":"        self.chassis_name \u003d chassis_name"},{"line_number":56,"context_line":"        self.ip \u003d cfg.CONF.df.local_ip"},{"line_number":57,"context_line":"        self.tunnel_type \u003d cfg.CONF.df.tunnel_type"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        self.sync_finished \u003d False"},{"line_number":60,"context_line":"        kwargs \u003d dict("},{"line_number":61,"context_line":"            db_store\u003dself.db_store"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_1502320b","line":58,"in_reply_to":"9aed3d3a_690f7988","updated":"2016-03-10 09:45:08.000000000","message":"Done","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        self.topology \u003d None"},{"line_number":66,"context_line":"        self.enable_selective_topo_dist \u003d \\"},{"line_number":67,"context_line":"            cfg.CONF.df.enable_selective_topo_dist"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def run(self):"},{"line_number":70,"context_line":"        nb_driver_class \u003d importutils.import_class(cfg.CONF.df.nb_db_class)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_0d69e8be","line":67,"updated":"2016-03-13 19:40:11.000000000","message":"The name of this configuration parameter has changed.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        self.topology \u003d None"},{"line_number":66,"context_line":"        self.enable_selective_topo_dist \u003d \\"},{"line_number":67,"context_line":"            cfg.CONF.df.enable_selective_topo_dist"},{"line_number":68,"context_line":""},{"line_number":69,"context_line":"    def run(self):"},{"line_number":70,"context_line":"        nb_driver_class \u003d importutils.import_class(cfg.CONF.df.nb_db_class)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_63ca3470","line":67,"in_reply_to":"3afc51ec_0d69e8be","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"}],"dragonflow/controller/topology.py":[{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":32,"context_line":""},{"line_number":33,"context_line":"        # Stores topics(tenants) subscribed by lports in the current local"},{"line_number":34,"context_line":"        # controller. I,e, {tenant1:[lport1, lport2], tenant2:[lport3]}"},{"line_number":35,"context_line":"        self.topic_subscribed \u003d {}"},{"line_number":36,"context_line":"        self.enable_selective_topo_dist \u003d \\"},{"line_number":37,"context_line":"            cfg.CONF.df.enable_selective_topo_dist"},{"line_number":38,"context_line":"        self.ovs_ports \u003d {}"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_4f741d67","line":35,"updated":"2016-02-23 11:19:08.000000000","message":"i think we can just hold number of ports per tenant, but this is ok too","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        return True"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _vm_port_added(self, ovs_port):"},{"line_number":121,"context_line":"        lport_id \u003d ovs_port.get_iface_id()"},{"line_number":122,"context_line":"        lport \u003d self._get_lport(lport_id)"},{"line_number":123,"context_line":"        assert lport is not None, \"Port:{id} not found\".format(id\u003dlport_id)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_ef437111","line":121,"updated":"2016-02-23 11:19:08.000000000","message":"I think that we need to distinguish between two cases both for create and for delete:\n\nCreate/Delete when Neutron port is created or deleted (user create a VM)\n\nCreate/Delete on VM shutdown - this case also triggers OVS port removal/re-add when its up again.\n\nFor the first case (when neutron port is created or deleted)\nWe need to actually check if its a new tenant and bring its data (or delete it if its the last port for tenant) and do all the subscribing.\n\nFor the second case, we only need to notify the applications using the dispatcher of port status change.\n\nHow we detect the second case:\n\nOn Create\nIf the port is already in the local cache, its not a new port and its the second case, otherwise its the first.\n\nOn Delete\nWe try to fetch the key from the DF DB, if its not there this means its an actual delete, if its there, its probably a VM shutdown (of course this might be inconsistent so we need to verify by version)","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e552c3e4a155e98b3795bd6164ed53bbe2bde8e8","unresolved":false,"context_lines":[{"line_number":118,"context_line":"        return True"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _vm_port_added(self, ovs_port):"},{"line_number":121,"context_line":"        lport_id \u003d ovs_port.get_iface_id()"},{"line_number":122,"context_line":"        lport \u003d self._get_lport(lport_id)"},{"line_number":123,"context_line":"        assert lport is not None, \"Port:{id} not found\".format(id\u003dlport_id)"},{"line_number":124,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_04110f04","line":121,"in_reply_to":"bae84128_ef437111","updated":"2016-02-24 13:21:47.000000000","message":"When vm is shutdown, compute and network resources on the compute node will be recycled. Next time,  it may be in another compute node when started. So even if we keep resource allocated for that ovs port in the original compute node, it may never be used again.\nBut to decrease the impact of frequent vm shutdown/startup. I think we can just notify vm online/offline events to local apps. We needn\u0027t to publish these  events to other computer nodes.","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    def _vm_port_added(self, ovs_port):"},{"line_number":121,"context_line":"        lport_id \u003d ovs_port.get_iface_id()"},{"line_number":122,"context_line":"        lport \u003d self._get_lport(lport_id)"},{"line_number":123,"context_line":"        assert lport is not None, \"Port:{id} not found\".format(id\u003dlport_id)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        tenant_id \u003d lport.get_tenant_id()"},{"line_number":126,"context_line":"        self._add_to_topic_subscribed(tenant_id, lport.get_id())"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_0f8055f6","line":123,"updated":"2016-02-23 11:19:08.000000000","message":"i think that we need to consider the case that the port is up in OVS but the DF DB is not yet consistent with the data so this _get_lport can actually return None, so maybe we need some re-try mechanism on this","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e552c3e4a155e98b3795bd6164ed53bbe2bde8e8","unresolved":false,"context_lines":[{"line_number":120,"context_line":"    def _vm_port_added(self, ovs_port):"},{"line_number":121,"context_line":"        lport_id \u003d ovs_port.get_iface_id()"},{"line_number":122,"context_line":"        lport \u003d self._get_lport(lport_id)"},{"line_number":123,"context_line":"        assert lport is not None, \"Port:{id} not found\".format(id\u003dlport_id)"},{"line_number":124,"context_line":""},{"line_number":125,"context_line":"        tenant_id \u003d lport.get_tenant_id()"},{"line_number":126,"context_line":"        self._add_to_topic_subscribed(tenant_id, lport.get_id())"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_a4c30337","line":123,"in_reply_to":"bae84128_0f8055f6","updated":"2016-02-24 13:21:47.000000000","message":"Noramlly, it will not occur, because before plugging the ovs port to br-int, the neutron port must  be created. \nBut this will occur if some synchronization need to be done between db nodes. We can take this case into account in next release.","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        if topic not in self.topic_subscribed:"},{"line_number":207,"context_line":"            self._pull_tenant_topology_from_db(topic)"},{"line_number":208,"context_line":"            self.nb_api.subscriber.register_topic(topic)"},{"line_number":209,"context_line":"            self.topic_subscribed[topic] \u003d [lport_id]"},{"line_number":210,"context_line":"        else:"},{"line_number":211,"context_line":"            self.topic_subscribed[topic].append(lport_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_8f7585fb","line":208,"updated":"2016-02-23 11:19:08.000000000","message":"probably best to first register the topic and then pull tenant topology from db","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e552c3e4a155e98b3795bd6164ed53bbe2bde8e8","unresolved":false,"context_lines":[{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        if topic not in self.topic_subscribed:"},{"line_number":207,"context_line":"            self._pull_tenant_topology_from_db(topic)"},{"line_number":208,"context_line":"            self.nb_api.subscriber.register_topic(topic)"},{"line_number":209,"context_line":"            self.topic_subscribed[topic] \u003d [lport_id]"},{"line_number":210,"context_line":"        else:"},{"line_number":211,"context_line":"            self.topic_subscribed[topic].append(lport_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_64fbbb79","line":208,"in_reply_to":"bae84128_8f7585fb","updated":"2016-02-24 13:21:47.000000000","message":"Yes, you are right!","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        port_ids.pop(lport_id)"},{"line_number":218,"context_line":"        if len(port_ids) \u003d\u003d 0:"},{"line_number":219,"context_line":"            self.topic_subscribed.pop(topic)"},{"line_number":220,"context_line":"            self.nb_api.subscriber.unregister_topic(topic)"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def _pull_tenant_topology_from_db(self, tenant_id):"},{"line_number":223,"context_line":"        ports \u003d self.nb_api.get_all_logical_ports(tenant_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_ef5c117f","line":220,"updated":"2016-02-23 11:19:08.000000000","message":"need to call \"_clear_tenant_topology\" here","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e552c3e4a155e98b3795bd6164ed53bbe2bde8e8","unresolved":false,"context_lines":[{"line_number":217,"context_line":"        port_ids.pop(lport_id)"},{"line_number":218,"context_line":"        if len(port_ids) \u003d\u003d 0:"},{"line_number":219,"context_line":"            self.topic_subscribed.pop(topic)"},{"line_number":220,"context_line":"            self.nb_api.subscriber.unregister_topic(topic)"},{"line_number":221,"context_line":""},{"line_number":222,"context_line":"    def _pull_tenant_topology_from_db(self, tenant_id):"},{"line_number":223,"context_line":"        ports \u003d self.nb_api.get_all_logical_ports(tenant_id)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_64057b44","line":220,"in_reply_to":"bae84128_ef5c117f","updated":"2016-02-24 13:21:47.000000000","message":"Yes","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"869ec389790c74d6cfba6148459db6b151762e27","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        handler_name \u003d \u0027_\u0027 + port_type + \u0027_port_\u0027 + action"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        try:"},{"line_number":79,"context_line":"            handler \u003d self.__getattribute__(handler_name)"},{"line_number":80,"context_line":"            handler(ovs_port)"},{"line_number":81,"context_line":"        except Exception as e:"},{"line_number":82,"context_line":"            LOG.error(_LE("}],"source_content_type":"text/x-python","patch_set":8,"id":"bae84128_66026371","line":79,"range":{"start_line":79,"start_character":27,"end_line":79,"end_character":43},"updated":"2016-02-25 11:30:02.000000000","message":"__getattribute__ is called by python, call getattr()","commit_id":"e644e6467086025953aa196897bafe503b2c8676"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"869ec389790c74d6cfba6148459db6b151762e27","unresolved":false,"context_lines":[{"line_number":101,"context_line":"            LOG.error(_LE(\"Unknown port offline: \") + ovs_port)"},{"line_number":102,"context_line":"            return"},{"line_number":103,"context_line":""},{"line_number":104,"context_line":"        handler_name \u003d \u0027_\u0027 + port_type + \u0027_deleted\u0027"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        try:"},{"line_number":107,"context_line":"            handler \u003d self.__getattribute__(handler_name)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bae84128_b2f4a187","line":104,"range":{"start_line":104,"start_character":40,"end_line":104,"end_character":41},"updated":"2016-02-25 11:30:02.000000000","message":"the \u0027_port\u0027 is missing","commit_id":"e644e6467086025953aa196897bafe503b2c8676"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"869ec389790c74d6cfba6148459db6b151762e27","unresolved":false,"context_lines":[{"line_number":104,"context_line":"        handler_name \u003d \u0027_\u0027 + port_type + \u0027_deleted\u0027"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"        try:"},{"line_number":107,"context_line":"            handler \u003d self.__getattribute__(handler_name)"},{"line_number":108,"context_line":"            handler(ovs_port)"},{"line_number":109,"context_line":"        except Exception as e:"},{"line_number":110,"context_line":"            LOG.error(_LE(\"exception occurred when handling \""}],"source_content_type":"text/x-python","patch_set":8,"id":"bae84128_f268e989","line":107,"range":{"start_line":107,"start_character":27,"end_line":107,"end_character":43},"updated":"2016-02-25 11:30:02.000000000","message":"same as above","commit_id":"e644e6467086025953aa196897bafe503b2c8676"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"869ec389790c74d6cfba6148459db6b151762e27","unresolved":false,"context_lines":[{"line_number":111,"context_line":"                          \"port offline event\"))"},{"line_number":112,"context_line":"            LOG.error(e)"},{"line_number":113,"context_line":"        finally:"},{"line_number":114,"context_line":"            self.ovs_ports.pop(ovs_port_id)"},{"line_number":115,"context_line":""},{"line_number":116,"context_line":"    def _check_ovs_port_integrity(self, ovs_port):"},{"line_number":117,"context_line":"        # todo(duankebo) verify the integrity of parameter"}],"source_content_type":"text/x-python","patch_set":8,"id":"bae84128_b2914155","line":114,"range":{"start_line":114,"start_character":27,"end_line":114,"end_character":30},"updated":"2016-02-25 11:30:02.000000000","message":"for just delete entry from dict, remove is more suited","commit_id":"e644e6467086025953aa196897bafe503b2c8676"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"869ec389790c74d6cfba6148459db6b151762e27","unresolved":false,"context_lines":[{"line_number":129,"context_line":"        lport.set_external_value(\u0027ofport\u0027, ovs_port.get_ofport())"},{"line_number":130,"context_line":"        lport.set_external_value(\u0027is_local\u0027, True)"},{"line_number":131,"context_line":"        lport.set_external_value(\u0027ovs_port_id\u0027, ovs_port.get_id())"},{"line_number":132,"context_line":"        LOG.info(_LI(\"Adding new local Logical Port \u003d %s\") % lport.__str__())"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        self.ovs_ports[ovs_port.get_id()] \u003d ovs_port"},{"line_number":135,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"bae84128_8dc982af","line":132,"range":{"start_line":132,"start_character":61,"end_line":132,"end_character":74},"updated":"2016-02-25 11:30:02.000000000","message":"just call str()","commit_id":"e644e6467086025953aa196897bafe503b2c8676"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"869ec389790c74d6cfba6148459db6b151762e27","unresolved":false,"context_lines":[{"line_number":131,"context_line":"        lport.set_external_value(\u0027ovs_port_id\u0027, ovs_port.get_id())"},{"line_number":132,"context_line":"        LOG.info(_LI(\"Adding new local Logical Port \u003d %s\") % lport.__str__())"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        self.ovs_ports[ovs_port.get_id()] \u003d ovs_port"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"        try:"},{"line_number":137,"context_line":"            self.open_flow_app.notify_local_vm_port_added(lport)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bae84128_8d25025e","line":134,"range":{"start_line":134,"start_character":8,"end_line":134,"end_character":52},"updated":"2016-02-25 11:30:02.000000000","message":"This operation is did in ovs_port_updated()","commit_id":"e644e6467086025953aa196897bafe503b2c8676"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"869ec389790c74d6cfba6148459db6b151762e27","unresolved":false,"context_lines":[{"line_number":145,"context_line":"            # self.nb_api.update_lport(lport_id, chassis\u003dself.chassis_name,"},{"line_number":146,"context_line":"            #                         status\u003d\u0027ACTIVE\u0027)"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def _vm_port_updated(self, ovs_port):"},{"line_number":149,"context_line":"        self.ovs_ports[ovs_port.get_id()] \u003d ovs_port"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"    def _vm_port_deleted(self, ovs_port):"}],"source_content_type":"text/x-python","patch_set":8,"id":"bae84128_ed73ee13","line":148,"range":{"start_line":148,"start_character":8,"end_line":148,"end_character":23},"updated":"2016-02-25 11:30:02.000000000","message":"why don\u0027t notify app here","commit_id":"e644e6467086025953aa196897bafe503b2c8676"},{"author":{"_account_id":20336,"name":"heshan","email":"shan.he@huawei.com","username":"shanhe"},"change_message_id":"869ec389790c74d6cfba6148459db6b151762e27","unresolved":false,"context_lines":[{"line_number":163,"context_line":"        except Exception:"},{"line_number":164,"context_line":"            LOG.error(_LE(\u0027app failed to process vm port offline event {%s} \u0027)"},{"line_number":165,"context_line":"                      % lport.__str__())"},{"line_number":166,"context_line":"        finally:"},{"line_number":167,"context_line":"            # todo(duankebo) lock db"},{"line_number":168,"context_line":"            # currently we will not publish vm port offline event."},{"line_number":169,"context_line":"            # lport \u003d self.nb_api.get_logical_port(lport_id)"}],"source_content_type":"text/x-python","patch_set":8,"id":"bae84128_0ddbb21c","line":166,"range":{"start_line":166,"start_character":8,"end_line":166,"end_character":16},"updated":"2016-02-25 11:30:02.000000000","message":"1. should we save lport to db if exception occured?\n2. will app access db when get notified?","commit_id":"e644e6467086025953aa196897bafe503b2c8676"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class Topology(object):"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def __init__(self, controller, en_sel_tp_dist):"},{"line_number":33,"context_line":"        self.ovs_port_type \u003d (OvsPort.TYPE_VM,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_180274b4","line":30,"updated":"2016-02-29 07:32:30.000000000","message":"When topology is initialised, does it read the state in order to be up-to-date? Does it get it from OVS when the service starts?","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":27,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":28,"context_line":""},{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class Topology(object):"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def __init__(self, controller, en_sel_tp_dist):"},{"line_number":33,"context_line":"        self.ovs_port_type \u003d (OvsPort.TYPE_VM,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_90e010fc","line":30,"in_reply_to":"9aed3d3a_180274b4","updated":"2016-03-10 09:45:08.000000000","message":"No. Topology is a totally event triggered module. It only need to start up before ovs monitor reporting any events.","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        @return : None"},{"line_number":59,"context_line":"        \"\"\""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        assert ovs_port is not None, \"ovs_port is None\""},{"line_number":62,"context_line":"        LOG.info(_LI(\"Ovs port updated: %s\") % str(ovs_port))"},{"line_number":63,"context_line":"        # there are some cases that some para of ovs port is missing"},{"line_number":64,"context_line":"        # then the event will be discarded"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_c4278cc8","line":61,"updated":"2016-02-29 07:32:30.000000000","message":"Consider changing to a test, log error, and return, so as not to crash the service.","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        @return : None"},{"line_number":59,"context_line":"        \"\"\""},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"        assert ovs_port is not None, \"ovs_port is None\""},{"line_number":62,"context_line":"        LOG.info(_LI(\"Ovs port updated: %s\") % str(ovs_port))"},{"line_number":63,"context_line":"        # there are some cases that some para of ovs port is missing"},{"line_number":64,"context_line":"        # then the event will be discarded"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_10d7e0ed","line":61,"in_reply_to":"9aed3d3a_c4278cc8","updated":"2016-03-10 09:45:08.000000000","message":"Done","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        handler_name \u003d \u0027_\u0027 + port_type + \u0027_port_\u0027 + action"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        try:"},{"line_number":85,"context_line":"            handler \u003d self.__getattribute__(handler_name)"},{"line_number":86,"context_line":"            handler(ovs_port)"},{"line_number":87,"context_line":"        except Exception:"},{"line_number":88,"context_line":"            LOG.exception(_LE("}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_e401f007","line":85,"updated":"2016-02-29 07:32:30.000000000","message":"I second heshan. getattr is clearer.","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        handler_name \u003d \u0027_\u0027 + port_type + \u0027_port_\u0027 + action"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        try:"},{"line_number":85,"context_line":"            handler \u003d self.__getattribute__(handler_name)"},{"line_number":86,"context_line":"            handler(ovs_port)"},{"line_number":87,"context_line":"        except Exception:"},{"line_number":88,"context_line":"            LOG.exception(_LE("}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_b058b48b","line":85,"in_reply_to":"9aed3d3a_e401f007","updated":"2016-03-10 09:45:08.000000000","message":"Done","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            self.ovs_ports.pop(ovs_port_id)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @staticmethod"},{"line_number":121,"context_line":"    def _check_ovs_port_integrity(ovs_port):"},{"line_number":122,"context_line":"        if (ovs_port.get_ofport() is None) or (ovs_port.get_type() is None):"},{"line_number":123,"context_line":"            return False"},{"line_number":124,"context_line":"        if (ovs_port.get_type() \u003d\u003d OvsPort.TYPE_VM) and \\"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_181c3469","line":121,"updated":"2016-02-29 07:32:30.000000000","message":"This method is not called in a static context. Why is it static?","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":118,"context_line":"            self.ovs_ports.pop(ovs_port_id)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    @staticmethod"},{"line_number":121,"context_line":"    def _check_ovs_port_integrity(ovs_port):"},{"line_number":122,"context_line":"        if (ovs_port.get_ofport() is None) or (ovs_port.get_type() is None):"},{"line_number":123,"context_line":"            return False"},{"line_number":124,"context_line":"        if (ovs_port.get_type() \u003d\u003d OvsPort.TYPE_VM) and \\"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_fb15fd3f","line":121,"in_reply_to":"9aed3d3a_181c3469","updated":"2016-03-10 09:45:08.000000000","message":"Done","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    def _check_ovs_port_integrity(ovs_port):"},{"line_number":122,"context_line":"        if (ovs_port.get_ofport() is None) or (ovs_port.get_type() is None):"},{"line_number":123,"context_line":"            return False"},{"line_number":124,"context_line":"        if (ovs_port.get_type() \u003d\u003d OvsPort.TYPE_VM) and \\"},{"line_number":125,"context_line":"                (ovs_port.get_iface_id() is None):"},{"line_number":126,"context_line":"            return False"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_387bf88d","line":124,"range":{"start_line":124,"start_character":12,"end_line":124,"end_character":31},"updated":"2016-02-29 07:32:30.000000000","message":"This method is called twice. Consider storing in a local variable.","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":121,"context_line":"    def _check_ovs_port_integrity(ovs_port):"},{"line_number":122,"context_line":"        if (ovs_port.get_ofport() is None) or (ovs_port.get_type() is None):"},{"line_number":123,"context_line":"            return False"},{"line_number":124,"context_line":"        if (ovs_port.get_type() \u003d\u003d OvsPort.TYPE_VM) and \\"},{"line_number":125,"context_line":"                (ovs_port.get_iface_id() is None):"},{"line_number":126,"context_line":"            return False"},{"line_number":127,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_7b28cd86","line":124,"range":{"start_line":124,"start_character":12,"end_line":124,"end_character":31},"in_reply_to":"9aed3d3a_387bf88d","updated":"2016-03-10 09:45:08.000000000","message":"Done","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            # self.nb_api.update_lport(lport_id, chassis\u003dself.chassis_name,"},{"line_number":154,"context_line":"            #                         status\u003d\u0027ACTIVE\u0027)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def _vm_port_updated(self, ovs_port):"},{"line_number":157,"context_line":"        pass"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def _vm_port_deleted(self, ovs_port):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_38893876","line":156,"updated":"2016-02-29 07:32:30.000000000","message":"With getattr+default, if you\u0027d test above that the handler is not None, this empty method will not be needed.\n\nOr you could give getattr an no-op function as default.","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":153,"context_line":"            # self.nb_api.update_lport(lport_id, chassis\u003dself.chassis_name,"},{"line_number":154,"context_line":"            #                         status\u003d\u0027ACTIVE\u0027)"},{"line_number":155,"context_line":""},{"line_number":156,"context_line":"    def _vm_port_updated(self, ovs_port):"},{"line_number":157,"context_line":"        pass"},{"line_number":158,"context_line":""},{"line_number":159,"context_line":"    def _vm_port_deleted(self, ovs_port):"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_1bff01ab","line":156,"in_reply_to":"9aed3d3a_38893876","updated":"2016-03-10 09:45:08.000000000","message":"Done","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            self.logical_to_ovs_port_mapping.pop(lport_id)"},{"line_number":183,"context_line":"            self._del_from_topic_subscribed(tenant_id, lport_id)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def _patch_port_added(self, ovs_port):"},{"line_number":186,"context_line":"        pass"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def _patch_port_updated(self, ovs_port):"},{"line_number":189,"context_line":"        pass"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def _patch_port_deleted(self, ovs_port_id):"},{"line_number":192,"context_line":"        pass"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def _tunnel_port_added(self, ovs_port):"},{"line_number":195,"context_line":"        pass"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _tunnel_port_updated(self, ovs_port):"},{"line_number":198,"context_line":"        pass"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def _tunnel_port_deleted(self, ovs_port_id):"},{"line_number":201,"context_line":"        pass"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def _bridge_port_added(self, ovs_port):"},{"line_number":204,"context_line":"        pass"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def _bridge_port_updated(self, ovs_port):"},{"line_number":207,"context_line":"        pass"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def _bridge_port_deleted(self, ovs_port_id):"},{"line_number":210,"context_line":"        pass"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def _add_to_topic_subscribed(self, topic, lport_id):"},{"line_number":213,"context_line":"        if not self.enable_selective_topo_dist:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_38d7784c","line":210,"range":{"start_line":185,"start_character":0,"end_line":210,"end_character":12},"updated":"2016-02-29 07:32:30.000000000","message":"See above re: empty functions","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            self.logical_to_ovs_port_mapping.pop(lport_id)"},{"line_number":183,"context_line":"            self._del_from_topic_subscribed(tenant_id, lport_id)"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"    def _patch_port_added(self, ovs_port):"},{"line_number":186,"context_line":"        pass"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def _patch_port_updated(self, ovs_port):"},{"line_number":189,"context_line":"        pass"},{"line_number":190,"context_line":""},{"line_number":191,"context_line":"    def _patch_port_deleted(self, ovs_port_id):"},{"line_number":192,"context_line":"        pass"},{"line_number":193,"context_line":""},{"line_number":194,"context_line":"    def _tunnel_port_added(self, ovs_port):"},{"line_number":195,"context_line":"        pass"},{"line_number":196,"context_line":""},{"line_number":197,"context_line":"    def _tunnel_port_updated(self, ovs_port):"},{"line_number":198,"context_line":"        pass"},{"line_number":199,"context_line":""},{"line_number":200,"context_line":"    def _tunnel_port_deleted(self, ovs_port_id):"},{"line_number":201,"context_line":"        pass"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":"    def _bridge_port_added(self, ovs_port):"},{"line_number":204,"context_line":"        pass"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"    def _bridge_port_updated(self, ovs_port):"},{"line_number":207,"context_line":"        pass"},{"line_number":208,"context_line":""},{"line_number":209,"context_line":"    def _bridge_port_deleted(self, ovs_port_id):"},{"line_number":210,"context_line":"        pass"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def _add_to_topic_subscribed(self, topic, lport_id):"},{"line_number":213,"context_line":"        if not self.enable_selective_topo_dist:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_7b2e0d44","line":210,"range":{"start_line":185,"start_character":0,"end_line":210,"end_character":12},"in_reply_to":"9aed3d3a_38d7784c","updated":"2016-03-10 09:45:08.000000000","message":"Done","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":218,"context_line":"                     {\"topic\": topic, \"id\": lport_id})"},{"line_number":219,"context_line":"            self.nb_api.subscriber.register_topic(topic)"},{"line_number":220,"context_line":"            self._pull_tenant_topology_from_db(topic, lport_id)"},{"line_number":221,"context_line":"            self.topic_subscribed[topic] \u003d [lport_id]"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            self.topic_subscribed[topic].append(lport_id)"},{"line_number":224,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_d84dac3f","line":221,"updated":"2016-02-29 07:32:30.000000000","message":"Consider using set, since you do lookups by object in _del_from_topic_subscribed.","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":218,"context_line":"                     {\"topic\": topic, \"id\": lport_id})"},{"line_number":219,"context_line":"            self.nb_api.subscriber.register_topic(topic)"},{"line_number":220,"context_line":"            self._pull_tenant_topology_from_db(topic, lport_id)"},{"line_number":221,"context_line":"            self.topic_subscribed[topic] \u003d [lport_id]"},{"line_number":222,"context_line":"        else:"},{"line_number":223,"context_line":"            self.topic_subscribed[topic].append(lport_id)"},{"line_number":224,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_bb337561","line":221,"in_reply_to":"9aed3d3a_d84dac3f","updated":"2016-03-10 09:45:08.000000000","message":"Very good suggestion!","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    work to be done:"},{"line_number":15,"context_line":"#       add tenant id field in each table"},{"line_number":16,"context_line":"#       add lswitch id in subnet table"},{"line_number":17,"context_line":"#       format the naming of method in nb_api"},{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"# import sys"},{"line_number":20,"context_line":"# import traceback"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_adaa74d2","line":17,"updated":"2016-03-13 19:40:11.000000000","message":"Consider moving these comments to a spec (in docs), blueprint, or bug (in Launchpad). These sort of comments tend to get lost or ignored.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    work to be done:"},{"line_number":15,"context_line":"#       add tenant id field in each table"},{"line_number":16,"context_line":"#       add lswitch id in subnet table"},{"line_number":17,"context_line":"#       format the naming of method in nb_api"},{"line_number":18,"context_line":"#"},{"line_number":19,"context_line":"# import sys"},{"line_number":20,"context_line":"# import traceback"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_1ec8e221","line":17,"in_reply_to":"3afc51ec_adaa74d2","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class Topology(object):"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def __init__(self, controller, en_sel_tp_dist):"},{"line_number":33,"context_line":"        self.ovs_port_type \u003d (OvsPort.TYPE_VM,"},{"line_number":34,"context_line":"                              OvsPort.TYPE_TUNNEL,"},{"line_number":35,"context_line":"                              OvsPort.TYPE_PATCH,"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_0db0c842","line":32,"updated":"2016-03-13 19:40:11.000000000","message":"Consider renaming parameter. Its function is not very clear in this form.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":29,"context_line":""},{"line_number":30,"context_line":"class Topology(object):"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def __init__(self, controller, en_sel_tp_dist):"},{"line_number":33,"context_line":"        self.ovs_port_type \u003d (OvsPort.TYPE_VM,"},{"line_number":34,"context_line":"                              OvsPort.TYPE_TUNNEL,"},{"line_number":35,"context_line":"                              OvsPort.TYPE_PATCH,"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_a02ee0f7","line":32,"in_reply_to":"3afc51ec_0db0c842","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    def ovs_port_updated(self, ovs_port):"},{"line_number":54,"context_line":"        \"\"\""},{"line_number":55,"context_line":"        Changes in ovs port status will be monitored by ovsdb monitor thread"},{"line_number":56,"context_line":"        and notified to topology. This method is the entrance port to process"},{"line_number":57,"context_line":"        port online/update event"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        @param ovs_port:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_edac7cef","line":56,"range":{"start_line":56,"start_character":53,"end_line":56,"end_character":66},"updated":"2016-03-13 19:40:11.000000000","message":"Consider rewording: entry point.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":53,"context_line":"    def ovs_port_updated(self, ovs_port):"},{"line_number":54,"context_line":"        \"\"\""},{"line_number":55,"context_line":"        Changes in ovs port status will be monitored by ovsdb monitor thread"},{"line_number":56,"context_line":"        and notified to topology. This method is the entrance port to process"},{"line_number":57,"context_line":"        port online/update event"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"        @param ovs_port:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_dee67ab3","line":56,"range":{"start_line":56,"start_character":53,"end_line":56,"end_character":66},"in_reply_to":"3afc51ec_edac7cef","updated":"2016-03-14 13:09:32.000000000","message":"OK, thank you!","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        port_id \u003d ovs_port.get_id()"},{"line_number":70,"context_line":"        old_port \u003d self.ovs_ports.get(port_id)"},{"line_number":71,"context_line":"        if old_port is None:"},{"line_number":72,"context_line":"            # ignore new port that misses some parameters"},{"line_number":73,"context_line":"            if not self._check_ovs_port_integrity(ovs_port):"},{"line_number":74,"context_line":"                return"},{"line_number":75,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_ad81d44c","line":72,"updated":"2016-03-13 19:40:11.000000000","message":"Consider making this comment a docstring on _check_ovs_port_integrity.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":69,"context_line":"        port_id \u003d ovs_port.get_id()"},{"line_number":70,"context_line":"        old_port \u003d self.ovs_ports.get(port_id)"},{"line_number":71,"context_line":"        if old_port is None:"},{"line_number":72,"context_line":"            # ignore new port that misses some parameters"},{"line_number":73,"context_line":"            if not self._check_ovs_port_integrity(ovs_port):"},{"line_number":74,"context_line":"                return"},{"line_number":75,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_807804f4","line":72,"in_reply_to":"3afc51ec_ad81d44c","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        if old_port is None:"},{"line_number":72,"context_line":"            # ignore new port that misses some parameters"},{"line_number":73,"context_line":"            if not self._check_ovs_port_integrity(ovs_port):"},{"line_number":74,"context_line":"                return"},{"line_number":75,"context_line":"            else:"},{"line_number":76,"context_line":"                action \u003d \"added\""},{"line_number":77,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_0d972891","line":74,"updated":"2016-03-13 19:40:11.000000000","message":"Consider outputting a warning here.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":71,"context_line":"        if old_port is None:"},{"line_number":72,"context_line":"            # ignore new port that misses some parameters"},{"line_number":73,"context_line":"            if not self._check_ovs_port_integrity(ovs_port):"},{"line_number":74,"context_line":"                return"},{"line_number":75,"context_line":"            else:"},{"line_number":76,"context_line":"                action \u003d \"added\""},{"line_number":77,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_de303a04","line":74,"in_reply_to":"3afc51ec_0d972891","updated":"2016-03-14 13:09:32.000000000","message":"This is a normal case, so we just ignore it quietly.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        handler_name \u003d \u0027_\u0027 + port_type + \u0027_port_deleted\u0027"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        try:"},{"line_number":116,"context_line":"            handler \u003d getattr(self, handler_name)"},{"line_number":117,"context_line":"            if handler is not None:"},{"line_number":118,"context_line":"                handler(ovs_port)"},{"line_number":119,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_8de9781d","line":116,"updated":"2016-03-13 19:40:11.000000000","message":"Is it possible that an attribute exists on self, but its value is None?","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":113,"context_line":"        handler_name \u003d \u0027_\u0027 + port_type + \u0027_port_deleted\u0027"},{"line_number":114,"context_line":""},{"line_number":115,"context_line":"        try:"},{"line_number":116,"context_line":"            handler \u003d getattr(self, handler_name)"},{"line_number":117,"context_line":"            if handler is not None:"},{"line_number":118,"context_line":"                handler(ovs_port)"},{"line_number":119,"context_line":"            else:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_80ac8b36","line":116,"in_reply_to":"3afc51ec_8de9781d","updated":"2016-03-14 13:09:32.000000000","message":"The class is not import from other package, in this class, we will avoid using name likes \"_xxx_port_deleted\". So th","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            LOG.error(_LE(\u0027App failed to process vm port online event %s\u0027)"},{"line_number":155,"context_line":"                      % str(lport))"},{"line_number":156,"context_line":"            LOG.exception(_LE(\"Exception occurred:\"))"},{"line_number":157,"context_line":"        finally:"},{"line_number":158,"context_line":"            self.db_store.set_port(lport.get_id(), lport, True)"},{"line_number":159,"context_line":"            # todo(update lport need a tenant parameter)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_0dc5688d","line":156,"updated":"2016-03-13 19:40:11.000000000","message":"Why not unify these two logs? (But keep it a call to LOG.exception)","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            LOG.error(_LE(\u0027App failed to process vm port online event %s\u0027)"},{"line_number":155,"context_line":"                      % str(lport))"},{"line_number":156,"context_line":"            LOG.exception(_LE(\"Exception occurred:\"))"},{"line_number":157,"context_line":"        finally:"},{"line_number":158,"context_line":"            self.db_store.set_port(lport.get_id(), lport, True)"},{"line_number":159,"context_line":"            # todo(update lport need a tenant parameter)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_263670e7","line":156,"in_reply_to":"3afc51ec_0dc5688d","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        tenant_id \u003d lport.get_topic()"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        LOG.info(_LI(\"Vm port(%s) offline\") % lport)"},{"line_number":171,"context_line":"        # todo(duankebo), notify apps."},{"line_number":172,"context_line":"        try:"},{"line_number":173,"context_line":"            self.controller.logical_port_deleted(lport_id)"},{"line_number":174,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_8d37b8af","line":171,"updated":"2016-03-13 19:40:11.000000000","message":"Apps notification probably should be done via the controller.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        tenant_id \u003d lport.get_topic()"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        LOG.info(_LI(\"Vm port(%s) offline\") % lport)"},{"line_number":171,"context_line":"        # todo(duankebo), notify apps."},{"line_number":172,"context_line":"        try:"},{"line_number":173,"context_line":"            self.controller.logical_port_deleted(lport_id)"},{"line_number":174,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_e67128aa","line":171,"in_reply_to":"3afc51ec_8d37b8af","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            # if lport.get_chassis() \u003d\u003d self.chassis_name:"},{"line_number":183,"context_line":"            #    self.nb_api.update_lport(lport.get_id(), chassis\u003dNone,"},{"line_number":184,"context_line":"            #                             status\u003d\u0027DOWN\u0027)"},{"line_number":185,"context_line":"            self.logical_to_ovs_port_mapping.pop(lport_id)"},{"line_number":186,"context_line":"            self._del_from_topic_subscribed(tenant_id, lport_id)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def _add_to_topic_subscribed(self, topic, lport_id):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_cd41c00d","line":185,"updated":"2016-03-13 19:40:11.000000000","message":"When not using the value returned by pop, consider using \u0027del self.logical_to_ovs_port_mapping[lport_id]\u0027 instead. This appears elsewhere in this file too.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            # if lport.get_chassis() \u003d\u003d self.chassis_name:"},{"line_number":183,"context_line":"            #    self.nb_api.update_lport(lport.get_id(), chassis\u003dNone,"},{"line_number":184,"context_line":"            #                             status\u003d\u0027DOWN\u0027)"},{"line_number":185,"context_line":"            self.logical_to_ovs_port_mapping.pop(lport_id)"},{"line_number":186,"context_line":"            self._del_from_topic_subscribed(tenant_id, lport_id)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":"    def _add_to_topic_subscribed(self, topic, lport_id):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_00587431","line":185,"in_reply_to":"3afc51ec_cd41c00d","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            self._pull_tenant_topology_from_db(topic, lport_id)"},{"line_number":197,"context_line":"            self.topic_subscribed[topic] \u003d {lport_id}"},{"line_number":198,"context_line":"        else:"},{"line_number":199,"context_line":"            self.topic_subscribed[topic].append(lport_id)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _del_from_topic_subscribed(self, topic, lport_id):"},{"line_number":202,"context_line":"        if not self.enable_selective_topo_dist:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_8dd05855","line":199,"updated":"2016-03-13 19:40:11.000000000","message":"self.topic_subscribed[topic] is a set, yet here treated as a list (attrib. append). Consider using \u0027add\u0027 or the |\u003d operator","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            self._pull_tenant_topology_from_db(topic, lport_id)"},{"line_number":197,"context_line":"            self.topic_subscribed[topic] \u003d {lport_id}"},{"line_number":198,"context_line":"        else:"},{"line_number":199,"context_line":"            self.topic_subscribed[topic].append(lport_id)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _del_from_topic_subscribed(self, topic, lport_id):"},{"line_number":202,"context_line":"        if not self.enable_selective_topo_dist:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_20c65049","line":199,"in_reply_to":"3afc51ec_8dd05855","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        LOG.info(_LI(\"Adding new local Logical Port \u003d %s\") % str(lport))"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        try:"},{"line_number":152,"context_line":"            self.controller.logical_port_updated(lport)"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            LOG.error(_LE(\u0027App failed to process vm port online event %s\u0027)"},{"line_number":155,"context_line":"                      % str(lport))"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_7bfe5839","line":152,"range":{"start_line":152,"start_character":28,"end_line":152,"end_character":48},"updated":"2016-03-14 08:49:07.000000000","message":"Consider adding another optional parameter with the of port number as we all ready know it and this way we can avoid the additional query using ovsdb in   logical_port_updated","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":149,"context_line":"        LOG.info(_LI(\"Adding new local Logical Port \u003d %s\") % str(lport))"},{"line_number":150,"context_line":""},{"line_number":151,"context_line":"        try:"},{"line_number":152,"context_line":"            self.controller.logical_port_updated(lport)"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            LOG.error(_LE(\u0027App failed to process vm port online event %s\u0027)"},{"line_number":155,"context_line":"                      % str(lport))"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_707dc31b","line":152,"range":{"start_line":152,"start_character":28,"end_line":152,"end_character":48},"in_reply_to":"3afc51ec_7bfe5839","updated":"2016-03-14 13:35:38.000000000","message":"Yes, you are definitely right. We will optimize the logical_port_updated method later. It will not need to query ovsdb. Just looks up ovs port in db store.","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":156,"context_line":"            LOG.exception(_LE(\"Exception occurred:\"))"},{"line_number":157,"context_line":"        finally:"},{"line_number":158,"context_line":"            self.db_store.set_port(lport.get_id(), lport, True)"},{"line_number":159,"context_line":"            # todo(update lport need a tenant parameter)"},{"line_number":160,"context_line":"            # currently we will not publish vm port offline event."},{"line_number":161,"context_line":"            # self.nb_api.update_lport(lport_id, chassis\u003dself.chassis_name,"},{"line_number":162,"context_line":"            #                         status\u003d\u0027ACTIVE\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_5bb1dce0","line":159,"range":{"start_line":159,"start_character":14,"end_line":159,"end_character":18},"updated":"2016-03-14 08:49:07.000000000","message":"It should be TODO(your name )","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":156,"context_line":"            LOG.exception(_LE(\"Exception occurred:\"))"},{"line_number":157,"context_line":"        finally:"},{"line_number":158,"context_line":"            self.db_store.set_port(lport.get_id(), lport, True)"},{"line_number":159,"context_line":"            # todo(update lport need a tenant parameter)"},{"line_number":160,"context_line":"            # currently we will not publish vm port offline event."},{"line_number":161,"context_line":"            # self.nb_api.update_lport(lport_id, chassis\u003dself.chassis_name,"},{"line_number":162,"context_line":"            #                         status\u003d\u0027ACTIVE\u0027)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_5b542d20","line":159,"range":{"start_line":159,"start_character":14,"end_line":159,"end_character":18},"in_reply_to":"3afc51ec_5bb1dce0","updated":"2016-03-14 13:35:38.000000000","message":"Done","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        tenant_id \u003d lport.get_topic()"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        LOG.info(_LI(\"Vm port(%s) offline\") % lport)"},{"line_number":171,"context_line":"        # todo(duankebo), notify apps."},{"line_number":172,"context_line":"        try:"},{"line_number":173,"context_line":"            self.controller.logical_port_deleted(lport_id)"},{"line_number":174,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_9bcb6453","line":171,"range":{"start_line":171,"start_character":10,"end_line":171,"end_character":14},"updated":"2016-03-14 08:49:07.000000000","message":"TODO","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":168,"context_line":"        tenant_id \u003d lport.get_topic()"},{"line_number":169,"context_line":""},{"line_number":170,"context_line":"        LOG.info(_LI(\"Vm port(%s) offline\") % lport)"},{"line_number":171,"context_line":"        # todo(duankebo), notify apps."},{"line_number":172,"context_line":"        try:"},{"line_number":173,"context_line":"            self.controller.logical_port_deleted(lport_id)"},{"line_number":174,"context_line":"        except Exception:"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_9b34f5fb","line":171,"range":{"start_line":171,"start_character":10,"end_line":171,"end_character":14},"in_reply_to":"3afc51ec_9bcb6453","updated":"2016-03-14 13:35:38.000000000","message":"Done","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                \u0027app failed to process vm port offline event %s\u0027) % lport_id)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        finally:"},{"line_number":179,"context_line":"            # todo(duankebo) lock db"},{"line_number":180,"context_line":"            # currently we will not publish vm port offline event."},{"line_number":181,"context_line":"            # lport \u003d self.nb_api.get_logical_port(lport_id)"},{"line_number":182,"context_line":"            # if lport.get_chassis() \u003d\u003d self.chassis_name:"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_7bc6584a","line":179,"range":{"start_line":179,"start_character":14,"end_line":179,"end_character":18},"updated":"2016-03-14 08:49:07.000000000","message":"ditto","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":176,"context_line":"                \u0027app failed to process vm port offline event %s\u0027) % lport_id)"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"        finally:"},{"line_number":179,"context_line":"            # todo(duankebo) lock db"},{"line_number":180,"context_line":"            # currently we will not publish vm port offline event."},{"line_number":181,"context_line":"            # lport \u003d self.nb_api.get_logical_port(lport_id)"},{"line_number":182,"context_line":"            # if lport.get_chassis() \u003d\u003d self.chassis_name:"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_cd024409","line":179,"range":{"start_line":179,"start_character":14,"end_line":179,"end_character":18},"in_reply_to":"3afc51ec_7bc6584a","updated":"2016-03-14 13:35:38.000000000","message":"Done","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            self._pull_tenant_topology_from_db(topic, lport_id)"},{"line_number":197,"context_line":"            self.topic_subscribed[topic] \u003d {lport_id}"},{"line_number":198,"context_line":"        else:"},{"line_number":199,"context_line":"            self.topic_subscribed[topic].append(lport_id)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _del_from_topic_subscribed(self, topic, lport_id):"},{"line_number":202,"context_line":"        if not self.enable_selective_topo_dist:"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_de631adb","line":199,"range":{"start_line":199,"start_character":41,"end_line":199,"end_character":57},"updated":"2016-03-14 08:49:07.000000000","message":"if I understand correctly we old port UUID in the array just to know when we have no more ports fro this Tenant.\n\nSo why not just have a counter like reference count +1","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":196,"context_line":"            self._pull_tenant_topology_from_db(topic, lport_id)"},{"line_number":197,"context_line":"            self.topic_subscribed[topic] \u003d {lport_id}"},{"line_number":198,"context_line":"        else:"},{"line_number":199,"context_line":"            self.topic_subscribed[topic].append(lport_id)"},{"line_number":200,"context_line":""},{"line_number":201,"context_line":"    def _del_from_topic_subscribed(self, topic, lport_id):"},{"line_number":202,"context_line":"        if not self.enable_selective_topo_dist:"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_cdec042c","line":199,"range":{"start_line":199,"start_character":41,"end_line":199,"end_character":57},"in_reply_to":"3afc51ec_de631adb","updated":"2016-03-14 13:35:38.000000000","message":"Yes, a counter does work. I think a set of ports is clearer. I can know which ports are subscribing the topic. If something goes wrong, it may be easier to debug.","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            return"},{"line_number":204,"context_line":"        port_ids \u003d self.topic_subscribed[topic]"},{"line_number":205,"context_line":"        port_ids.remove(lport_id)"},{"line_number":206,"context_line":"        if len(port_ids) \u003d\u003d 0:"},{"line_number":207,"context_line":"            LOG.info(_LI(\"Unsubscribe topic: %(topic)s by lport: %(id)s\") %"},{"line_number":208,"context_line":"                     {\"topic\": topic, \"id\": lport_id})"},{"line_number":209,"context_line":"            self.topic_subscribed.pop(topic)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_3ea95ee0","line":206,"range":{"start_line":206,"start_character":7,"end_line":206,"end_character":30},"updated":"2016-03-14 08:49:07.000000000","message":"reference count will be enough in my opinion","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":203,"context_line":"            return"},{"line_number":204,"context_line":"        port_ids \u003d self.topic_subscribed[topic]"},{"line_number":205,"context_line":"        port_ids.remove(lport_id)"},{"line_number":206,"context_line":"        if len(port_ids) \u003d\u003d 0:"},{"line_number":207,"context_line":"            LOG.info(_LI(\"Unsubscribe topic: %(topic)s by lport: %(id)s\") %"},{"line_number":208,"context_line":"                     {\"topic\": topic, \"id\": lport_id})"},{"line_number":209,"context_line":"            self.topic_subscribed.pop(topic)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_4dc0f47c","line":206,"range":{"start_line":206,"start_character":7,"end_line":206,"end_character":30},"in_reply_to":"3afc51ec_3ea95ee0","updated":"2016-03-14 13:35:38.000000000","message":"Same as the previous comment","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        lport \u003d self.db_store.get_port(port_id)"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        if lport is None:"},{"line_number":267,"context_line":"            lport \u003d self.nb_api.get_logical_port(port_id, tenant_id)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"        return lport"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_7b9f7850","line":267,"range":{"start_line":266,"start_character":8,"end_line":267,"end_character":68},"updated":"2016-03-14 08:49:07.000000000","message":"I think that there is a use case(workflow) that the port was created on the compute node and was not yet updated in Dragonflow Database (have in mind that no-sql DB are evantuly consistent.\n\nI think that we should try few times and handle the flow of failure","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":263,"context_line":""},{"line_number":264,"context_line":"        lport \u003d self.db_store.get_port(port_id)"},{"line_number":265,"context_line":""},{"line_number":266,"context_line":"        if lport is None:"},{"line_number":267,"context_line":"            lport \u003d self.nb_api.get_logical_port(port_id, tenant_id)"},{"line_number":268,"context_line":""},{"line_number":269,"context_line":"        return lport"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_cd07e47f","line":267,"range":{"start_line":266,"start_character":8,"end_line":267,"end_character":68},"in_reply_to":"3afc51ec_7b9f7850","updated":"2016-03-14 13:35:38.000000000","message":"In theory it may occur, but rarely. We have additional mechanism to process this case.","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"f72f1e8599eb587f5ee3143abeeeba137d107cde","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        # Stores topics(tenants) subscribed by lports in the current local"},{"line_number":30,"context_line":"        # controller. I,e, {tenant1:{lport1, lport2}, tenant2:{lport3}}"},{"line_number":31,"context_line":"        self.topic_subscribed \u003d {}"},{"line_number":32,"context_line":"        self.enable_selective_topo_dist \u003d enable_selective_topology_distribution"},{"line_number":33,"context_line":"        self.ovs_ports \u003d {}"},{"line_number":34,"context_line":"        self.logical_to_ovs_port_mapping \u003d {}"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_21b76f87","line":32,"range":{"start_line":32,"start_character":78,"end_line":32,"end_character":80},"updated":"2016-03-14 14:42:47.000000000","message":"to long more then 80 char","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"077eaae08771ac70a930fa2c774d58efe09622ac","unresolved":false,"context_lines":[{"line_number":29,"context_line":"        # Stores topics(tenants) subscribed by lports in the current local"},{"line_number":30,"context_line":"        # controller. I,e, {tenant1:{lport1, lport2}, tenant2:{lport3}}"},{"line_number":31,"context_line":"        self.topic_subscribed \u003d {}"},{"line_number":32,"context_line":"        self.enable_selective_topo_dist \u003d enable_selective_topology_distribution"},{"line_number":33,"context_line":"        self.ovs_ports \u003d {}"},{"line_number":34,"context_line":"        self.logical_to_ovs_port_mapping \u003d {}"},{"line_number":35,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_164a4955","line":32,"range":{"start_line":32,"start_character":78,"end_line":32,"end_character":80},"in_reply_to":"3afc51ec_21b76f87","updated":"2016-03-15 12:34:10.000000000","message":"Done","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"f72f1e8599eb587f5ee3143abeeeba137d107cde","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    def _vm_port_added(self, ovs_port):"},{"line_number":136,"context_line":"        lport_id \u003d ovs_port.get_iface_id()"},{"line_number":137,"context_line":"        lport \u003d self._get_lport(lport_id)"},{"line_number":138,"context_line":"        tenant_id \u003d lport.get_topic()"},{"line_number":139,"context_line":"        self._add_to_topic_subscribed(tenant_id, lport_id)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        # update lport, notify apps"}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_5c6ee02f","line":138,"range":{"start_line":138,"start_character":21,"end_line":138,"end_character":26},"updated":"2016-03-14 14:42:47.000000000","message":"As we discuses din the previous  patch this can theoretically be None.\n\nwe need to check that to avoid exception","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"077eaae08771ac70a930fa2c774d58efe09622ac","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    def _vm_port_added(self, ovs_port):"},{"line_number":136,"context_line":"        lport_id \u003d ovs_port.get_iface_id()"},{"line_number":137,"context_line":"        lport \u003d self._get_lport(lport_id)"},{"line_number":138,"context_line":"        tenant_id \u003d lport.get_topic()"},{"line_number":139,"context_line":"        self._add_to_topic_subscribed(tenant_id, lport_id)"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"        # update lport, notify apps"}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_a1dcf473","line":138,"range":{"start_line":138,"start_character":21,"end_line":138,"end_character":26},"in_reply_to":"3afc51ec_5c6ee02f","updated":"2016-03-15 12:34:10.000000000","message":"Done","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"f72f1e8599eb587f5ee3143abeeeba137d107cde","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        for port in ports:"},{"line_number":216,"context_line":"            if port.get_id() \u003d\u003d lport_id:"},{"line_number":217,"context_line":"                continue"},{"line_number":218,"context_line":"            self.controller.logical_port_updated(port)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        routers \u003d self.nb_api.get_routers(tenant_id)"},{"line_number":221,"context_line":"        for router in routers:"}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_9cc9887b","line":218,"range":{"start_line":218,"start_character":13,"end_line":218,"end_character":53},"updated":"2016-03-14 14:42:47.000000000","message":"I think that we should check if this port is another local port \nIn the case of other local port form the same tenant avoid calling \nlogical_port_update \n\nIt should be taken care by the port monitor","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"077eaae08771ac70a930fa2c774d58efe09622ac","unresolved":false,"context_lines":[{"line_number":215,"context_line":"        for port in ports:"},{"line_number":216,"context_line":"            if port.get_id() \u003d\u003d lport_id:"},{"line_number":217,"context_line":"                continue"},{"line_number":218,"context_line":"            self.controller.logical_port_updated(port)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        routers \u003d self.nb_api.get_routers(tenant_id)"},{"line_number":221,"context_line":"        for router in routers:"}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_e1bf1ca8","line":218,"range":{"start_line":218,"start_character":13,"end_line":218,"end_character":53},"in_reply_to":"3afc51ec_9cc9887b","updated":"2016-03-15 12:34:10.000000000","message":"Yes, this method (_pull_tenant_topology_from_db) will be called only when the first vm port online event of the tenant are received. The logic is in _add_to_topic_subscribed","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":20405,"name":"liuhaixia","email":"liuhaixia315@huawei.com","username":"liuhaixia"},"change_message_id":"3632994fe74e750c480ad1ed0fbc32e61efd2ba8","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            self.controller.logical_port_updated(port)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        routers \u003d self.nb_api.get_routers(tenant_id)"},{"line_number":221,"context_line":"        for router in routers:"},{"line_number":222,"context_line":"            self.controller.router_updated(router)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        floating_ips \u003d self.nb_api.get_floatingips(tenant_id)"}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_014de8c3","line":221,"range":{"start_line":221,"start_character":7,"end_line":221,"end_character":30},"updated":"2016-03-15 09:47:09.000000000","message":"If routers is null, does this cause \u0027null pointer exception\u0027?","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"077eaae08771ac70a930fa2c774d58efe09622ac","unresolved":false,"context_lines":[{"line_number":218,"context_line":"            self.controller.logical_port_updated(port)"},{"line_number":219,"context_line":""},{"line_number":220,"context_line":"        routers \u003d self.nb_api.get_routers(tenant_id)"},{"line_number":221,"context_line":"        for router in routers:"},{"line_number":222,"context_line":"            self.controller.router_updated(router)"},{"line_number":223,"context_line":""},{"line_number":224,"context_line":"        floating_ips \u003d self.nb_api.get_floatingips(tenant_id)"}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_16f089c8","line":221,"range":{"start_line":221,"start_character":7,"end_line":221,"end_character":30},"in_reply_to":"3afc51ec_014de8c3","updated":"2016-03-15 12:34:10.000000000","message":"It will not be None, it will be an empty map {}","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":20405,"name":"liuhaixia","email":"liuhaixia315@huawei.com","username":"liuhaixia"},"change_message_id":"3632994fe74e750c480ad1ed0fbc32e61efd2ba8","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            self.controller.floatingip_updated(floating_ip)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def _clear_tenant_topology(self, tenant_id):"},{"line_number":229,"context_line":"        ports \u003d self.db_store.get_ports()"},{"line_number":230,"context_line":"        for port in ports:"},{"line_number":231,"context_line":"            if tenant_id \u003d\u003d port.get_topic():"},{"line_number":232,"context_line":"                self.controller.logical_port_deleted(port.get_id())"}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_139edb62","line":229,"range":{"start_line":229,"start_character":8,"end_line":229,"end_character":41},"updated":"2016-03-15 09:47:09.000000000","message":"If ports is null, does this cause \u0027null pointer exception\u0027?","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"077eaae08771ac70a930fa2c774d58efe09622ac","unresolved":false,"context_lines":[{"line_number":226,"context_line":"            self.controller.floatingip_updated(floating_ip)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":"    def _clear_tenant_topology(self, tenant_id):"},{"line_number":229,"context_line":"        ports \u003d self.db_store.get_ports()"},{"line_number":230,"context_line":"        for port in ports:"},{"line_number":231,"context_line":"            if tenant_id \u003d\u003d port.get_topic():"},{"line_number":232,"context_line":"                self.controller.logical_port_deleted(port.get_id())"}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_76e0edfa","line":229,"range":{"start_line":229,"start_character":8,"end_line":229,"end_character":41},"in_reply_to":"3afc51ec_139edb62","updated":"2016-03-15 12:34:10.000000000","message":"It will not be None, it will be an empty map {}","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":20405,"name":"liuhaixia","email":"liuhaixia315@huawei.com","username":"liuhaixia"},"change_message_id":"3632994fe74e750c480ad1ed0fbc32e61efd2ba8","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                self.controller.logical_port_deleted(port.get_id())"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        floating_ips \u003d self.db_store.get_floatingips()"},{"line_number":235,"context_line":"        for floating_ip in floating_ips:"},{"line_number":236,"context_line":"            if tenant_id \u003d\u003d floating_ip.get_topic():"},{"line_number":237,"context_line":"                self.controller.floatingip_deleted(floating_ip.get_name())"},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_d37e3318","line":235,"range":{"start_line":235,"start_character":9,"end_line":235,"end_character":40},"updated":"2016-03-15 09:47:09.000000000","message":"\u0027null pointer exception\u0027?","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"077eaae08771ac70a930fa2c774d58efe09622ac","unresolved":false,"context_lines":[{"line_number":232,"context_line":"                self.controller.logical_port_deleted(port.get_id())"},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"        floating_ips \u003d self.db_store.get_floatingips()"},{"line_number":235,"context_line":"        for floating_ip in floating_ips:"},{"line_number":236,"context_line":"            if tenant_id \u003d\u003d floating_ip.get_topic():"},{"line_number":237,"context_line":"                self.controller.floatingip_deleted(floating_ip.get_name())"},{"line_number":238,"context_line":""}],"source_content_type":"text/x-python","patch_set":18,"id":"3afc51ec_d6e901e8","line":235,"range":{"start_line":235,"start_character":9,"end_line":235,"end_character":40},"in_reply_to":"3afc51ec_d37e3318","updated":"2016-03-15 12:34:10.000000000","message":"It will not be None, it will be an empty map {}","commit_id":"2783f928a4b83ca84337c1d79bf5463fe0310e78"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"3301cae9bc828a3b17558440ffb9eea33290636e","unresolved":false,"context_lines":[{"line_number":134,"context_line":"        return True"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _vm_port_added(self, ovs_port):"},{"line_number":137,"context_line":"        lport_id \u003d ovs_port.get_iface_id()"},{"line_number":138,"context_line":"        lport \u003d self._get_lport(lport_id)"},{"line_number":139,"context_line":"        if lport is None:"},{"line_number":140,"context_line":"            LOG.warning(_LW(\"No lport found for ovs port %s  \")"}],"source_content_type":"text/x-python","patch_set":19,"id":"1af94dfe_4fc4bd91","line":137,"range":{"start_line":137,"start_character":8,"end_line":137,"end_character":42},"updated":"2016-03-15 12:33:32.000000000","message":"you are adding to the list by the ovs_port.get_iface_id()\nand remove latter by the port_id name\n\nI think you should use  lport_id \u003d lport.get_id()","commit_id":"c2531a066ddaf4dddce61e8e57d0634379e407bb"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"3301cae9bc828a3b17558440ffb9eea33290636e","unresolved":false,"context_lines":[{"line_number":162,"context_line":"    def _vm_port_deleted(self, ovs_port):"},{"line_number":163,"context_line":"        lport_id \u003d ovs_port.get_iface_id()"},{"line_number":164,"context_line":"        lport \u003d self.db_store.get_port(lport_id)"},{"line_number":165,"context_line":"        lport_id \u003d lport.get_id()"},{"line_number":166,"context_line":"        tenant_id \u003d lport.get_topic()"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":"        LOG.info(_LI(\"Vm port(%s) offline\") % lport)"}],"source_content_type":"text/x-python","patch_set":19,"id":"1af94dfe_af0901e0","line":165,"range":{"start_line":165,"start_character":8,"end_line":165,"end_character":16},"updated":"2016-03-15 12:33:32.000000000","message":"need to be the same id as here\n\ngood that we have the unit test","commit_id":"c2531a066ddaf4dddce61e8e57d0634379e407bb"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"ea58b5671d70b3336f2a41b550fc08b33baf7d11","unresolved":false,"context_lines":[{"line_number":197,"context_line":"    def _del_from_topic_subscribed(self, topic, lport_id):"},{"line_number":198,"context_line":"        if not self.enable_selective_topo_dist:"},{"line_number":199,"context_line":"            return"},{"line_number":200,"context_line":"        print(self.topic_subscribed)"},{"line_number":201,"context_line":"        port_ids \u003d self.topic_subscribed[topic]"},{"line_number":202,"context_line":"        port_ids.remove(lport_id)"},{"line_number":203,"context_line":"        if len(port_ids) \u003d\u003d 0:"}],"source_content_type":"text/x-python","patch_set":20,"id":"1af94dfe_ba3bf89b","line":200,"range":{"start_line":200,"start_character":8,"end_line":200,"end_character":13},"updated":"2016-03-15 14:17:53.000000000","message":"please remove","commit_id":"ad7e33050a5a3646b1b50d346e790ca51320b20c"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"4386e2e57f3985a67536c2e7ae9b8d1aeaa541a6","unresolved":false,"context_lines":[{"line_number":151,"context_line":"        try:"},{"line_number":152,"context_line":"            self.controller.logical_port_updated(lport)"},{"line_number":153,"context_line":"        except Exception:"},{"line_number":154,"context_line":"            LOG.error(_LE(\u0027App failed to process vm port online event %s\u0027)"},{"line_number":155,"context_line":"                      % str(lport))"},{"line_number":156,"context_line":"        finally:"},{"line_number":157,"context_line":"            self.db_store.set_port(lport.get_id(), lport, True)"}],"source_content_type":"text/x-python","patch_set":22,"id":"1af94dfe_a5caa69f","line":154,"updated":"2016-03-15 20:16:06.000000000","message":"Consider changing to LOG.exception (but can be done in another patch)","commit_id":"6ba649d98db4bd1bc8b790cde1cff1b7c377cce4"},{"author":{"_account_id":20405,"name":"liuhaixia","email":"liuhaixia315@huawei.com","username":"liuhaixia"},"change_message_id":"d744dc951f8ea03deac9865e049f69e8a8261841","unresolved":false,"context_lines":[{"line_number":57,"context_line":"            return"},{"line_number":58,"context_line":"        LOG.info(_LI(\"Ovs port updated: %s\") % str(ovs_port))"},{"line_number":59,"context_line":"        port_id \u003d ovs_port.get_id()"},{"line_number":60,"context_line":"        old_port \u003d self.ovs_ports.get(port_id)"},{"line_number":61,"context_line":"        if old_port is None:"},{"line_number":62,"context_line":"            # ignore new port that misses some parameters"},{"line_number":63,"context_line":"            if not self._check_ovs_port_integrity(ovs_port):"}],"source_content_type":"text/x-python","patch_set":23,"id":"1af94dfe_bac74f11","line":60,"range":{"start_line":60,"start_character":0,"end_line":60,"end_character":46},"updated":"2016-03-16 07:38:00.000000000","message":"Is old_port will be used in future?\nI cann\u0027t see any that use \u0027old_port\u0027.\nIs _vm_port_updated fuctions missing?","commit_id":"ffcb8bdeb8a04428712907ffbb01e34c97e9be8a"},{"author":{"_account_id":20405,"name":"liuhaixia","email":"liuhaixia315@huawei.com","username":"liuhaixia"},"change_message_id":"d744dc951f8ea03deac9865e049f69e8a8261841","unresolved":false,"context_lines":[{"line_number":133,"context_line":""},{"line_number":134,"context_line":"        return True"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def _vm_port_added(self, ovs_port):"},{"line_number":137,"context_line":"        lport_id \u003d ovs_port.get_iface_id()"},{"line_number":138,"context_line":"        lport \u003d self._get_lport(lport_id)"},{"line_number":139,"context_line":"        if lport is None:"}],"source_content_type":"text/x-python","patch_set":23,"id":"1af94dfe_65dc0c13","line":136,"range":{"start_line":136,"start_character":5,"end_line":136,"end_character":21},"updated":"2016-03-16 07:38:00.000000000","message":"Will some others types be supported in future, like tunnel port, patch?\nCurrently, DF Local controller create tunnel looply. \nFor ovsdb monitor being used, thus can be improved.","commit_id":"ffcb8bdeb8a04428712907ffbb01e34c97e9be8a"}],"dragonflow/db/api_nb.py":[{"author":{"_account_id":11364,"name":"Fei Rao","email":"milo.frao@gmail.com","username":"milo.frao"},"change_message_id":"d35a724421726a501ced7b8600773f2647c14ed1","unresolved":false,"context_lines":[{"line_number":112,"context_line":"    def _send_db_change_event(self, table, key, action, value, topic\u003dNone):"},{"line_number":113,"context_line":"        if self.use_pubsub:"},{"line_number":114,"context_line":"            update \u003d DbUpdate(table, key, action, value)"},{"line_number":115,"context_line":"            self.publisher.send_event(update, topic)"},{"line_number":116,"context_line":"            eventlet.sleep(0)"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def allocate_tunnel_key(self):"}],"source_content_type":"text/x-python","patch_set":4,"id":"bae84128_628028c1","line":115,"range":{"start_line":115,"start_character":11,"end_line":115,"end_character":52},"updated":"2016-02-23 03:17:22.000000000","message":"does it support None topic?","commit_id":"25f3b637169bb17ccece88c1f5af60dca1d047f5"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":377,"context_line":"        lport_json \u003d jsonutils.dumps(lport)"},{"line_number":378,"context_line":"        self.driver.set_key(\u0027lport\u0027, name, lport_json)"},{"line_number":379,"context_line":"        self._send_db_change_event(\u0027lport\u0027, name, \u0027set\u0027, lport_json,"},{"line_number":380,"context_line":"                                   lport.get_tenant_id())"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def delete_lport(self, name, topic):"},{"line_number":383,"context_line":"        self.driver.delete_key(\u0027lport\u0027, name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_cfc82d25","line":380,"updated":"2016-02-23 11:19:08.000000000","message":"i will add patch that updates this for all send events","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e552c3e4a155e98b3795bd6164ed53bbe2bde8e8","unresolved":false,"context_lines":[{"line_number":377,"context_line":"        lport_json \u003d jsonutils.dumps(lport)"},{"line_number":378,"context_line":"        self.driver.set_key(\u0027lport\u0027, name, lport_json)"},{"line_number":379,"context_line":"        self._send_db_change_event(\u0027lport\u0027, name, \u0027set\u0027, lport_json,"},{"line_number":380,"context_line":"                                   lport.get_tenant_id())"},{"line_number":381,"context_line":""},{"line_number":382,"context_line":"    def delete_lport(self, name, topic):"},{"line_number":383,"context_line":"        self.driver.delete_key(\u0027lport\u0027, name)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_648c5bda","line":380,"in_reply_to":"bae84128_cfc82d25","updated":"2016-02-24 13:21:47.000000000","message":"OK, great!","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":588,"context_line":"        return self.lport.get(\u0027device_owner\u0027)"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"    def get_tenant_id(self):"},{"line_number":591,"context_line":"        return self.lport.get(\u0027tenant_id\u0027)"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    def __str__(self):"},{"line_number":594,"context_line":"        return self.lport.__str__() + self.external_dict.__str__()"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_ec009f68","line":591,"updated":"2016-02-23 11:19:08.000000000","message":"its going to be \u0027topic\u0027 not \u0027tenant_id\u0027,\n\nMaybe better to rephrase this to get_topic(), we might use this same mechanism for finer grained selective proactive (as you suggested) in the next stage","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e552c3e4a155e98b3795bd6164ed53bbe2bde8e8","unresolved":false,"context_lines":[{"line_number":588,"context_line":"        return self.lport.get(\u0027device_owner\u0027)"},{"line_number":589,"context_line":""},{"line_number":590,"context_line":"    def get_tenant_id(self):"},{"line_number":591,"context_line":"        return self.lport.get(\u0027tenant_id\u0027)"},{"line_number":592,"context_line":""},{"line_number":593,"context_line":"    def __str__(self):"},{"line_number":594,"context_line":"        return self.lport.__str__() + self.external_dict.__str__()"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_a4a94326","line":591,"in_reply_to":"bae84128_ec009f68","updated":"2016-02-24 13:21:47.000000000","message":"We may add another method called \"get_topic\". This method may be called under some different cases.","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            return True"},{"line_number":110,"context_line":"        return self.driver.support_publish_subscribe()"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def _send_db_change_event(self, table, key, action, value, topic\u003dNone):"},{"line_number":113,"context_line":"        if self.use_pubsub:"},{"line_number":114,"context_line":"            update \u003d DbUpdate(table, key, action, value)"},{"line_number":115,"context_line":"            self.publisher.send_event(update, topic)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_58a35cb2","line":112,"updated":"2016-02-29 07:32:30.000000000","message":"This is already added in another patch. Consider basing this patch on it.\n\nhttps://review.openstack.org/#/c/284178/.","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"499553f544186e458344cb0b39c5805500a18d58","unresolved":false,"context_lines":[{"line_number":109,"context_line":"            return True"},{"line_number":110,"context_line":"        return self.driver.support_publish_subscribe()"},{"line_number":111,"context_line":""},{"line_number":112,"context_line":"    def _send_db_change_event(self, table, key, action, value, topic\u003dNone):"},{"line_number":113,"context_line":"        if self.use_pubsub:"},{"line_number":114,"context_line":"            update \u003d DbUpdate(table, key, action, value)"},{"line_number":115,"context_line":"            self.publisher.send_event(update, topic)"}],"source_content_type":"text/x-python","patch_set":10,"id":"9aed3d3a_7b628d3f","line":112,"in_reply_to":"9aed3d3a_58a35cb2","updated":"2016-03-10 09:45:08.000000000","message":"Done","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        chassis \u003d {\u0027name\u0027: name, \u0027ip\u0027: ip,"},{"line_number":278,"context_line":"                   \u0027tunnel_type\u0027: tunnel_type}"},{"line_number":279,"context_line":"        chassis_json \u003d jsonutils.dumps(chassis)"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"        self.driver.create_key(\u0027chassis\u0027, name, chassis_json, None)"},{"line_number":282,"context_line":"        self._send_db_change_event(\u0027chassis\u0027, name, \u0027set\u0027,"},{"line_number":283,"context_line":"                                   chassis_json, \u0027chassis\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_ed1d9c10","line":280,"updated":"2016-03-13 19:40:11.000000000","message":"Why was this line added?","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":277,"context_line":"        chassis \u003d {\u0027name\u0027: name, \u0027ip\u0027: ip,"},{"line_number":278,"context_line":"                   \u0027tunnel_type\u0027: tunnel_type}"},{"line_number":279,"context_line":"        chassis_json \u003d jsonutils.dumps(chassis)"},{"line_number":280,"context_line":""},{"line_number":281,"context_line":"        self.driver.create_key(\u0027chassis\u0027, name, chassis_json, None)"},{"line_number":282,"context_line":"        self._send_db_change_event(\u0027chassis\u0027, name, \u0027set\u0027,"},{"line_number":283,"context_line":"                                   chassis_json, \u0027chassis\u0027)"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_e0b9087b","line":280,"in_reply_to":"3afc51ec_ed1d9c10","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":280,"context_line":""},{"line_number":281,"context_line":"        self.driver.create_key(\u0027chassis\u0027, name, chassis_json, None)"},{"line_number":282,"context_line":"        self._send_db_change_event(\u0027chassis\u0027, name, \u0027set\u0027,"},{"line_number":283,"context_line":"                                   chassis_json, \u0027chassis\u0027)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def get_lswitch(self, name, topic\u003dNone):"},{"line_number":286,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_8d5e98e7","line":283,"updated":"2016-03-13 19:40:11.000000000","message":"I think this should be handled by the TableMonitor in the pub/sub module.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":280,"context_line":""},{"line_number":281,"context_line":"        self.driver.create_key(\u0027chassis\u0027, name, chassis_json, None)"},{"line_number":282,"context_line":"        self._send_db_change_event(\u0027chassis\u0027, name, \u0027set\u0027,"},{"line_number":283,"context_line":"                                   chassis_json, \u0027chassis\u0027)"},{"line_number":284,"context_line":""},{"line_number":285,"context_line":"    def get_lswitch(self, name, topic\u003dNone):"},{"line_number":286,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_a04d409b","line":283,"in_reply_to":"3afc51ec_8d5e98e7","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":725,"context_line":"        return res"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":"    @property"},{"line_number":728,"context_line":"    def topic(self):"},{"line_number":729,"context_line":"        return self.secgroup.get(\u0027topic\u0027)"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"    def __str__(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_6d0a2cd4","line":728,"updated":"2016-03-13 19:40:11.000000000","message":"Consider making this a method and not a property: get_topic(self). It is planned to be made part of an abstract class contract (see https://review.openstack.org/#/c/286643)","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":725,"context_line":"        return res"},{"line_number":726,"context_line":""},{"line_number":727,"context_line":"    @property"},{"line_number":728,"context_line":"    def topic(self):"},{"line_number":729,"context_line":"        return self.secgroup.get(\u0027topic\u0027)"},{"line_number":730,"context_line":""},{"line_number":731,"context_line":"    def __str__(self):"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_bbff3100","line":728,"in_reply_to":"3afc51ec_6d0a2cd4","updated":"2016-03-14 13:09:32.000000000","message":"Yes. But it can be modified together with other methods.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":807,"context_line":"        return self.floatingip.__str__()"},{"line_number":808,"context_line":""},{"line_number":809,"context_line":""},{"line_number":810,"context_line":"class OvsPort(object):"},{"line_number":811,"context_line":""},{"line_number":812,"context_line":"    TYPE_VM \u003d \u0027vm\u0027"},{"line_number":813,"context_line":"    TYPE_TUNNEL \u003d \u0027tunnel\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_6dd86c54","line":810,"updated":"2016-03-13 19:40:11.000000000","message":"Consider implementing get_topic for this class.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":807,"context_line":"        return self.floatingip.__str__()"},{"line_number":808,"context_line":""},{"line_number":809,"context_line":""},{"line_number":810,"context_line":"class OvsPort(object):"},{"line_number":811,"context_line":""},{"line_number":812,"context_line":"    TYPE_VM \u003d \u0027vm\u0027"},{"line_number":813,"context_line":"    TYPE_TUNNEL \u003d \u0027tunnel\u0027"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_1b3d85bb","line":810,"in_reply_to":"3afc51ec_6dd86c54","updated":"2016-03-14 13:09:32.000000000","message":"This object hasn\u0027t a topic(tenant_id) property.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":815,"context_line":"    TYPE_PATCH \u003d \u0027patch\u0027"},{"line_number":816,"context_line":""},{"line_number":817,"context_line":"    def __init__(self, value):"},{"line_number":818,"context_line":"        self.ovs_port \u003d value"},{"line_number":819,"context_line":""},{"line_number":820,"context_line":"    def get_id(self):"},{"line_number":821,"context_line":"        return self.ovs_port.get_uuid()"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_ad2b942f","line":818,"updated":"2016-03-13 19:40:11.000000000","message":"From what I can tell, value is a json string. Yet it is treated as an object. Could you please clarify?","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":815,"context_line":"    TYPE_PATCH \u003d \u0027patch\u0027"},{"line_number":816,"context_line":""},{"line_number":817,"context_line":"    def __init__(self, value):"},{"line_number":818,"context_line":"        self.ovs_port \u003d value"},{"line_number":819,"context_line":""},{"line_number":820,"context_line":"    def get_id(self):"},{"line_number":821,"context_line":"        return self.ovs_port.get_uuid()"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_1bd90584","line":818,"in_reply_to":"3afc51ec_ad2b942f","updated":"2016-03-14 13:09:32.000000000","message":"This is from the OVSDB Monitor module. It send a object, not a json string. Do you think it need to convert it to json string?","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"b7216f88089fecd43b262f64876307d37dc52fdd","unresolved":false,"context_lines":[{"line_number":848,"context_line":"        return self.ovs_port.get_tunnel_type()"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"    def __str__(self):"},{"line_number":851,"context_line":"        return self.ovs_port.__str__()"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_8d821851","line":851,"updated":"2016-03-13 19:40:11.000000000","message":"Consider calling str(self.ovs_port) rather than __str__ directly.","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"7142bff73bb33d467306bde0c5596d7c9bb30a23","unresolved":false,"context_lines":[{"line_number":848,"context_line":"        return self.ovs_port.get_tunnel_type()"},{"line_number":849,"context_line":""},{"line_number":850,"context_line":"    def __str__(self):"},{"line_number":851,"context_line":"        return self.ovs_port.__str__()"}],"source_content_type":"text/x-python","patch_set":16,"id":"3afc51ec_5bba6d0b","line":851,"in_reply_to":"3afc51ec_8d821851","updated":"2016-03-14 13:09:32.000000000","message":"Done","commit_id":"ac0210d6303b6bc3b06fac04ca8d6e5e3af48ad0"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                floatingip_id \u003d key"},{"line_number":205,"context_line":"                self.controller.floatingip_deleted(floatingip_id)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        if \u0027linterface\u0027 \u003d\u003d table:"},{"line_number":208,"context_line":"            if action \u003d\u003d \u0027set\u0027 or action \u003d\u003d \u0027create\u0027:"},{"line_number":209,"context_line":"                ovs_port \u003d OvsPort(value)"},{"line_number":210,"context_line":"                self.controller.ovs_port_updated(ovs_port)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_890de140","line":207,"range":{"start_line":207,"start_character":12,"end_line":207,"end_character":22},"updated":"2016-03-14 08:49:07.000000000","message":"I think that we should name it local_interface  or just interface \n(linterface  is not self explanatory)","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":204,"context_line":"                floatingip_id \u003d key"},{"line_number":205,"context_line":"                self.controller.floatingip_deleted(floatingip_id)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"        if \u0027linterface\u0027 \u003d\u003d table:"},{"line_number":208,"context_line":"            if action \u003d\u003d \u0027set\u0027 or action \u003d\u003d \u0027create\u0027:"},{"line_number":209,"context_line":"                ovs_port \u003d OvsPort(value)"},{"line_number":210,"context_line":"                self.controller.ovs_port_updated(ovs_port)"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_ad21b8fd","line":207,"range":{"start_line":207,"start_character":12,"end_line":207,"end_character":22},"in_reply_to":"3afc51ec_890de140","updated":"2016-03-14 13:35:38.000000000","message":"Done","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":13070,"name":"Eran Gampel","email":"eran@gampel.net","username":"Gampel"},"change_message_id":"a4ea432f5c31b07f7b9ad46efe3cce6bd162b1c9","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        chassis_json \u003d jsonutils.dumps(chassis)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        self.driver.create_key(\u0027chassis\u0027, name, chassis_json, None)"},{"line_number":284,"context_line":"        self._send_db_change_event(\u0027chassis\u0027, name, \u0027set\u0027,"},{"line_number":285,"context_line":"                                   chassis_json, \u0027chassis\u0027)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def get_lswitch(self, name, topic\u003dNone):"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_9b42443d","line":284,"range":{"start_line":284,"start_character":13,"end_line":284,"end_character":34},"updated":"2016-03-14 08:49:07.000000000","message":"this is currently handled by the monitor table in the neutron plugin \n\nAt the moment for this release we do not start a publisher on the Controller nodes,","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e7ae9b92effe701bd38eaffc3b251ddc4064d9b7","unresolved":false,"context_lines":[{"line_number":281,"context_line":"        chassis_json \u003d jsonutils.dumps(chassis)"},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        self.driver.create_key(\u0027chassis\u0027, name, chassis_json, None)"},{"line_number":284,"context_line":"        self._send_db_change_event(\u0027chassis\u0027, name, \u0027set\u0027,"},{"line_number":285,"context_line":"                                   chassis_json, \u0027chassis\u0027)"},{"line_number":286,"context_line":""},{"line_number":287,"context_line":"    def get_lswitch(self, name, topic\u003dNone):"}],"source_content_type":"text/x-python","patch_set":17,"id":"3afc51ec_6d8a10c1","line":284,"range":{"start_line":284,"start_character":13,"end_line":284,"end_character":34},"in_reply_to":"3afc51ec_9b42443d","updated":"2016-03-14 13:35:38.000000000","message":"Done","commit_id":"d5db43c1977cb17f61c74023f0c3daccd632aa4b"},{"author":{"_account_id":18903,"name":"Yuli","email":"stremovsky@gmail.com","username":"yuli"},"change_message_id":"14750ddd3cebaa78a1a668ddf9efa2ff890343c9","unresolved":false,"context_lines":[{"line_number":215,"context_line":"            else:"},{"line_number":216,"context_line":"                ovs_port_id \u003d key"},{"line_number":217,"context_line":"                self.controller.ovs_port_deleted(ovs_port_id)"},{"line_number":218,"context_line":""},{"line_number":219,"context_line":"    def sync(self):"},{"line_number":220,"context_line":"        pass"},{"line_number":221,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"3afc51ec_733e3fdb","line":218,"updated":"2016-03-15 09:48:16.000000000","message":"Why not to add return after the block of code:\n\nif \u0027ovsinterface\u0027 \u003d\u003d table:\n    \u003cCode\u003e\n    return","commit_id":"c2531a066ddaf4dddce61e8e57d0634379e407bb"}],"dragonflow/neutron/plugin.py":[{"author":{"_account_id":11364,"name":"Fei Rao","email":"milo.frao@gmail.com","username":"milo.frao"},"change_message_id":"d35a724421726a501ced7b8600773f2647c14ed1","unresolved":false,"context_lines":[{"line_number":434,"context_line":"                    port[\u0027port\u0027][df_const.DF_PORT_BINDING_PROFILE])"},{"line_number":435,"context_line":"            self._process_port_create_extra_dhcp_opts(context, db_port,"},{"line_number":436,"context_line":"                                                      dhcp_opts)"},{"line_number":437,"context_line":"        return self.(db_port, parent_name, tag, sgids)"},{"line_number":438,"context_line":""},{"line_number":439,"context_line":"    def create_port_in_nb_apicreate_port_in_nb_api(self, port, parent_name, tag, sgids):"},{"line_number":440,"context_line":"        # The port name *must* be port[\u0027id\u0027].  It must match the iface-id set"},{"line_number":441,"context_line":"        # in the Interfaces table of the Open_vSwitch database, which nova sets"},{"line_number":442,"context_line":"        # to be the port ID."}],"source_content_type":"text/x-python","patch_set":4,"id":"bae84128_62bdc8b6","line":439,"range":{"start_line":437,"start_character":0,"end_line":439,"end_character":88},"updated":"2016-02-23 03:17:22.000000000","message":"I\u0027m afraid the merge conflict??","commit_id":"25f3b637169bb17ccece88c1f5af60dca1d047f5"}],"dragonflow/tests/unit/test_topology.py":[{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":16,"context_line":"from neutron.tests import base as tests_base"},{"line_number":17,"context_line":""},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"class TestTopology(tests_base.BaseTestCase):"},{"line_number":20,"context_line":"    def setUp(self):"},{"line_number":21,"context_line":"        super(TestTopology, self).setUp()"}],"source_content_type":"text/x-python","patch_set":7,"id":"bae84128_cfef8d85","line":19,"updated":"2016-02-23 11:19:08.000000000","message":"i think we need some tests for this :) either unit tests or fullstack tests","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"}],"tools/tox_install.sh":[{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"cwd\u003d$(/bin/pwd)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"echo $neutron_installed \u003e /tmp/tox_install.txt"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"if [ $neutron_installed -eq 0 ]; then"},{"line_number":26,"context_line":"    echo \"ALREADY INSTALLED\" \u003e /tmp/tox_install.txt"}],"source_content_type":"text/x-sh","patch_set":7,"id":"bae84128_6c72cf12","line":23,"updated":"2016-02-23 11:19:08.000000000","message":"what is this for?","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e552c3e4a155e98b3795bd6164ed53bbe2bde8e8","unresolved":false,"context_lines":[{"line_number":20,"context_line":""},{"line_number":21,"context_line":"cwd\u003d$(/bin/pwd)"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"echo $neutron_installed \u003e /tmp/tox_install.txt"},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"if [ $neutron_installed -eq 0 ]; then"},{"line_number":26,"context_line":"    echo \"ALREADY INSTALLED\" \u003e /tmp/tox_install.txt"}],"source_content_type":"text/x-sh","patch_set":7,"id":"bae84128_3fc9bcac","line":23,"in_reply_to":"bae84128_6c72cf12","updated":"2016-02-24 13:21:47.000000000","message":"i will remove it.","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":11343,"name":"Gal Sagie","email":"gal.sagie@gmail.com","username":"GalSagie"},"change_message_id":"211640bf5219e22fc48310855ca70364bbace95e","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"pip install -U $*"},{"line_number":45,"context_line":"pip install python-etcd"},{"line_number":46,"context_line":"#pip install python-pytun"},{"line_number":47,"context_line":"pip install scapy"},{"line_number":48,"context_line":"exit $?"}],"source_content_type":"text/x-sh","patch_set":7,"id":"bae84128_ac7fb7de","line":46,"updated":"2016-02-23 11:19:08.000000000","message":"Why do you remove this? its needed for our fullstack tests","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20297,"name":"duankebo","email":"duankebo@huawei.com","username":"duankebo"},"change_message_id":"e552c3e4a155e98b3795bd6164ed53bbe2bde8e8","unresolved":false,"context_lines":[{"line_number":43,"context_line":""},{"line_number":44,"context_line":"pip install -U $*"},{"line_number":45,"context_line":"pip install python-etcd"},{"line_number":46,"context_line":"#pip install python-pytun"},{"line_number":47,"context_line":"pip install scapy"},{"line_number":48,"context_line":"exit $?"}],"source_content_type":"text/x-sh","patch_set":7,"id":"bae84128_7f9984c3","line":46,"in_reply_to":"bae84128_ac7fb7de","updated":"2016-02-24 13:21:47.000000000","message":"Just remove it temporarily, because it will fail on mac book when doing unit test.\nWe may judge the os type before running this command.","commit_id":"ff751917a90d079ca8fb480cfa9a6e28f26dffe3"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"c83ba5a3af3011a5111b19c13d6427e0ea5974be","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"pip install -U $*"},{"line_number":43,"context_line":"pip install python-etcd"},{"line_number":44,"context_line":"#pip install python-pytun"},{"line_number":45,"context_line":"pip install scapy"},{"line_number":46,"context_line":"exit $?"}],"source_content_type":"text/x-sh","patch_set":10,"id":"9aed3d3a_f8bfd0a7","line":44,"updated":"2016-02-29 07:32:30.000000000","message":"Why was this done?","commit_id":"bc785633d627a16514aa1368255e06af60e4cd02"}]}
