)]}'
{"dragonflow/controller/df_bgp_service.py":[{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"1a6288e17bbf7588f7ac873df72c68cffa93e76d","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        for model in model_framework.iter_models_by_dependency_order():"},{"line_number":73,"context_line":"            self.sync.add_model(model)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def sync_data_from_nb_db(self):"},{"line_number":76,"context_line":"        self.sync.sync()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def update_model_object(self, obj):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f201791_2bef89e9","line":75,"updated":"2017-06-28 08:23:09.000000000","message":"Why we need 2 different sync flows :\n\n \n\nIn the df-controller:\n--------------------- \n1. periodic-loop : \n    1.1 db_change_callback \n      1.1.1 add sync to priorety-queue \n    2. process_changes - read from the priority queue\n      2.1 nb-api -  call to controller.sync() \n        2.2 controller-call to Sync.sync() \n\nhere\n-----\n1. periodic-loop :  \n  2. call to sync.sync()","commit_id":"b0a5b3db9f3a9aab7d014bc63674be7f4a9afa58"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"834224666babc3a3a959cafd5f287e47004374bd","unresolved":false,"context_lines":[{"line_number":72,"context_line":"        for model in model_framework.iter_models_by_dependency_order():"},{"line_number":73,"context_line":"            self.sync.add_model(model)"},{"line_number":74,"context_line":""},{"line_number":75,"context_line":"    def sync_data_from_nb_db(self):"},{"line_number":76,"context_line":"        self.sync.sync()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def update_model_object(self, obj):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f201791_ab127960","line":75,"in_reply_to":"5f201791_2bef89e9","updated":"2017-06-28 08:35:19.000000000","message":"The above flow is done in the controller service, the queue is used to make sure all sync requests happen on the same thread, serially, and not on the spawned greenthread.\n\nThe bottom flow happens in the DF\u0027s BGP service.","commit_id":"b0a5b3db9f3a9aab7d014bc63674be7f4a9afa58"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ed1e2cc45deeba403220ea4aa0b27f9603f94ca4","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                self.bgp_driver.delete_bgp_peer(speaker.local_as,"},{"line_number":124,"context_line":"                                                str(p.peer_ip))"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        # Add new peerstest_vm_port_online_offline"},{"line_number":127,"context_line":"        for p in new_peers:"},{"line_number":128,"context_line":"            if p not in old_peers:"},{"line_number":129,"context_line":"                self.bgp_driver.add_bgp_peer(speaker.local_as,"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f201791_057b9027","line":126,"range":{"start_line":126,"start_character":23,"end_line":126,"end_character":50},"updated":"2017-06-29 06:59:03.000000000","message":"Paste accident?","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"262d9ccec60d7ec5d3628e478634fff3afae4f17","unresolved":false,"context_lines":[{"line_number":123,"context_line":"                self.bgp_driver.delete_bgp_peer(speaker.local_as,"},{"line_number":124,"context_line":"                                                str(p.peer_ip))"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"        # Add new peerstest_vm_port_online_offline"},{"line_number":127,"context_line":"        for p in new_peers:"},{"line_number":128,"context_line":"            if p not in old_peers:"},{"line_number":129,"context_line":"                self.bgp_driver.add_bgp_peer(speaker.local_as,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_093b99d1","line":126,"range":{"start_line":126,"start_character":23,"end_line":126,"end_character":50},"in_reply_to":"5f201791_057b9027","updated":"2017-06-29 09:02:34.000000000","message":"Yes, oops","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"}],"dragonflow/controller/df_local_controller.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"544e65bf39d2594aeccfd58944223da2b4fc3dda","unresolved":false,"context_lines":[{"line_number":125,"context_line":"        for model in model_framework.iter_models_by_dependency_order():"},{"line_number":126,"context_line":"            self.sync.add_model(model)"},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"    def db_sync_loop(self):"},{"line_number":129,"context_line":"        while True:"},{"line_number":130,"context_line":"            time.sleep(1)"},{"line_number":131,"context_line":"            self.run_db_poll()"},{"line_number":132,"context_line":"            if self.sync_finished and ("},{"line_number":133,"context_line":"                    self.nb_api.support_publish_subscribe()):"},{"line_number":134,"context_line":"                self.nb_api.register_notification_callback(self)"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def run_sync(self, mode\u003dNone):"},{"line_number":137,"context_line":"        if mode \u003d\u003d \u0027full_sync\u0027:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_6f6eaac9","line":134,"range":{"start_line":128,"start_character":1,"end_line":134,"end_character":64},"updated":"2017-06-19 07:33:11.000000000","message":"Is this still needed?","commit_id":"b901e932ebda509fbe572a6992b2d64c8e90240d"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"544e65bf39d2594aeccfd58944223da2b4fc3dda","unresolved":false,"context_lines":[{"line_number":146,"context_line":"            if self.sync_finished:"},{"line_number":147,"context_line":"                return"},{"line_number":148,"context_line":""},{"line_number":149,"context_line":"    def run_db_poll(self):"},{"line_number":150,"context_line":"        try:"},{"line_number":151,"context_line":"            self.register_chassis()"},{"line_number":152,"context_line":"            self.sync.sync(topics\u003dself.topology.get_subscribed_topics())"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_af9de2bc","line":149,"range":{"start_line":149,"start_character":0,"end_line":149,"end_character":26},"updated":"2017-06-19 07:33:11.000000000","message":"Maybe for a separate patch: This should have a return value, rather than using a global for the same purpose.","commit_id":"b901e932ebda509fbe572a6992b2d64c8e90240d"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"544e65bf39d2594aeccfd58944223da2b4fc3dda","unresolved":false,"context_lines":[{"line_number":521,"context_line":"        try:"},{"line_number":522,"context_line":"            return obj.is_newer_than(cached_obj)"},{"line_number":523,"context_line":"        except AttributeError:"},{"line_number":524,"context_line":"            return obj !\u003d cached_obj"},{"line_number":525,"context_line":""},{"line_number":526,"context_line":"    def update_model_object(self, obj):"},{"line_number":527,"context_line":"        original_obj \u003d self.db_store2.get_one(obj)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_0facd6ea","line":524,"range":{"start_line":524,"start_character":0,"end_line":524,"end_character":36},"updated":"2017-06-19 07:33:11.000000000","message":"Separate patch?","commit_id":"b901e932ebda509fbe572a6992b2d64c8e90240d"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"1a6288e17bbf7588f7ac873df72c68cffa93e76d","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self.create_tunnels()"},{"line_number":113,"context_line":"        self._register_models()"},{"line_number":114,"context_line":"        self.sync()"},{"line_number":115,"context_line":"        self.nb_api.process_changes()"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def _submit_sync_event(self):"},{"line_number":118,"context_line":"        self.nb_api.db_change_callback(None, None, \u0027sync\u0027, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f201791_a05858f9","line":115,"updated":"2017-06-28 08:23:09.000000000","message":"Shouldn\u0027t we call periodically to the process_changes?","commit_id":"b0a5b3db9f3a9aab7d014bc63674be7f4a9afa58"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"834224666babc3a3a959cafd5f287e47004374bd","unresolved":false,"context_lines":[{"line_number":112,"context_line":"        self.create_tunnels()"},{"line_number":113,"context_line":"        self._register_models()"},{"line_number":114,"context_line":"        self.sync()"},{"line_number":115,"context_line":"        self.nb_api.process_changes()"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def _submit_sync_event(self):"},{"line_number":118,"context_line":"        self.nb_api.db_change_callback(None, None, \u0027sync\u0027, None)"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f201791_8be8ddb2","line":115,"in_reply_to":"5f201791_a05858f9","updated":"2017-06-28 08:35:19.000000000","message":"process_changes does not return (unless signaled)","commit_id":"b0a5b3db9f3a9aab7d014bc63674be7f4a9afa58"},{"author":{"_account_id":26131,"name":"Eyal Leshem","email":"eyal.leshem@toganetworks.com","username":"leyal"},"change_message_id":"1a6288e17bbf7588f7ac873df72c68cffa93e76d","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        self.sync()"},{"line_number":115,"context_line":"        self.nb_api.process_changes()"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def _submit_sync_event(self):"},{"line_number":118,"context_line":"        self.nb_api.db_change_callback(None, None, \u0027sync\u0027, None)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _register_models(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f201791_e08c1037","line":117,"updated":"2017-06-28 08:23:09.000000000","message":"maybe it\u0027s better to be called it inside the sync module - it\u0027s already hold the nb_api object ..","commit_id":"b0a5b3db9f3a9aab7d014bc63674be7f4a9afa58"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"834224666babc3a3a959cafd5f287e47004374bd","unresolved":false,"context_lines":[{"line_number":114,"context_line":"        self.sync()"},{"line_number":115,"context_line":"        self.nb_api.process_changes()"},{"line_number":116,"context_line":""},{"line_number":117,"context_line":"    def _submit_sync_event(self):"},{"line_number":118,"context_line":"        self.nb_api.db_change_callback(None, None, \u0027sync\u0027, None)"},{"line_number":119,"context_line":""},{"line_number":120,"context_line":"    def _register_models(self):"}],"source_content_type":"text/x-python","patch_set":8,"id":"5f201791_cb0b758b","line":117,"in_reply_to":"5f201791_e08c1037","updated":"2017-06-28 08:35:19.000000000","message":"The sync module does not handle scheduling, it only does synchronization. The controller ultimately decides how often to sync its resources.","commit_id":"b0a5b3db9f3a9aab7d014bc63674be7f4a9afa58"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ed1e2cc45deeba403220ea4aa0b27f9603f94ca4","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                                             is_neutron_server\u003dFalse)"},{"line_number":89,"context_line":"        self.topology \u003d topology.Topology(self,"},{"line_number":90,"context_line":"                                          self.enable_selective_topo_dist)"},{"line_number":91,"context_line":"        loopingcall.FixedIntervalLoopingCall(self._submit_sync_event).start("},{"line_number":92,"context_line":"            interval\u003dcfg.CONF.df.db_sync_time,"},{"line_number":93,"context_line":"            initial_delay\u003dcfg.CONF.df.db_sync_time,"},{"line_number":94,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f201791_45362853","line":91,"range":{"start_line":91,"start_character":8,"end_line":91,"end_character":69},"updated":"2017-06-29 06:59:03.000000000","message":"nit: Maybe put the construction in the constructor?","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"262d9ccec60d7ec5d3628e478634fff3afae4f17","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                                             is_neutron_server\u003dFalse)"},{"line_number":89,"context_line":"        self.topology \u003d topology.Topology(self,"},{"line_number":90,"context_line":"                                          self.enable_selective_topo_dist)"},{"line_number":91,"context_line":"        loopingcall.FixedIntervalLoopingCall(self._submit_sync_event).start("},{"line_number":92,"context_line":"            interval\u003dcfg.CONF.df.db_sync_time,"},{"line_number":93,"context_line":"            initial_delay\u003dcfg.CONF.df.db_sync_time,"},{"line_number":94,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_697a0d89","line":91,"range":{"start_line":91,"start_character":8,"end_line":91,"end_character":69},"in_reply_to":"5f201791_45362853","updated":"2017-06-29 09:02:34.000000000","message":"Will do","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ed1e2cc45deeba403220ea4aa0b27f9603f94ca4","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    def sync(self, value\u003dNone):"},{"line_number":125,"context_line":"        if value \u003d\u003d \u0027full_sync\u0027:"},{"line_number":126,"context_line":"            self.db_store.clear()"},{"line_number":127,"context_line":"        self.register_chassis()  # FIXME (dimak) move elsewhere"},{"line_number":128,"context_line":"        self.topology.check_topology_info()"},{"line_number":129,"context_line":"        self._sync.sync()"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"5f201791_4584e8d2","line":127,"range":{"start_line":127,"start_character":33,"end_line":127,"end_character":63},"updated":"2017-06-29 06:59:03.000000000","message":"Why? And in any case, a bug would be more helpful here than a FIXME comment","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"262d9ccec60d7ec5d3628e478634fff3afae4f17","unresolved":false,"context_lines":[{"line_number":124,"context_line":"    def sync(self, value\u003dNone):"},{"line_number":125,"context_line":"        if value \u003d\u003d \u0027full_sync\u0027:"},{"line_number":126,"context_line":"            self.db_store.clear()"},{"line_number":127,"context_line":"        self.register_chassis()  # FIXME (dimak) move elsewhere"},{"line_number":128,"context_line":"        self.topology.check_topology_info()"},{"line_number":129,"context_line":"        self._sync.sync()"},{"line_number":130,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_a98dc57c","line":127,"range":{"start_line":127,"start_character":33,"end_line":127,"end_character":63},"in_reply_to":"5f201791_4584e8d2","updated":"2017-06-29 09:02:34.000000000","message":"We do not have to register ourselves more than once, the side effect of this is syncing all the nb chassis objects. This is done by sync facility from now on.\n\nWill move up to the initialization.","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"}],"dragonflow/controller/topology.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"544e65bf39d2594aeccfd58944223da2b4fc3dda","unresolved":false,"context_lines":[{"line_number":234,"context_line":"        if topic not in self.topic_subscribed:"},{"line_number":235,"context_line":"            LOG.info(\"Subscribe topic: %(topic)s by lport: %(id)s\","},{"line_number":236,"context_line":"                     {\"topic\": topic, \"id\": lport_id})"},{"line_number":237,"context_line":"            self.nb_api.subscriber.register_topic(topic)"},{"line_number":238,"context_line":"            self._pull_tenant_topology_from_db(topic)"},{"line_number":239,"context_line":"            self.topic_subscribed[topic] \u003d set([lport_id])"},{"line_number":240,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_0f95f686","line":237,"range":{"start_line":237,"start_character":35,"end_line":237,"end_character":49},"updated":"2017-06-19 07:33:11.000000000","message":"Don\u0027t we need to also register the topic with controller.sync?","commit_id":"b901e932ebda509fbe572a6992b2d64c8e90240d"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ed1e2cc45deeba403220ea4aa0b27f9603f94ca4","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        # set, which represents no topic is subscribed now."},{"line_number":292,"context_line":"        return set(self.topic_subscribed)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def _pull_tenant_topology_from_db(self, tenant_id):"},{"line_number":295,"context_line":"        self.controller.sync.add_topic(tenant_id)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    def _clear_tenant_topology(self, tenant_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f201791_c5f6b85d","line":294,"range":{"start_line":294,"start_character":0,"end_line":294,"end_character":55},"updated":"2017-06-29 06:59:03.000000000","message":"This method is no longer used","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"262d9ccec60d7ec5d3628e478634fff3afae4f17","unresolved":false,"context_lines":[{"line_number":291,"context_line":"        # set, which represents no topic is subscribed now."},{"line_number":292,"context_line":"        return set(self.topic_subscribed)"},{"line_number":293,"context_line":""},{"line_number":294,"context_line":"    def _pull_tenant_topology_from_db(self, tenant_id):"},{"line_number":295,"context_line":"        self.controller.sync.add_topic(tenant_id)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    def _clear_tenant_topology(self, tenant_id):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_c96c819e","line":294,"range":{"start_line":294,"start_character":0,"end_line":294,"end_character":55},"in_reply_to":"5f201791_c5f6b85d","updated":"2017-06-29 09:02:34.000000000","message":"Removing","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ed1e2cc45deeba403220ea4aa0b27f9603f94ca4","unresolved":false,"context_lines":[{"line_number":294,"context_line":"    def _pull_tenant_topology_from_db(self, tenant_id):"},{"line_number":295,"context_line":"        self.controller.sync.add_topic(tenant_id)"},{"line_number":296,"context_line":""},{"line_number":297,"context_line":"    def _clear_tenant_topology(self, tenant_id):"},{"line_number":298,"context_line":"        self.controller.sync.remove_topic(tenant_id)"},{"line_number":299,"context_line":""},{"line_number":300,"context_line":"    def _get_lport(self, port_id, topic\u003dNone):"}],"source_content_type":"text/x-python","patch_set":10,"id":"5f201791_859a0011","line":297,"range":{"start_line":297,"start_character":0,"end_line":297,"end_character":48},"updated":"2017-06-29 06:59:03.000000000","message":"Nor is this one","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"}],"dragonflow/db/api_nb.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"544e65bf39d2594aeccfd58944223da2b4fc3dda","unresolved":false,"context_lines":[{"line_number":116,"context_line":"        self.publisher.process_ha()"},{"line_number":117,"context_line":"        self.subscriber.process_ha()"},{"line_number":118,"context_line":"        if not self.is_neutron_server:"},{"line_number":119,"context_line":"            self.controller.sync.sync(full\u003dTrue)"},{"line_number":120,"context_line":""},{"line_number":121,"context_line":"    def _get_publisher(self):"},{"line_number":122,"context_line":"        if self.pub_sub_use_multiproc:"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_7207b119","line":119,"range":{"start_line":119,"start_character":0,"end_line":119,"end_character":48},"updated":"2017-06-19 07:33:11.000000000","message":"I think it\u0027s better to call a method on self.controller, rather than a method on an object within self.controller. self.controller is passed as an argument, and we should formalize the API at some point.","commit_id":"b901e932ebda509fbe572a6992b2d64c8e90240d"}],"dragonflow/db/sync.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"544e65bf39d2594aeccfd58944223da2b4fc3dda","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        self._topics.remove(topic)"},{"line_number":48,"context_line":"        self.sync()"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    def sync(self, full\u003dFalse, topics\u003dNone):"},{"line_number":51,"context_line":"        \u0027\u0027\u0027Syncs all the models for all relevant topics."},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"           The state of the Sync class holds pairs of \u003cmodel, topic\u003e and the"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_32c819a4","line":50,"range":{"start_line":50,"start_character":31,"end_line":50,"end_character":42},"updated":"2017-06-19 07:33:11.000000000","message":"I suggest removing this parameter, and adding an set_topics method that overrides self._topics. Otherwise this method has a strange side-effect.","commit_id":"b901e932ebda509fbe572a6992b2d64c8e90240d"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ed1e2cc45deeba403220ea4aa0b27f9603f94ca4","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        self._topics.remove(topic)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        # Reverse the model order, dependent objects deleted first"},{"line_number":64,"context_line":"        for model in self._models[::-1]:"},{"line_number":65,"context_line":"            if not issubclass(model, mixins.Topic):"},{"line_number":66,"context_line":"                continue"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_7d752b98","line":64,"range":{"start_line":64,"start_character":21,"end_line":64,"end_character":40},"updated":"2017-06-29 06:59:03.000000000","message":"Why not use reversed(), to make it more readable? Especially since you use it in a loop?","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"262d9ccec60d7ec5d3628e478634fff3afae4f17","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        self._topics.remove(topic)"},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"        # Reverse the model order, dependent objects deleted first"},{"line_number":64,"context_line":"        for model in self._models[::-1]:"},{"line_number":65,"context_line":"            if not issubclass(model, mixins.Topic):"},{"line_number":66,"context_line":"                continue"},{"line_number":67,"context_line":""}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_0994b943","line":64,"range":{"start_line":64,"start_character":21,"end_line":64,"end_character":40},"in_reply_to":"3f1d235d_7d752b98","updated":"2017-06-29 09:02:34.000000000","message":"Done","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ed1e2cc45deeba403220ea4aa0b27f9603f94ca4","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            self._update_model(model)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Reverse order when deleting objects"},{"line_number":79,"context_line":"        for model in self._models[::-1]:"},{"line_number":80,"context_line":"            self._cleanup_model(model)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _update_model(self, model):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_9d5fe70d","line":79,"range":{"start_line":79,"start_character":26,"end_line":79,"end_character":40},"updated":"2017-06-29 06:59:03.000000000","message":"Same here re: reversed?","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"262d9ccec60d7ec5d3628e478634fff3afae4f17","unresolved":false,"context_lines":[{"line_number":76,"context_line":"            self._update_model(model)"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"        # Reverse order when deleting objects"},{"line_number":79,"context_line":"        for model in self._models[::-1]:"},{"line_number":80,"context_line":"            self._cleanup_model(model)"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":"    def _update_model(self, model):"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_e9905d51","line":79,"range":{"start_line":79,"start_character":26,"end_line":79,"end_character":40},"in_reply_to":"3f1d235d_9d5fe70d","updated":"2017-06-29 09:02:34.000000000","message":"Done","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ed1e2cc45deeba403220ea4aa0b27f9603f94ca4","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                present_by_topic.setdefault(o.topic, []).append(o)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            for topic in self._topics:"},{"line_number":107,"context_line":"                # FIXME (dimak) can be avoided"},{"line_number":108,"context_line":"                desired \u003d self._nb_api.get_all(model, topic)"},{"line_number":109,"context_line":"                present \u003d present_by_topic.pop(topic, [])"},{"line_number":110,"context_line":"                self._cleanup_objects(desired, present)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_bd53c3e2","line":107,"range":{"start_line":107,"start_character":0,"end_line":107,"end_character":46},"updated":"2017-06-29 06:59:03.000000000","message":"Why? How?","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"262d9ccec60d7ec5d3628e478634fff3afae4f17","unresolved":false,"context_lines":[{"line_number":104,"context_line":"                present_by_topic.setdefault(o.topic, []).append(o)"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            for topic in self._topics:"},{"line_number":107,"context_line":"                # FIXME (dimak) can be avoided"},{"line_number":108,"context_line":"                desired \u003d self._nb_api.get_all(model, topic)"},{"line_number":109,"context_line":"                present \u003d present_by_topic.pop(topic, [])"},{"line_number":110,"context_line":"                self._cleanup_objects(desired, present)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_c90121b2","line":107,"range":{"start_line":107,"start_character":0,"end_line":107,"end_character":46},"in_reply_to":"3f1d235d_bd53c3e2","updated":"2017-06-29 09:02:34.000000000","message":"Will add comment","commit_id":"b4ca9219613febba456160297bca56ad8f07cac0"}],"dragonflow/tests/unit/test_app_base.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"ed1e2cc45deeba403220ea4aa0b27f9603f94ca4","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        nb_api \u003d api_nb.NbApi.get_instance(False)"},{"line_number":55,"context_line":"        self.controller \u003d df_local_controller.DfLocalController(\u0027fake_host\u0027,"},{"line_number":56,"context_line":"                                                                nb_api)"},{"line_number":57,"context_line":"        self.nb_api \u003d self.controller.nb_api \u003d mock.MagicMock()"},{"line_number":58,"context_line":"        self.vswitch_api \u003d self.controller.vswitch_api \u003d mock.MagicMock()"},{"line_number":59,"context_line":"        kwargs \u003d dict("},{"line_number":60,"context_line":"            nb_api\u003dself.controller.nb_api,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_fd201b4c","side":"PARENT","line":57,"updated":"2017-06-29 06:59:03.000000000","message":"Why remove this line?","commit_id":"96ff2887d2129916e2a64f398d72089193016377"},{"author":{"_account_id":23766,"name":"Dima Kuznetsov","email":"dima.kuznetsov@toganetworks.com","username":"dimak"},"change_message_id":"262d9ccec60d7ec5d3628e478634fff3afae4f17","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        nb_api \u003d api_nb.NbApi.get_instance(False)"},{"line_number":55,"context_line":"        self.controller \u003d df_local_controller.DfLocalController(\u0027fake_host\u0027,"},{"line_number":56,"context_line":"                                                                nb_api)"},{"line_number":57,"context_line":"        self.nb_api \u003d self.controller.nb_api \u003d mock.MagicMock()"},{"line_number":58,"context_line":"        self.vswitch_api \u003d self.controller.vswitch_api \u003d mock.MagicMock()"},{"line_number":59,"context_line":"        kwargs \u003d dict("},{"line_number":60,"context_line":"            nb_api\u003dself.controller.nb_api,"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f1d235d_89a0c9a7","side":"PARENT","line":57,"in_reply_to":"3f1d235d_fd201b4c","updated":"2017-06-29 09:02:34.000000000","message":"We already mock nb_api.get_instance(...) a few lines up, having a single mock for nb_api makes the tests easier.","commit_id":"96ff2887d2129916e2a64f398d72089193016377"}],"dragonflow/tests/unit/test_topology.py":[{"author":{"_account_id":20229,"name":"Omer Anson","email":"omer.anson@toganetworks.com","username":"oanson"},"change_message_id":"544e65bf39d2594aeccfd58944223da2b4fc3dda","unresolved":false,"context_lines":[{"line_number":68,"context_line":"            test_app_base.fake_ovs_port1)"},{"line_number":69,"context_line":"        self.controller._register_models()"},{"line_number":70,"context_line":""},{"line_number":71,"context_line":"    def _reset_refresher(self):"},{"line_number":72,"context_line":"        pass"},{"line_number":73,"context_line":""},{"line_number":74,"context_line":"    def test_vm_port_online_offline(self):"},{"line_number":75,"context_line":"        self.nb_api.get_all.side_effect \u003d nb_api_get_all_func("}],"source_content_type":"text/x-python","patch_set":3,"id":"7f231b9d_f2e4e13d","line":72,"range":{"start_line":71,"start_character":0,"end_line":72,"end_character":12},"updated":"2017-06-19 07:33:11.000000000","message":"Private method: May as well remove.","commit_id":"b901e932ebda509fbe572a6992b2d64c8e90240d"}]}
