)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"50bbb240dcd8784aea855f32cbe675f7af915f3b","unresolved":false,"context_lines":[{"line_number":12,"context_line":"through OVN distributed gateway ports."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"If multiple gateway chassis available for scheduling as candidates,"},{"line_number":15,"context_line":"then this patch schedules router gateway port on all of these chassis."},{"line_number":16,"context_line":"If only one gateway chassis is available, it schedules on only this"},{"line_number":17,"context_line":"chassis."},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"bf3e73b7_62857bad","line":15,"updated":"2017-08-07 20:13:07.000000000","message":"Isn\u0027t it limited to a max of 5?","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"1d7e44da64b20c322f1ce7708e69d99004b1f823","unresolved":false,"context_lines":[{"line_number":12,"context_line":"through OVN distributed gateway ports."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"If multiple gateway chassis available for scheduling as candidates,"},{"line_number":15,"context_line":"then this patch schedules router gateway port on all of these chassis."},{"line_number":16,"context_line":"If only one gateway chassis is available, it schedules on only this"},{"line_number":17,"context_line":"chassis."},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":7,"id":"9f436f4f_5883ac05","line":15,"in_reply_to":"bf3e73b7_62857bad","updated":"2017-08-08 08:38:21.000000000","message":"I will update","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"}],"networking_ovn/common/ovn_client.py":[{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"50bbb240dcd8784aea855f32cbe675f7af915f3b","unresolved":false,"context_lines":[{"line_number":710,"context_line":"            selected_chassis \u003d self._ovn_scheduler.select("},{"line_number":711,"context_line":"                self._nb_idl, self._sb_idl, lrouter_port_name)"},{"line_number":712,"context_line":"            if selected_chassis:"},{"line_number":713,"context_line":"                columns[\u0027gateway_chassis\u0027] \u003d selected_chassis"},{"line_number":714,"context_line":"        with self._nb_idl.transaction(check_error\u003dTrue) as txn:"},{"line_number":715,"context_line":"            txn.add(self._nb_idl.add_lrouter_port(name\u003dlrouter_port_name,"},{"line_number":716,"context_line":"                                                  lrouter\u003dlrouter,"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf3e73b7_80c86255","line":713,"updated":"2017-08-07 20:13:07.000000000","message":"Was it intentional to drop the use of the constant?  I like it better this way anyway :)\n\nAlso, should it be considered an error if scheduling fails?  It seems like something we should be failing a request for ...","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"0030338f16f9598080c40f3f4bf059cb9aa6f423","unresolved":false,"context_lines":[{"line_number":710,"context_line":"            selected_chassis \u003d self._ovn_scheduler.select("},{"line_number":711,"context_line":"                self._nb_idl, self._sb_idl, lrouter_port_name)"},{"line_number":712,"context_line":"            if selected_chassis:"},{"line_number":713,"context_line":"                columns[\u0027gateway_chassis\u0027] \u003d selected_chassis"},{"line_number":714,"context_line":"        with self._nb_idl.transaction(check_error\u003dTrue) as txn:"},{"line_number":715,"context_line":"            txn.add(self._nb_idl.add_lrouter_port(name\u003dlrouter_port_name,"},{"line_number":716,"context_line":"                                                  lrouter\u003dlrouter,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_d503da0e","line":713,"in_reply_to":"bf3e73b7_80c86255","updated":"2017-08-08 15:43:37.000000000","message":"\"Also, should it be considered an error if scheduling fails?  It seems like something we should be failing a request for ...\"\n\nMany functional tests in [1], which try to create router with gateway are failing if scheduling fails.  \n\nAs test_ovn_db_sync.py uses only OVN NBDB, chassis won\u0027t be  available, which fails _ovn_scheduler.select() and the router creation. So I prefer to add this change as a separate patch.\n\n[1] https://github.com/openstack/networking-ovn/blob/master/networking_ovn/tests/functional/test_ovn_db_sync.py\n\n\n\nCaptured traceback:\n~~~~~~~~~~~~~~~~~~~\n    Traceback (most recent call last):\n      File \"/opt/stack/networking-ovn/.tox/dsvm-functional/src/neutron/neutron/tests/base.py\", line 118, in func\n        return f(self, *args, **kwargs)\n      File \"/opt/stack/networking-ovn/.tox/dsvm-functional/src/neutron/neutron/tests/base.py\", line 118, in func\n        return f(self, *args, **kwargs)\n      File \"networking_ovn/tests/functional/test_ovn_db_sync.py\", line 1140, in test_ovn_nb_sync_repair_delete_ovn_nb_db\n        restart_ovsdb_processes\u003dTrue)\n      File \"networking_ovn/tests/functional/test_ovn_db_sync.py\", line 1115, in _test_ovn_nb_sync_helper\n        self._create_resources(restart_ovsdb_processes)\n      File \"networking_ovn/tests/functional/test_ovn_db_sync.py\", line 317, in _create_resources\n        \u0027subnet_id\u0027: e1_s1[\u0027subnet\u0027][\u0027id\u0027]}]}}})\n      File \"networking_ovn/l3/l3_ovn.py\", line 156, in create_router\n        router[\u0027id\u0027])\n      File \"/opt/stack/networking-ovn/.tox/dsvm-functional/lib/python2.7/site-packages/oslo_utils/excutils.py\", line 220, in __exit__\n        self.force_reraise()\n      File \"/opt/stack/networking-ovn/.tox/dsvm-functional/lib/python2.7/site-packages/oslo_utils/excutils.py\", line 196, in force_reraise\n        six.reraise(self.type_, self.value, self.tb)\n      File \"networking_ovn/l3/l3_ovn.py\", line 150, in create_router\n        self._ovn_client.create_router(router, networks\u003dnetworks)\n      File \"networking_ovn/common/ovn_client.py\", line 625, in create_router\n        self._add_router_ext_gw(context, router, networks)\n      File \"networking_ovn/common/ovn_client.py\", line 556, in _add_router_ext_gw\n        {\u0027id\u0027: port[\u0027id\u0027], \u0027name\u0027: lrouter_name, \u0027error\u0027: e})\n      File \"/opt/stack/networking-ovn/.tox/dsvm-functional/lib/python2.7/site-packages/oslo_utils/excutils.py\", line 220, in __exit__\n        self.force_reraise()\n      File \"/opt/stack/networking-ovn/.tox/dsvm-functional/lib/python2.7/site-packages/oslo_utils/excutils.py\", line 196, in force_reraise\n        six.reraise(self.type_, self.value, self.tb)\n      File \"networking_ovn/common/ovn_client.py\", line 550, in _add_router_ext_gw\n        self.create_router_port(router_id, port)\n      File \"networking_ovn/common/ovn_client.py\", line 717, in create_router_port\n        \"Scheduling for router gateway port failed.\"))\n    Exception: Scheduling for router gateway port failed.","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"1d7e44da64b20c322f1ce7708e69d99004b1f823","unresolved":false,"context_lines":[{"line_number":710,"context_line":"            selected_chassis \u003d self._ovn_scheduler.select("},{"line_number":711,"context_line":"                self._nb_idl, self._sb_idl, lrouter_port_name)"},{"line_number":712,"context_line":"            if selected_chassis:"},{"line_number":713,"context_line":"                columns[\u0027gateway_chassis\u0027] \u003d selected_chassis"},{"line_number":714,"context_line":"        with self._nb_idl.transaction(check_error\u003dTrue) as txn:"},{"line_number":715,"context_line":"            txn.add(self._nb_idl.add_lrouter_port(name\u003dlrouter_port_name,"},{"line_number":716,"context_line":"                                                  lrouter\u003dlrouter,"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_78931051","line":713,"in_reply_to":"bf3e73b7_80c86255","updated":"2017-08-08 08:38:21.000000000","message":"sure, I will consider","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"}],"networking_ovn/l3/l3_ovn_scheduler.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"025a436595479fca020739049e8522ebf932c07e","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    def select(self, nb_idl, sb_idl, gateway_name, candidates\u003dNone):"},{"line_number":84,"context_line":"        return self._schedule_gateway(nb_idl, sb_idl, gateway_name, candidates)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def _select_gateway_chassis(self, nb_idl, candidates):"},{"line_number":87,"context_line":"        candidates \u003d copy.deepcopy(candidates)"},{"line_number":88,"context_line":"        chassis \u003d []"},{"line_number":89,"context_line":"        while len(candidates) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_02251dab","line":86,"updated":"2017-08-03 12:51:49.000000000","message":"I\u0027m thinking that we should probably limit the number of chassis to which we schedule the gateway.\n\nBecause otherwise we will end up with very long actions on openflow.\n\nMay be 5 ? (I\u0027d introduce a constant somewhere here, and may be make it configurable if anybody asked in the future, but constant may work).","commit_id":"ef144bdc8c3a6667f3320d32dbeb41a03cdd7d5a"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"fe2e8208f7ce583742bf19c660289d61de01d70f","unresolved":false,"context_lines":[{"line_number":83,"context_line":"    def select(self, nb_idl, sb_idl, gateway_name, candidates\u003dNone):"},{"line_number":84,"context_line":"        return self._schedule_gateway(nb_idl, sb_idl, gateway_name, candidates)"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def _select_gateway_chassis(self, nb_idl, candidates):"},{"line_number":87,"context_line":"        candidates \u003d copy.deepcopy(candidates)"},{"line_number":88,"context_line":"        chassis \u003d []"},{"line_number":89,"context_line":"        while len(candidates) \u003e 0:"}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_c88b8fc0","line":86,"in_reply_to":"df3967d1_02251dab","updated":"2017-08-04 14:51:54.000000000","message":"ok, the minimum is already handled in L58 :)., so I added a trim for the max in L62, coming in next PS","commit_id":"ef144bdc8c3a6667f3320d32dbeb41a03cdd7d5a"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"50bbb240dcd8784aea855f32cbe675f7af915f3b","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # TODO(anilvenkata): If more candidates avaialable, then schedule"},{"line_number":55,"context_line":"        # on them also?"},{"line_number":56,"context_line":"        if existing_chassis and (not candidates or"},{"line_number":57,"context_line":"           not list(set(existing_chassis) - set(candidates))):"},{"line_number":58,"context_line":"            return existing_chassis"},{"line_number":59,"context_line":"        if not candidates:"},{"line_number":60,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf3e73b7_820dff3f","line":57,"updated":"2017-08-07 20:13:07.000000000","message":"I don\u0027t think list() is needed here.\n\nan empty vs. non-empty set should do the right thing here","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"a32068e4d21c048bc9f62f26bb32cc5199c0555b","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # TODO(anilvenkata): If more candidates avaialable, then schedule"},{"line_number":55,"context_line":"        # on them also?"},{"line_number":56,"context_line":"        if existing_chassis and (not candidates or"},{"line_number":57,"context_line":"           not list(set(existing_chassis) - set(candidates))):"},{"line_number":58,"context_line":"            return existing_chassis"},{"line_number":59,"context_line":"        if not candidates:"},{"line_number":60,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_5be9667e","line":57,"in_reply_to":"9f436f4f_389d8859","updated":"2017-08-08 09:13:57.000000000","message":"right!","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"1d7e44da64b20c322f1ce7708e69d99004b1f823","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        # TODO(anilvenkata): If more candidates avaialable, then schedule"},{"line_number":55,"context_line":"        # on them also?"},{"line_number":56,"context_line":"        if existing_chassis and (not candidates or"},{"line_number":57,"context_line":"           not list(set(existing_chassis) - set(candidates))):"},{"line_number":58,"context_line":"            return existing_chassis"},{"line_number":59,"context_line":"        if not candidates:"},{"line_number":60,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_389d8859","line":57,"in_reply_to":"bf3e73b7_820dff3f","updated":"2017-08-08 08:38:21.000000000","message":"I will check","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"50bbb240dcd8784aea855f32cbe675f7af915f3b","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            c \u003d random.choice(candidates)"},{"line_number":95,"context_line":"            candidates.remove(c)"},{"line_number":96,"context_line":"            chassis.append(c)"},{"line_number":97,"context_line":"        return chassis"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"class OVNGatewayLeastLoadedScheduler(OVNGatewayScheduler):"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf3e73b7_fd9a2cc3","line":97,"updated":"2017-08-07 20:13:07.000000000","message":"You can simplify this with:\n\n    chassis \u003d copy.deepcopy(candidates)\n    random.shuffle(chassis)\n    return chassis","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"1d7e44da64b20c322f1ce7708e69d99004b1f823","unresolved":false,"context_lines":[{"line_number":94,"context_line":"            c \u003d random.choice(candidates)"},{"line_number":95,"context_line":"            candidates.remove(c)"},{"line_number":96,"context_line":"            chassis.append(c)"},{"line_number":97,"context_line":"        return chassis"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":""},{"line_number":100,"context_line":"class OVNGatewayLeastLoadedScheduler(OVNGatewayScheduler):"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_78bc30bb","line":97,"in_reply_to":"bf3e73b7_fd9a2cc3","updated":"2017-08-08 08:38:21.000000000","message":"Thanks a lot. This really helps.","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"8c93a7c92f3b9fe42b9d35fe36bfa9e9de74eb2e","unresolved":false,"context_lines":[{"line_number":28,"context_line":"OVN_SCHEDULER_CHANCE \u003d \u0027chance\u0027"},{"line_number":29,"context_line":"OVN_SCHEDULER_LEAST_LOADED \u003d \u0027leastloaded\u0027"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"MAX_GW_CHASSIS \u003d 5"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f436f4f_831b29c8","line":31,"updated":"2017-08-15 16:16:59.000000000","message":"Where is this used ?","commit_id":"6ef3b75090fd7113c72c7150b11dbde557ccac0d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"fecc691147cc4c48d36b6c5c16a348793c398f19","unresolved":false,"context_lines":[{"line_number":28,"context_line":"OVN_SCHEDULER_CHANCE \u003d \u0027chance\u0027"},{"line_number":29,"context_line":"OVN_SCHEDULER_LEAST_LOADED \u003d \u0027leastloaded\u0027"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"MAX_GW_CHASSIS \u003d 5"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f436f4f_f5261968","line":31,"in_reply_to":"9f436f4f_831b29c8","updated":"2017-08-16 06:05:24.000000000","message":"Code using that was mistakenly removed in patchset 8. Thanks for finding this :)","commit_id":"6ef3b75090fd7113c72c7150b11dbde557ccac0d"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"b61c66a2a5807813c32ffe48eb6ead6141d2fe48","unresolved":false,"context_lines":[{"line_number":28,"context_line":"OVN_SCHEDULER_CHANCE \u003d \u0027chance\u0027"},{"line_number":29,"context_line":"OVN_SCHEDULER_LEAST_LOADED \u003d \u0027leastloaded\u0027"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":"MAX_GW_CHASSIS \u003d 5"},{"line_number":32,"context_line":""},{"line_number":33,"context_line":""},{"line_number":34,"context_line":"@six.add_metaclass(abc.ABCMeta)"}],"source_content_type":"text/x-python","patch_set":11,"id":"9f436f4f_57be05ff","line":31,"range":{"start_line":31,"start_character":0,"end_line":31,"end_character":18},"updated":"2017-08-16 10:24:56.000000000","message":"I know too many configuration options can cause a bit of confusion, but this may be one thing that we want to have as a config ? So people can configure the max number of chassis that will be scheduled onto ?\n\nIf that\u0027s the case we can do it in another patch anyway","commit_id":"d40470a51314fc0c60353c9882e0d2d44c9d2aa5"}],"networking_ovn/ovsdb/commands.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"a5c2942610bada88570e82f20959734c19438915","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def _add_gateway_chassis(idl, tables, txn, lrp_name, val):"},{"line_number":55,"context_line":"    try:"},{"line_number":56,"context_line":"        prio \u003d len(val)"},{"line_number":57,"context_line":"        uuid_list \u003d []"},{"line_number":58,"context_line":"        for chassis in val:"},{"line_number":59,"context_line":"            gwc_name \u003d \u0027%s_%s\u0027 % (lrp_name, chassis)"}],"source_content_type":"text/x-python","patch_set":2,"id":"df3967d1_fadc4f75","line":56,"updated":"2017-08-01 14:18:55.000000000","message":"why do you use len(val) for the prio?","commit_id":"f47beb51499f04b8bb4ae52f07c48fb7d96cc09b"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b8518620b56f16ae6e57cd0e84bdc0beb32a46a8","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def _add_gateway_chassis(idl, tables, txn, lrp_name, val):"},{"line_number":55,"context_line":"    try:"},{"line_number":56,"context_line":"        prio \u003d len(val)"},{"line_number":57,"context_line":"        uuid_list \u003d []"},{"line_number":58,"context_line":"        for chassis in val:"},{"line_number":59,"context_line":"            gwc_name \u003d \u0027%s_%s\u0027 % (lrp_name, chassis)"}],"source_content_type":"text/x-python","patch_set":2,"id":"df3967d1_5978e928","line":56,"in_reply_to":"df3967d1_fadc4f75","updated":"2017-08-02 11:22:34.000000000","message":"thanks for the explanation on IRC, you begin assigning highest prio, and then as you add them to the list you reduce prio until reaching 0","commit_id":"f47beb51499f04b8bb4ae52f07c48fb7d96cc09b"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"50bbb240dcd8784aea855f32cbe675f7af915f3b","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            prio \u003d prio - 1"},{"line_number":70,"context_line":"            uuid_list.append(gwc.uuid)"},{"line_number":71,"context_line":"        return \u0027gateway_chassis\u0027, uuid_list"},{"line_number":72,"context_line":"    except Exception:"},{"line_number":73,"context_line":"        chassis \u003d {ovn_const.OVN_GATEWAY_CHASSIS_KEY: val[0]}"},{"line_number":74,"context_line":"        return \u0027options\u0027, chassis"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bf3e73b7_7d7d1c1b","line":72,"updated":"2017-08-07 20:13:07.000000000","message":"I don\u0027t really like the catch-all exception here.  The error could have been something else other than the Gateway_Chassis table not being present.\n\nI\u0027d rather see an explicit check to see if the table exists first (via inspecting the idl or just the schema version number), then adapt behavior accordingly.  Then from there, handle errors.","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"a32068e4d21c048bc9f62f26bb32cc5199c0555b","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            prio \u003d prio - 1"},{"line_number":70,"context_line":"            uuid_list.append(gwc.uuid)"},{"line_number":71,"context_line":"        return \u0027gateway_chassis\u0027, uuid_list"},{"line_number":72,"context_line":"    except Exception:"},{"line_number":73,"context_line":"        chassis \u003d {ovn_const.OVN_GATEWAY_CHASSIS_KEY: val[0]}"},{"line_number":74,"context_line":"        return \u0027options\u0027, chassis"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_9bbd8e6a","line":72,"in_reply_to":"9f436f4f_1bf99e7f","updated":"2017-08-08 09:13:57.000000000","message":"I believe it\u0027s better if we inspect the schema to see if we have \"Gateway_Chassis\" table instead of relaying in versions :) (backport supportability, etc..)","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"c4e792ce98d9359e7b9ce4ca579a2357f5706d85","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            prio \u003d prio - 1"},{"line_number":70,"context_line":"            uuid_list.append(gwc.uuid)"},{"line_number":71,"context_line":"        return \u0027gateway_chassis\u0027, uuid_list"},{"line_number":72,"context_line":"    except Exception:"},{"line_number":73,"context_line":"        chassis \u003d {ovn_const.OVN_GATEWAY_CHASSIS_KEY: val[0]}"},{"line_number":74,"context_line":"        return \u0027options\u0027, chassis"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_1bf99e7f","line":72,"in_reply_to":"9f436f4f_98891428","updated":"2017-08-08 09:06:26.000000000","message":"For comparing versions I think can use distutils.version which already neutron is using [1] and [2]\n[1] https://github.com/openstack/neutron/blob/master/neutron/tests/common/helpers.py#L16\n[2] https://github.com/openstack/neutron/blob/master/neutron/tests/common/helpers.py#L238","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"0085041d49017bb9f5765fa86c38beb2bc73672e","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            prio \u003d prio - 1"},{"line_number":70,"context_line":"            uuid_list.append(gwc.uuid)"},{"line_number":71,"context_line":"        return \u0027gateway_chassis\u0027, uuid_list"},{"line_number":72,"context_line":"    except Exception:"},{"line_number":73,"context_line":"        chassis \u003d {ovn_const.OVN_GATEWAY_CHASSIS_KEY: val[0]}"},{"line_number":74,"context_line":"        return \u0027options\u0027, chassis"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_b18e33ce","line":72,"in_reply_to":"9f436f4f_9bbd8e6a","updated":"2017-08-08 10:20:11.000000000","message":"sure, Below sample code is working :)\n\n        for table in six.itervalues(self.idl._db.tables):\n            if table.name \u003d\u003d \u0027Gateway_Chassis\u0027:\n                for column in six.itervalues(table.columns):\n                    print(\"column \", column.name)\n            print(\" table \u003d \", table.name)","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"038cc6fac713a408bbe9a2d2132c4b3ac8003660","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            prio \u003d prio - 1"},{"line_number":70,"context_line":"            uuid_list.append(gwc.uuid)"},{"line_number":71,"context_line":"        return \u0027gateway_chassis\u0027, uuid_list"},{"line_number":72,"context_line":"    except Exception:"},{"line_number":73,"context_line":"        chassis \u003d {ovn_const.OVN_GATEWAY_CHASSIS_KEY: val[0]}"},{"line_number":74,"context_line":"        return \u0027options\u0027, chassis"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_d58d1a7c","line":72,"in_reply_to":"9f436f4f_b18e33ce","updated":"2017-08-08 15:13:06.000000000","message":"You\u0027re passing tables too here to, can\u0027t you just do\n\n\u0027Gateway_Chassis\u0027 in tables?","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"a4fc971138ca189932a5a5fc1dc313ee08187bf7","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            prio \u003d prio - 1"},{"line_number":70,"context_line":"            uuid_list.append(gwc.uuid)"},{"line_number":71,"context_line":"        return \u0027gateway_chassis\u0027, uuid_list"},{"line_number":72,"context_line":"    except Exception:"},{"line_number":73,"context_line":"        chassis \u003d {ovn_const.OVN_GATEWAY_CHASSIS_KEY: val[0]}"},{"line_number":74,"context_line":"        return \u0027options\u0027, chassis"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_b55f36e4","line":72,"in_reply_to":"9f436f4f_d58d1a7c","updated":"2017-08-08 15:16:39.000000000","message":"sure, thanks Miguel","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"1d7e44da64b20c322f1ce7708e69d99004b1f823","unresolved":false,"context_lines":[{"line_number":69,"context_line":"            prio \u003d prio - 1"},{"line_number":70,"context_line":"            uuid_list.append(gwc.uuid)"},{"line_number":71,"context_line":"        return \u0027gateway_chassis\u0027, uuid_list"},{"line_number":72,"context_line":"    except Exception:"},{"line_number":73,"context_line":"        chassis \u003d {ovn_const.OVN_GATEWAY_CHASSIS_KEY: val[0]}"},{"line_number":74,"context_line":"        return \u0027options\u0027, chassis"},{"line_number":75,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_98891428","line":72,"in_reply_to":"bf3e73b7_7d7d1c1b","updated":"2017-08-08 08:38:21.000000000","message":"Thanks Russell\nI can get the ovn-nb schema version with self.idl._db.version\n\ndef l3ha_gateway_chassis_supported()\n   return  (self.idl._db.version is  above or equal to 5.7.0)\n\nAs gateway_chassis is added in 5.7.0 version, I will re-implement it like below\nif l3ha_gateway_chassis_supported():\n    use gateway_chassis table.\nelse\n    use chassis_redirect","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"e3e7b2eaaba56e375ce1df9e76c94d5297306b68","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    return uuids"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def _add_gateway_chassis(idl, gateway_chassis, txn, lrp_name, val):"},{"line_number":55,"context_line":"    if gateway_chassis:"},{"line_number":56,"context_line":"        prio \u003d len(val)"},{"line_number":57,"context_line":"        uuid_list \u003d []"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f436f4f_d1cbce50","line":54,"updated":"2017-08-09 14:12:34.000000000","message":"nitpicking: The parameters look confusing, can\u0027t we just pass the api, and grab the idl and the gateway_chassis from api?","commit_id":"b119294727afce6031ae9eb2596a793ba4f1139a"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"88d53eccbabf3569ed2ac476e85b95af7f30c0b6","unresolved":false,"context_lines":[{"line_number":51,"context_line":"    return uuids"},{"line_number":52,"context_line":""},{"line_number":53,"context_line":""},{"line_number":54,"context_line":"def _add_gateway_chassis(idl, gateway_chassis, txn, lrp_name, val):"},{"line_number":55,"context_line":"    if gateway_chassis:"},{"line_number":56,"context_line":"        prio \u003d len(val)"},{"line_number":57,"context_line":"        uuid_list \u003d []"}],"source_content_type":"text/x-python","patch_set":8,"id":"9f436f4f_d1b18e91","line":54,"in_reply_to":"9f436f4f_d1cbce50","updated":"2017-08-09 14:22:22.000000000","message":"Thanks Miguel. That makes sense. I am fine if you are submitting new patchset.","commit_id":"b119294727afce6031ae9eb2596a793ba4f1139a"}],"networking_ovn/ovsdb/impl_idl_ovn.py":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"b8518620b56f16ae6e57cd0e84bdc0beb32a46a8","unresolved":false,"context_lines":[{"line_number":320,"context_line":"            for uuid in lrp.gateway_chassis:"},{"line_number":321,"context_line":"                gwc \u003d idlutils.row_by_value("},{"line_number":322,"context_line":"                    self.idl, \u0027Gateway_Chassis\u0027, \u0027_uuid\u0027, uuid)"},{"line_number":323,"context_line":"                # (anilvenkata): Add to the list based on priority."},{"line_number":324,"context_line":"                # Otherwise, if lrp1 is scheduled on c1 with priority 1 and c2"},{"line_number":325,"context_line":"                # with priority 2. When new port lrp2 is scheduled, it is also"},{"line_number":326,"context_line":"                # scheduled on c1 with priority 1 and c2 with priority 2."}],"source_content_type":"text/x-python","patch_set":2,"id":"df3967d1_99a3f19e","line":323,"updated":"2017-08-02 11:22:34.000000000","message":"NOTE(anilvenkata):","commit_id":"f47beb51499f04b8bb4ae52f07c48fb7d96cc09b"},{"author":{"_account_id":1561,"name":"Russell Bryant","email":"rbryant@redhat.com","username":"russellb"},"change_message_id":"50bbb240dcd8784aea855f32cbe675f7af915f3b","unresolved":false,"context_lines":[{"line_number":328,"context_line":"                # If we add to the list based on priority then it will be"},{"line_number":329,"context_line":"                # scheduled on c1 with priority 2 and on c2 with priority 1."},{"line_number":330,"context_line":"                chassis.append(gwc.chassis_name)"},{"line_number":331,"context_line":"        except Exception:"},{"line_number":332,"context_line":"            pass"},{"line_number":333,"context_line":"        if not chassis:"},{"line_number":334,"context_line":"            rc \u003d lrp.options.get(ovn_const.OVN_GATEWAY_CHASSIS_KEY)"}],"source_content_type":"text/x-python","patch_set":7,"id":"bf3e73b7_ddbc08bd","line":331,"updated":"2017-08-07 20:13:07.000000000","message":"I think this exception case is too broad.  I\u0027d actually rather see a more explicit check for which strategy to use by checking for the table or checking the schema version ahead of time.\n\nIf not, I\u0027d at least rather see a more explicit exception check so that we know if it\u0027s a real error vs. the schema version issue.","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"a32068e4d21c048bc9f62f26bb32cc5199c0555b","unresolved":false,"context_lines":[{"line_number":328,"context_line":"                # If we add to the list based on priority then it will be"},{"line_number":329,"context_line":"                # scheduled on c1 with priority 2 and on c2 with priority 1."},{"line_number":330,"context_line":"                chassis.append(gwc.chassis_name)"},{"line_number":331,"context_line":"        except Exception:"},{"line_number":332,"context_line":"            pass"},{"line_number":333,"context_line":"        if not chassis:"},{"line_number":334,"context_line":"            rc \u003d lrp.options.get(ovn_const.OVN_GATEWAY_CHASSIS_KEY)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_fbadba31","line":331,"in_reply_to":"9f436f4f_9830f409","updated":"2017-08-08 09:13:57.000000000","message":"can we check for the table instead? (see my comment)","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"0085041d49017bb9f5765fa86c38beb2bc73672e","unresolved":false,"context_lines":[{"line_number":328,"context_line":"                # If we add to the list based on priority then it will be"},{"line_number":329,"context_line":"                # scheduled on c1 with priority 2 and on c2 with priority 1."},{"line_number":330,"context_line":"                chassis.append(gwc.chassis_name)"},{"line_number":331,"context_line":"        except Exception:"},{"line_number":332,"context_line":"            pass"},{"line_number":333,"context_line":"        if not chassis:"},{"line_number":334,"context_line":"            rc \u003d lrp.options.get(ovn_const.OVN_GATEWAY_CHASSIS_KEY)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_71c20bec","line":331,"in_reply_to":"9f436f4f_fbadba31","updated":"2017-08-08 10:20:11.000000000","message":"yes","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"1d7e44da64b20c322f1ce7708e69d99004b1f823","unresolved":false,"context_lines":[{"line_number":328,"context_line":"                # If we add to the list based on priority then it will be"},{"line_number":329,"context_line":"                # scheduled on c1 with priority 2 and on c2 with priority 1."},{"line_number":330,"context_line":"                chassis.append(gwc.chassis_name)"},{"line_number":331,"context_line":"        except Exception:"},{"line_number":332,"context_line":"            pass"},{"line_number":333,"context_line":"        if not chassis:"},{"line_number":334,"context_line":"            rc \u003d lrp.options.get(ovn_const.OVN_GATEWAY_CHASSIS_KEY)"}],"source_content_type":"text/x-python","patch_set":7,"id":"9f436f4f_9830f409","line":331,"in_reply_to":"bf3e73b7_ddbc08bd","updated":"2017-08-08 08:38:21.000000000","message":"I will use version check as explained in my previous comment","commit_id":"2cbfdbc90e4b829cfcbca697834992ded55ae91d"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"8c93a7c92f3b9fe42b9d35fe36bfa9e9de74eb2e","unresolved":false,"context_lines":[{"line_number":363,"context_line":"            if not lrp.name.startswith(\u0027lrp-\u0027):"},{"line_number":364,"context_line":"                continue"},{"line_number":365,"context_line":"            chassis \u003d self._get_logical_router_port_gateway_chassis(lrp)"},{"line_number":366,"context_line":"            if not chassis:"},{"line_number":367,"context_line":"                # Not a gateway router"},{"line_number":368,"context_line":"                continue"},{"line_number":369,"context_line":"            # TODO(azbiswas): Handle the case when a chassis is no"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f436f4f_8070bf09","line":366,"updated":"2017-08-15 16:16:59.000000000","message":"This seems unnecessary","commit_id":"6ef3b75090fd7113c72c7150b11dbde557ccac0d"},{"author":{"_account_id":10237,"name":"Numan Siddique","email":"nusiddiq@redhat.com","username":"numansiddique"},"change_message_id":"8c93a7c92f3b9fe42b9d35fe36bfa9e9de74eb2e","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            # TODO(azbiswas): Handle the case when a chassis is no"},{"line_number":370,"context_line":"            # longer valid. This may involve moving conntrack states,"},{"line_number":371,"context_line":"            # so it needs to discussed in the OVN community first."},{"line_number":372,"context_line":"            for chassis_name in chassis:"},{"line_number":373,"context_line":"                if (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":374,"context_line":"                        chassis_name not in valid_chassis_list):"},{"line_number":375,"context_line":"                    unhosted_gateways[lrp.name] \u003d lrp.options"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f436f4f_205b5387","line":372,"updated":"2017-08-15 16:16:59.000000000","message":"nit: Instead of L366, you can have\nfor chassis_name in chassis or []:\n...","commit_id":"6ef3b75090fd7113c72c7150b11dbde557ccac0d"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"fecc691147cc4c48d36b6c5c16a348793c398f19","unresolved":false,"context_lines":[{"line_number":369,"context_line":"            # TODO(azbiswas): Handle the case when a chassis is no"},{"line_number":370,"context_line":"            # longer valid. This may involve moving conntrack states,"},{"line_number":371,"context_line":"            # so it needs to discussed in the OVN community first."},{"line_number":372,"context_line":"            for chassis_name in chassis:"},{"line_number":373,"context_line":"                if (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":374,"context_line":"                        chassis_name not in valid_chassis_list):"},{"line_number":375,"context_line":"                    unhosted_gateways[lrp.name] \u003d lrp.options"}],"source_content_type":"text/x-python","patch_set":9,"id":"9f436f4f_751a2917","line":372,"in_reply_to":"9f436f4f_205b5387","updated":"2017-08-16 06:05:24.000000000","message":"I left the existing code as is instead of enhancing :) Will do it now. Thanks","commit_id":"6ef3b75090fd7113c72c7150b11dbde557ccac0d"}]}
