)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e3818d867224d307b0bafc196de5a59adbccc580","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Support for Router Scheduling on new G/W"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"L3HA Rescheduling of gateways when chassis are added"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"ToDo: Test cases, Documentation and Prioritizing Chassis for select()"},{"line_number":12,"context_line":"Change-Id: I0d96efe4ceef4168039930738285c19d5c003951"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f79a3b5_c709b731","line":9,"updated":"2018-08-20 08:26:52.000000000","message":"and removed.\nSome more explanation would be nice in the commit message even though you\u0027re pointing to the bug number which includes additional info.","commit_id":"ba8468c38a334e2a7a5da75f93f5c2473d1e3943"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"4f6b3b3365d3359d43e5a96e5e4b2b1078afc904","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Support for Router Scheduling on new G/W"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"L3HA Rescheduling of gateways when chassis are added"},{"line_number":10,"context_line":""},{"line_number":11,"context_line":"ToDo: Test cases, Documentation and Prioritizing Chassis for select()"},{"line_number":12,"context_line":"Change-Id: I0d96efe4ceef4168039930738285c19d5c003951"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"3f79a3b5_fb700adf","line":9,"in_reply_to":"3f79a3b5_c709b731","updated":"2018-08-20 11:25:18.000000000","message":"Will do that","commit_id":"ba8468c38a334e2a7a5da75f93f5c2473d1e3943"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Support for Router Scheduling on addition/removal of chassis"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The following patch provides L3HA Rescheduling of gateways when chassis"},{"line_number":10,"context_line":"are added/removed. It reschedules the gateway ports when a new chassis"},{"line_number":11,"context_line":"is added/old one removed. However, the number of chassis where a"},{"line_number":12,"context_line":"gateway can be hosted is limited by the constant MAX_GW_CHASSIS."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Trivial Change: Debug logging information is added to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"dfbec78f_a6ab4dd4","line":11,"range":{"start_line":9,"start_character":0,"end_line":11,"end_character":25},"updated":"2019-05-07 12:17:13.000000000","message":"nit: Those two sentences say the same thing, don\u0027t they? :)","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Support for Router Scheduling on addition/removal of chassis"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The following patch provides L3HA Rescheduling of gateways when chassis"},{"line_number":10,"context_line":"are added/removed. It reschedules the gateway ports when a new chassis"},{"line_number":11,"context_line":"is added/old one removed. However, the number of chassis where a"},{"line_number":12,"context_line":"gateway can be hosted is limited by the constant MAX_GW_CHASSIS."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Trivial Change: Debug logging information is added to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"dfbec78f_818873c6","line":11,"range":{"start_line":9,"start_character":0,"end_line":11,"end_character":25},"in_reply_to":"dfbec78f_a6ab4dd4","updated":"2019-05-07 14:07:28.000000000","message":"I was being extra descriptive... fixing it","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"}],"doc/source/admin/routing.rst":[{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"badcc770c4bf3332e076d6f7ac1aa8b7a03f7732","unresolved":false,"context_lines":[{"line_number":43,"context_line":"network attached to the router it will schedule the router gateway port"},{"line_number":44,"context_line":"to multiple chassis, making use of the ``gateway_chassis`` column on OVN\u0027s"},{"line_number":45,"context_line":"``Logical_Router_Port`` table."},{"line_number":46,"context_line":"However, in order to have external connectivity, gateway nodes should have"},{"line_number":47,"context_line":"``ovn-cms-options`` with the value ``enable-chassis-as-gw`` in Open_vSwitch"},{"line_number":48,"context_line":"table\u0027s external_ids column,"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"for example:"},{"line_number":51,"context_line":" .. code-block:: console"}],"source_content_type":"text/x-rst","patch_set":10,"id":"3f79a3b5_a11eae71","line":48,"range":{"start_line":46,"start_character":0,"end_line":48,"end_character":28},"updated":"2018-09-03 12:54:34.000000000","message":"That\u0027s not completely correct, for example, if no chassis is marked with that, all of them are considered to be gw chassis.\n\nI would say \"However, to be considered gateway node, the chassis should have .....\" , \".... but please note that if no chassis has such flag, any chassis will be a valid gateway chassis\"","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"59aed51b8b7b6195efef7796f1eba69359d48932","unresolved":false,"context_lines":[{"line_number":43,"context_line":"network attached to the router it will schedule the router gateway port"},{"line_number":44,"context_line":"to multiple chassis, making use of the ``gateway_chassis`` column on OVN\u0027s"},{"line_number":45,"context_line":"``Logical_Router_Port`` table."},{"line_number":46,"context_line":"However, in order to have external connectivity, gateway nodes should have"},{"line_number":47,"context_line":"``ovn-cms-options`` with the value ``enable-chassis-as-gw`` in Open_vSwitch"},{"line_number":48,"context_line":"table\u0027s external_ids column,"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"for example:"},{"line_number":51,"context_line":" .. code-block:: console"}],"source_content_type":"text/x-rst","patch_set":10,"id":"3f79a3b5_8e2cd399","line":48,"range":{"start_line":46,"start_character":0,"end_line":48,"end_character":28},"in_reply_to":"3f79a3b5_a11eae71","updated":"2018-09-05 09:56:58.000000000","message":"I am just wondering the advantage of this behavior. Why should all the chassis be considered as valid gateway chassis if no chassis has the flag.","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"ed718787ae0b81eca94a9475ed03ce67bac3afc9","unresolved":false,"context_lines":[{"line_number":53,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":56,"context_line":"during addition/deletion of chassis."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"At the low level, functionality is all implemented mostly by OpenFlow rules"},{"line_number":59,"context_line":"with bundle active_passive outputs. The ARP responder and router"}],"source_content_type":"text/x-rst","patch_set":10,"id":"3f79a3b5_a6ab241c","line":56,"updated":"2018-09-03 09:03:10.000000000","message":"Perhaps a subsection explaining what happens upon addition/removal of chassis? ie. a rebalance will occur but minimizing the amount of routers w/ highest prio failed over... what do you think?","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f428d8467b2e98696877f6cd77f6e82092a479cf","unresolved":false,"context_lines":[{"line_number":53,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":56,"context_line":"during addition/deletion of chassis."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"At the low level, functionality is all implemented mostly by OpenFlow rules"},{"line_number":59,"context_line":"with bundle active_passive outputs. The ARP responder and router"}],"source_content_type":"text/x-rst","patch_set":10,"id":"3f79a3b5_d76eda2a","line":56,"in_reply_to":"3f79a3b5_0119a286","updated":"2018-09-05 09:58:21.000000000","message":"Done","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"badcc770c4bf3332e076d6f7ac1aa8b7a03f7732","unresolved":false,"context_lines":[{"line_number":53,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":56,"context_line":"during addition/deletion of chassis."},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"At the low level, functionality is all implemented mostly by OpenFlow rules"},{"line_number":59,"context_line":"with bundle active_passive outputs. The ARP responder and router"}],"source_content_type":"text/x-rst","patch_set":10,"id":"3f79a3b5_0119a286","line":56,"in_reply_to":"3f79a3b5_a6ab241c","updated":"2018-09-03 12:54:34.000000000","message":"+1 :D","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"1e26b27118e8b400f042289c31c7f1859ae79e97","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":56,"context_line":"during addition/deletion of chassis.This is because of rebalancing of the"},{"line_number":57,"context_line":"gateway ports across the available chassis might render the gateway ports"},{"line_number":58,"context_line":"unusable for some time."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"At the low level, functionality is all implemented mostly by OpenFlow rules"},{"line_number":61,"context_line":"with bundle active_passive outputs. The ARP responder and router"}],"source_content_type":"text/x-rst","patch_set":12,"id":"3f79a3b5_5b173747","line":58,"range":{"start_line":57,"start_character":43,"end_line":58,"end_character":23},"updated":"2018-10-02 13:28:13.000000000","message":"This is scary :) Perhaps we should lay out some numbers and which conditions can cause the downtime to happen.\nOr perhaps we should include the \"don\u0027t reschedule if master for now\" policy in this patch.\nLet\u0027s see what others think.","commit_id":"c288c72e0e4930436f792f2b11735d0d511e8fde"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7e9d583d0a11214412c4359c28e86c5b1c3c37b8","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":56,"context_line":"during addition/deletion of chassis.This is because of rebalancing of the"},{"line_number":57,"context_line":"gateway ports across the available chassis might render the gateway ports"},{"line_number":58,"context_line":"unusable for some time."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"At the low level, functionality is all implemented mostly by OpenFlow rules"},{"line_number":61,"context_line":"with bundle active_passive outputs. The ARP responder and router"}],"source_content_type":"text/x-rst","patch_set":12,"id":"3fce034c_8ea2de99","line":58,"range":{"start_line":57,"start_character":43,"end_line":58,"end_character":23},"in_reply_to":"3f79a3b5_4901ae03","updated":"2019-04-15 07:40:39.000000000","message":"quoted above","commit_id":"c288c72e0e4930436f792f2b11735d0d511e8fde"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"7e9d583d0a11214412c4359c28e86c5b1c3c37b8","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":56,"context_line":"during addition/deletion of chassis.This is because of rebalancing of the"},{"line_number":57,"context_line":"gateway ports across the available chassis might render the gateway ports"},{"line_number":58,"context_line":"unusable for some time."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"At the low level, functionality is all implemented mostly by OpenFlow rules"},{"line_number":61,"context_line":"with bundle active_passive outputs. The ARP responder and router"}],"source_content_type":"text/x-rst","patch_set":12,"id":"3fce034c_ce98e66b","line":58,"range":{"start_line":57,"start_character":43,"end_line":58,"end_character":23},"in_reply_to":"3f79a3b5_5b173747","updated":"2019-04-15 07:40:39.000000000","message":"I agree with the concept of \" dont schedule if master\" policy. That would also avoid Miguel\u0027s cause of concern in the below comment.\nAwaiting response from oters","commit_id":"c288c72e0e4930436f792f2b11735d0d511e8fde"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"36f2dd01c0c892ca3da08ae21ed87b851615250f","unresolved":false,"context_lines":[{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":56,"context_line":"during addition/deletion of chassis.This is because of rebalancing of the"},{"line_number":57,"context_line":"gateway ports across the available chassis might render the gateway ports"},{"line_number":58,"context_line":"unusable for some time."},{"line_number":59,"context_line":""},{"line_number":60,"context_line":"At the low level, functionality is all implemented mostly by OpenFlow rules"},{"line_number":61,"context_line":"with bundle active_passive outputs. The ARP responder and router"}],"source_content_type":"text/x-rst","patch_set":12,"id":"3f79a3b5_4901ae03","line":58,"range":{"start_line":57,"start_character":43,"end_line":58,"end_character":23},"in_reply_to":"3f79a3b5_5b173747","updated":"2018-10-02 16:21:54.000000000","message":"We also need to minimize that as much as possible by not moving unnecessary associations.","commit_id":"c288c72e0e4930436f792f2b11735d0d511e8fde"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e33ab546f5fb7e21b0c8866363c1c0882f614709","unresolved":false,"context_lines":[{"line_number":44,"context_line":"to multiple chassis, making use of the ``gateway_chassis`` column on OVN\u0027s"},{"line_number":45,"context_line":"``Logical_Router_Port`` table."},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"However, in order to have external connectivity, gateway nodes should have"},{"line_number":48,"context_line":"``ovn-cms-options`` with the value ``enable-chassis-as-gw`` in Open_vSwitch"},{"line_number":49,"context_line":"table\u0027s external_ids column,"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"for example:"},{"line_number":52,"context_line":" .. code-block:: console"}],"source_content_type":"text/x-rst","patch_set":23,"id":"dfbec78f_93c5085e","line":49,"range":{"start_line":47,"start_character":0,"end_line":49,"end_character":28},"updated":"2019-05-09 09:47:34.000000000","message":"This is not strictly right.\nA node can have external connectivity without having that external id. If no chassis have such extid, they\u0027ll be eligible to host a gw based on the bridge mappings.","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"395be7734a1d6fe230c0570d625ab885599c390d","unresolved":false,"context_lines":[{"line_number":44,"context_line":"to multiple chassis, making use of the ``gateway_chassis`` column on OVN\u0027s"},{"line_number":45,"context_line":"``Logical_Router_Port`` table."},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"However, in order to have external connectivity, gateway nodes should have"},{"line_number":48,"context_line":"``ovn-cms-options`` with the value ``enable-chassis-as-gw`` in Open_vSwitch"},{"line_number":49,"context_line":"table\u0027s external_ids column,"},{"line_number":50,"context_line":""},{"line_number":51,"context_line":"for example:"},{"line_number":52,"context_line":" .. code-block:: console"}],"source_content_type":"text/x-rst","patch_set":23,"id":"dfbec78f_b6227a51","line":49,"range":{"start_line":47,"start_character":0,"end_line":49,"end_character":28},"in_reply_to":"dfbec78f_93c5085e","updated":"2019-05-09 10:28:50.000000000","message":"Ok, I will update this information to showcase both options","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e33ab546f5fb7e21b0c8866363c1c0882f614709","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":57,"context_line":"during addition/deletion of chassis.This is because of rebalancing of the"},{"line_number":58,"context_line":"gateway ports across the available chassis might render the gateway ports"},{"line_number":59,"context_line":"unusable for some time."},{"line_number":60,"context_line":""}],"source_content_type":"text/x-rst","patch_set":23,"id":"dfbec78f_f3ab2486","line":57,"range":{"start_line":56,"start_character":6,"end_line":57,"end_character":35},"updated":"2019-05-09 09:47:34.000000000","message":"This is not correct anymore after your split right?","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e33ab546f5fb7e21b0c8866363c1c0882f614709","unresolved":false,"context_lines":[{"line_number":54,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":57,"context_line":"during addition/deletion of chassis.This is because of rebalancing of the"},{"line_number":58,"context_line":"gateway ports across the available chassis might render the gateway ports"},{"line_number":59,"context_line":"unusable for some time."},{"line_number":60,"context_line":""}],"source_content_type":"text/x-rst","patch_set":23,"id":"dfbec78f_b395ac42","line":57,"range":{"start_line":57,"start_character":36,"end_line":57,"end_character":37},"updated":"2019-05-09 09:47:34.000000000","message":"missing ws","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4ff2831e0046b9fd45bdd9e5fc2717917b40bc63","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":57,"context_line":"during addition/deletion of chassis.This is because of rebalancing of the"},{"line_number":58,"context_line":"gateway ports across the available chassis might render the gateway ports"},{"line_number":59,"context_line":"unusable for some time."},{"line_number":60,"context_line":""}],"source_content_type":"text/x-rst","patch_set":23,"id":"dfbec78f_f670f2a7","line":57,"range":{"start_line":56,"start_character":6,"end_line":57,"end_character":35},"in_reply_to":"dfbec78f_f3ab2486","updated":"2019-05-09 10:34:46.000000000","message":"++ for addition at least.","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"395be7734a1d6fe230c0570d625ab885599c390d","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":57,"context_line":"during addition/deletion of chassis.This is because of rebalancing of the"},{"line_number":58,"context_line":"gateway ports across the available chassis might render the gateway ports"},{"line_number":59,"context_line":"unusable for some time."},{"line_number":60,"context_line":""}],"source_content_type":"text/x-rst","patch_set":23,"id":"dfbec78f_d61dae0f","line":57,"range":{"start_line":56,"start_character":6,"end_line":57,"end_character":35},"in_reply_to":"dfbec78f_f3ab2486","updated":"2019-05-09 10:28:50.000000000","message":"Umm, yeah. It would come back to existence once the Rebalance code is updated.","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"cb56e7395cccd9621c3f265277382f4f7d110355","unresolved":false,"context_lines":[{"line_number":53,"context_line":""},{"line_number":54,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""},{"line_number":55,"context_line":""},{"line_number":56,"context_line":"Also, do note that downtime can occur due to rescheduling of the gateway ports"},{"line_number":57,"context_line":"during addition/deletion of chassis.This is because of rebalancing of the"},{"line_number":58,"context_line":"gateway ports across the available chassis might render the gateway ports"},{"line_number":59,"context_line":"unusable for some time."},{"line_number":60,"context_line":""}],"source_content_type":"text/x-rst","patch_set":23,"id":"dfbec78f_d6092e31","line":57,"range":{"start_line":56,"start_character":6,"end_line":57,"end_character":35},"in_reply_to":"dfbec78f_f670f2a7","updated":"2019-05-09 10:57:12.000000000","message":"Would remove the line","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"for example:"},{"line_number":56,"context_line":" .. code-block:: console"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""}],"source_content_type":"text/x-rst","patch_set":25,"id":"dfbec78f_3ddcd5e2","line":55,"range":{"start_line":55,"start_character":0,"end_line":55,"end_character":1},"updated":"2019-05-14 16:23:24.000000000","message":"nit: For (capitalized)","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"for example:"},{"line_number":56,"context_line":" .. code-block:: console"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""}],"source_content_type":"text/x-rst","patch_set":25,"id":"dfbec78f_01a7220d","line":55,"range":{"start_line":55,"start_character":0,"end_line":55,"end_character":1},"in_reply_to":"dfbec78f_3ddcd5e2","updated":"2019-05-15 03:09:38.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":49,"context_line":"* Some gateway nodes have ``ovn-cms-options`` with the value"},{"line_number":50,"context_line":"  ``enable-chassis-as-gw`` in Open_vSwitch table\u0027s external_ids column, or"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"For example:"}],"source_content_type":"text/x-rst","patch_set":26,"id":"dfbec78f_a76f4629","line":52,"range":{"start_line":52,"start_character":28,"end_line":52,"end_character":37},"updated":"2019-05-15 09:13:18.000000000","message":"typo","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":49,"context_line":"* Some gateway nodes have ``ovn-cms-options`` with the value"},{"line_number":50,"context_line":"  ``enable-chassis-as-gw`` in Open_vSwitch table\u0027s external_ids column, or"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"For example:"}],"source_content_type":"text/x-rst","patch_set":26,"id":"dfbec78f_aa062b51","line":52,"range":{"start_line":52,"start_character":28,"end_line":52,"end_character":37},"in_reply_to":"dfbec78f_a76f4629","updated":"2019-05-15 09:26:43.000000000","message":"Will fix","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":50,"context_line":"  ``enable-chassis-as-gw`` in Open_vSwitch table\u0027s external_ids column, or"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"For example:"},{"line_number":56,"context_line":" .. code-block:: console"}],"source_content_type":"text/x-rst","patch_set":26,"id":"dfbec78f_6775cef9","line":53,"range":{"start_line":53,"start_character":42,"end_line":53,"end_character":70},"updated":"2019-05-15 09:13:18.000000000","message":"I don\u0027t understand what it means \"being eligible for bridge mapping\". Should it be something like \"eligible to becoming a gateway\"?","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":50,"context_line":"  ``enable-chassis-as-gw`` in Open_vSwitch table\u0027s external_ids column, or"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"For example:"},{"line_number":56,"context_line":" .. code-block:: console"}],"source_content_type":"text/x-rst","patch_set":26,"id":"dfbec78f_c76a7a18","line":53,"range":{"start_line":53,"start_character":9,"end_line":53,"end_character":24},"updated":"2019-05-15 09:13:18.000000000","message":"then","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":50,"context_line":"  ``enable-chassis-as-gw`` in Open_vSwitch table\u0027s external_ids column, or"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"For example:"},{"line_number":56,"context_line":" .. code-block:: console"}],"source_content_type":"text/x-rst","patch_set":26,"id":"dfbec78f_8a8c87d7","line":53,"range":{"start_line":53,"start_character":42,"end_line":53,"end_character":70},"in_reply_to":"dfbec78f_6775cef9","updated":"2019-05-15 09:26:43.000000000","message":"All nodes will be eligible to host gateway chassis","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":50,"context_line":"  ``enable-chassis-as-gw`` in Open_vSwitch table\u0027s external_ids column, or"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"For example:"},{"line_number":56,"context_line":" .. code-block:: console"}],"source_content_type":"text/x-rst","patch_set":26,"id":"dfbec78f_8af7a759","line":53,"range":{"start_line":53,"start_character":9,"end_line":53,"end_character":24},"in_reply_to":"dfbec78f_c76a7a18","updated":"2019-05-15 09:26:43.000000000","message":"done","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"For example:"},{"line_number":56,"context_line":" .. code-block:: console"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""}],"source_content_type":"text/x-rst","patch_set":26,"id":"dfbec78f_e79d3e0a","line":55,"range":{"start_line":55,"start_character":0,"end_line":55,"end_character":11},"updated":"2019-05-15 09:13:18.000000000","message":"Example how to enable gateway on the node.\n\nIt\u0027s not clear what this example provides.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":52,"context_line":"* if no gateway node exists with with the external ids column set with that"},{"line_number":53,"context_line":"  value, in which case, all nodes will be eligible for bridge mappings."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"For example:"},{"line_number":56,"context_line":" .. code-block:: console"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""}],"source_content_type":"text/x-rst","patch_set":26,"id":"dfbec78f_ea9d030a","line":55,"range":{"start_line":55,"start_character":0,"end_line":55,"end_character":11},"in_reply_to":"dfbec78f_e79d3e0a","updated":"2019-05-15 09:26:43.000000000","message":"Will fix","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"42186b07a637bb9b5e6d5af42755c890dc7e4abb","unresolved":false,"context_lines":[{"line_number":52,"context_line":"* if no gateway node exists with the external ids column set with that"},{"line_number":53,"context_line":"  value, then all nodes would be eligible to host gateway chassis."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Example to how to enabled chassis to host gateways:"},{"line_number":56,"context_line":" .. code-block:: console"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""}],"source_content_type":"text/x-rst","patch_set":31,"id":"bfb3d3c7_8203670f","line":55,"range":{"start_line":55,"start_character":18,"end_line":55,"end_character":25},"updated":"2019-05-23 10:57:09.000000000","message":"nit: enable","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"1ea8b35d00ff73f6857d2b01ebb8369b73c3f649","unresolved":false,"context_lines":[{"line_number":52,"context_line":"* if no gateway node exists with the external ids column set with that"},{"line_number":53,"context_line":"  value, then all nodes would be eligible to host gateway chassis."},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"Example to how to enabled chassis to host gateways:"},{"line_number":56,"context_line":" .. code-block:: console"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"  $ ovs-vsctl set open . external-ids:ovn-cms-options\u003d\"enable-chassis-as-gw\""}],"source_content_type":"text/x-rst","patch_set":31,"id":"bfb3d3c7_1dc83820","line":55,"range":{"start_line":55,"start_character":18,"end_line":55,"end_character":25},"in_reply_to":"bfb3d3c7_8203670f","updated":"2019-05-23 11:00:02.000000000","message":"eeks!","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"}],"networking_ovn/common/constants.py":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e3818d867224d307b0bafc196de5a59adbccc580","unresolved":false,"context_lines":[{"line_number":133,"context_line":"# task: Leaf ones first and roots at the end."},{"line_number":134,"context_line":"MAINTENANCE_DELETE_TYPE_ORDER \u003d {"},{"line_number":135,"context_line":"    t: n for n, t in enumerate(reversed(_TYPES_PRIORITY_ORDER), 1)}"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"MAX_GW_CHASSIS \u003d 5"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_a7f7dbd4","line":136,"updated":"2018-08-20 08:26:52.000000000","message":"As you\u0027re moving this to a common module it\u0027d be nice to drop a comment indicating that this is the maximum number of chassis where a gateway port is going to be scheduled.","commit_id":"ba8468c38a334e2a7a5da75f93f5c2473d1e3943"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"4f6b3b3365d3359d43e5a96e5e4b2b1078afc904","unresolved":false,"context_lines":[{"line_number":133,"context_line":"# task: Leaf ones first and roots at the end."},{"line_number":134,"context_line":"MAINTENANCE_DELETE_TYPE_ORDER \u003d {"},{"line_number":135,"context_line":"    t: n for n, t in enumerate(reversed(_TYPES_PRIORITY_ORDER), 1)}"},{"line_number":136,"context_line":""},{"line_number":137,"context_line":"MAX_GW_CHASSIS \u003d 5"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_9b7556cf","line":136,"in_reply_to":"3f79a3b5_a7f7dbd4","updated":"2018-08-20 11:25:18.000000000","message":"Ok, nice idea :)","commit_id":"ba8468c38a334e2a7a5da75f93f5c2473d1e3943"}],"networking_ovn/common/ovn_client.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"        candidates \u003d cms_bmaps or bmaps"},{"line_number":1088,"context_line":"        if not cms_bmaps:"},{"line_number":1089,"context_line":"            LOG.debug(\"No eligible chassis with external connectivity\""},{"line_number":1090,"context_line":"                      \" through ovn-cms-options for %s.\", physnet)"},{"line_number":1091,"context_line":"        LOG.debug(\"Chassis candidates with external connectivity: %s\","},{"line_number":1092,"context_line":"                  candidates)"},{"line_number":1093,"context_line":"        return candidates"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_67aaae19","line":1090,"range":{"start_line":1090,"start_character":47,"end_line":1090,"end_character":65},"updated":"2019-05-15 09:13:18.000000000","message":"nit: I\u0027d put this to a separate patch.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"        candidates \u003d cms_bmaps or bmaps"},{"line_number":1088,"context_line":"        if not cms_bmaps:"},{"line_number":1089,"context_line":"            LOG.debug(\"No eligible chassis with external connectivity\""},{"line_number":1090,"context_line":"                      \" through ovn-cms-options for %s.\", physnet)"},{"line_number":1091,"context_line":"        LOG.debug(\"Chassis candidates with external connectivity: %s\","},{"line_number":1092,"context_line":"                  candidates)"},{"line_number":1093,"context_line":"        return candidates"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_caafdf27","line":1090,"range":{"start_line":1090,"start_character":47,"end_line":1090,"end_character":65},"in_reply_to":"dfbec78f_67aaae19","updated":"2019-05-15 09:26:43.000000000","message":"I thought someone would point it out :)\nIs it a deal breaker though?\nI dont mind moving it to a second patch","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cae481ce8d5aab4f882c57f95857c8690fafea7f","unresolved":false,"context_lines":[{"line_number":1087,"context_line":"        candidates \u003d cms_bmaps or bmaps"},{"line_number":1088,"context_line":"        if not cms_bmaps:"},{"line_number":1089,"context_line":"            LOG.debug(\"No eligible chassis with external connectivity\""},{"line_number":1090,"context_line":"                      \" through ovn-cms-options for %s.\", physnet)"},{"line_number":1091,"context_line":"        LOG.debug(\"Chassis candidates with external connectivity: %s\","},{"line_number":1092,"context_line":"                  candidates)"},{"line_number":1093,"context_line":"        return candidates"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_f5a3a8fe","line":1090,"range":{"start_line":1090,"start_character":47,"end_line":1090,"end_character":65},"in_reply_to":"dfbec78f_caafdf27","updated":"2019-05-15 09:36:26.000000000","message":"No, not a big deal :) Just in case you want to backport the message to ease troubleshooting, you might not want to backport the whole scheduling feature. But feel free to leave it as is.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"}],"networking_ovn/common/utils.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":390,"context_line":"    return \u0027metadata-%s\u0027 % id_"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"def is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":394,"context_line":"                               physnet, chassis_physnets):"},{"line_number":395,"context_line":"    \"\"\"Check if gateway chassis is invalid"},{"line_number":396,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_4a7c4f82","line":393,"range":{"start_line":393,"start_character":4,"end_line":393,"end_character":30},"updated":"2019-05-15 09:13:18.000000000","message":"The unittests for this function are completely missing.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a4681a943fb3498f60191aaa50388a6d380bd9b0","unresolved":false,"context_lines":[{"line_number":390,"context_line":"    return \u0027metadata-%s\u0027 % id_"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"def is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":394,"context_line":"                               physnet, chassis_physnets):"},{"line_number":395,"context_line":"    \"\"\"Check if gateway chassis is invalid"},{"line_number":396,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_15b43cd0","line":393,"range":{"start_line":393,"start_character":4,"end_line":393,"end_character":30},"in_reply_to":"dfbec78f_4a69aff6","updated":"2019-05-15 10:10:36.000000000","message":"Done","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":390,"context_line":"    return \u0027metadata-%s\u0027 % id_"},{"line_number":391,"context_line":""},{"line_number":392,"context_line":""},{"line_number":393,"context_line":"def is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":394,"context_line":"                               physnet, chassis_physnets):"},{"line_number":395,"context_line":"    \"\"\"Check if gateway chassis is invalid"},{"line_number":396,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_4a69aff6","line":393,"range":{"start_line":393,"start_character":4,"end_line":393,"end_character":30},"in_reply_to":"dfbec78f_4a7c4f82","updated":"2019-05-15 09:26:43.000000000","message":"Hmm, Ok. I will add something for this","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"77223d381c09f847d4e5aa7e80db56c0065c7f43","unresolved":false,"context_lines":[{"line_number":405,"context_line":"    @return   Boolean"},{"line_number":406,"context_line":"    \"\"\""},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":409,"context_line":"    if chassis_name \u003d\u003d constants.OVN_GATEWAY_INVALID_CHASSIS:"},{"line_number":410,"context_line":"        return True"},{"line_number":411,"context_line":"    elif chassis_name not in valid_chassis_list:"}],"source_content_type":"text/x-python","patch_set":35,"id":"bfb3d3c7_a11f7459","line":408,"range":{"start_line":408,"start_character":0,"end_line":408,"end_character":47},"updated":"2019-05-24 09:27:22.000000000","message":"Do you actually need this?\n\n chassis_name not in chassis_physnets\n\nshould work too, no?","commit_id":"3d7dfa0f230d89732148ef2a9a769fff26f85fa2"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e79b6bf6444a0678079a20de2e8ea838f32dc035","unresolved":false,"context_lines":[{"line_number":405,"context_line":"    @return   Boolean"},{"line_number":406,"context_line":"    \"\"\""},{"line_number":407,"context_line":""},{"line_number":408,"context_line":"    valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":409,"context_line":"    if chassis_name \u003d\u003d constants.OVN_GATEWAY_INVALID_CHASSIS:"},{"line_number":410,"context_line":"        return True"},{"line_number":411,"context_line":"    elif chassis_name not in valid_chassis_list:"}],"source_content_type":"text/x-python","patch_set":35,"id":"bfb3d3c7_a442103d","line":408,"range":{"start_line":408,"start_character":0,"end_line":408,"end_character":47},"in_reply_to":"bfb3d3c7_a11f7459","updated":"2019-05-26 14:15:58.000000000","message":"Yep, it will. I guess I just carried over the previous code here.","commit_id":"3d7dfa0f230d89732148ef2a9a769fff26f85fa2"}],"networking_ovn/l3/l3_ovn.py":[{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"533fa80a745467f4fbba461655e81384b03d8f97","unresolved":false,"context_lines":[{"line_number":326,"context_line":"            # NOTE(dalvarez): Let\u0027s commit the changes in separate transactions"},{"line_number":327,"context_line":"            # as we will rely on those for scheduling subsequent gateways."},{"line_number":328,"context_line":"            chassis_info[g_name] \u003d chassis"},{"line_number":329,"context_line":"        self.scheduler.need_rebalance(self._ovn, chassis_info)"},{"line_number":330,"context_line":"        for g_name, chassis in chassis_info.items():"},{"line_number":331,"context_line":"            with self._ovn.transaction(check_error\u003dTrue) as txn:"},{"line_number":332,"context_line":"                txn.add((self._ovn.update_lrouter_port("}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_1da240fd","line":329,"range":{"start_line":329,"start_character":23,"end_line":329,"end_character":37},"updated":"2019-04-30 11:31:18.000000000","message":"While analyzing the code, I think the overall performance can be improved by identifying the rebalance required initially, and then rebalancing based on the current gateway being operated upon. It would require a counter,  but I think that can remove the second for loop.\n\nComments?","commit_id":"b688ba92df27176bea65fdc25c92cda1c823ddfd"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4ff2831e0046b9fd45bdd9e5fc2717917b40bc63","unresolved":false,"context_lines":[{"line_number":334,"context_line":"                    # since it doesnt take into account number of ports."},{"line_number":335,"context_line":"                    chassis[0], chassis[1] \u003d chassis[1], chassis[0]"},{"line_number":336,"context_line":"                elif count \u003d\u003d 2:"},{"line_number":337,"context_line":"                    master, path \u003d \\"},{"line_number":338,"context_line":"                        self._sb_ovn.get_logical_port_chassis_and_datapath("},{"line_number":339,"context_line":"                            g_name)"},{"line_number":340,"context_line":"                    if master !\u003d chassis[0]:"}],"source_content_type":"text/x-python","patch_set":21,"id":"dfbec78f_0b06e287","line":337,"range":{"start_line":337,"start_character":28,"end_line":337,"end_character":32},"updated":"2019-05-09 10:34:46.000000000","message":"nit: since this variable is not used we should name it \"_\".\n\ne.g:\n\nmaster, _ \u003d self._sb_ovn....","commit_id":"2c1012de81d781e31a527bad527a1faaa2954367"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"cb56e7395cccd9621c3f265277382f4f7d110355","unresolved":false,"context_lines":[{"line_number":334,"context_line":"                    # since it doesnt take into account number of ports."},{"line_number":335,"context_line":"                    chassis[0], chassis[1] \u003d chassis[1], chassis[0]"},{"line_number":336,"context_line":"                elif count \u003d\u003d 2:"},{"line_number":337,"context_line":"                    master, path \u003d \\"},{"line_number":338,"context_line":"                        self._sb_ovn.get_logical_port_chassis_and_datapath("},{"line_number":339,"context_line":"                            g_name)"},{"line_number":340,"context_line":"                    if master !\u003d chassis[0]:"}],"source_content_type":"text/x-python","patch_set":21,"id":"dfbec78f_1618267f","line":337,"range":{"start_line":337,"start_character":28,"end_line":337,"end_character":32},"in_reply_to":"dfbec78f_0b06e287","updated":"2019-05-09 10:57:12.000000000","message":"We can consider it in the rebalance patch","commit_id":"2c1012de81d781e31a527bad527a1faaa2954367"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        cms \u003d self._sb_ovn.get_gateway_chassis_from_cms_options()"},{"line_number":317,"context_line":"        unhosted_gateways \u003d self._ovn.get_unhosted_gateways("},{"line_number":318,"context_line":"            port_physnet_dict, chassis_physnets, cms)"},{"line_number":319,"context_line":"        rebalance, count \u003d self.scheduler.need_rebalance(self._ovn)"},{"line_number":320,"context_line":"        gw_count \u003d len(unhosted_gateways)"},{"line_number":321,"context_line":"        for g_name, chassis_list in unhosted_gateways:"},{"line_number":322,"context_line":"            physnet \u003d port_physnet_dict.get(g_name[len(\u0027lrp-\u0027):])"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_a6858daf","line":319,"range":{"start_line":319,"start_character":8,"end_line":319,"end_character":24},"updated":"2019-05-07 12:17:13.000000000","message":"I actually think that instead of having tuple, it\u0027s better to split 2 nodes case into two cases and return a single value from enumaration list, like:\n\n [NO_CHASSIS,\n  ONE_CHASSIS,\n  TWO_CHASSIS_NO_REBALANCE,\n  TWO_CHASSIS_REBALANCE,\n  MORE_CHASSIS]","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        cms \u003d self._sb_ovn.get_gateway_chassis_from_cms_options()"},{"line_number":317,"context_line":"        unhosted_gateways \u003d self._ovn.get_unhosted_gateways("},{"line_number":318,"context_line":"            port_physnet_dict, chassis_physnets, cms)"},{"line_number":319,"context_line":"        rebalance, count \u003d self.scheduler.need_rebalance(self._ovn)"},{"line_number":320,"context_line":"        gw_count \u003d len(unhosted_gateways)"},{"line_number":321,"context_line":"        for g_name, chassis_list in unhosted_gateways:"},{"line_number":322,"context_line":"            physnet \u003d port_physnet_dict.get(g_name[len(\u0027lrp-\u0027):])"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_269afd13","line":319,"range":{"start_line":319,"start_character":19,"end_line":319,"end_character":24},"updated":"2019-05-07 12:17:13.000000000","message":"case","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":316,"context_line":"        cms \u003d self._sb_ovn.get_gateway_chassis_from_cms_options()"},{"line_number":317,"context_line":"        unhosted_gateways \u003d self._ovn.get_unhosted_gateways("},{"line_number":318,"context_line":"            port_physnet_dict, chassis_physnets, cms)"},{"line_number":319,"context_line":"        rebalance, count \u003d self.scheduler.need_rebalance(self._ovn)"},{"line_number":320,"context_line":"        gw_count \u003d len(unhosted_gateways)"},{"line_number":321,"context_line":"        for g_name, chassis_list in unhosted_gateways:"},{"line_number":322,"context_line":"            physnet \u003d port_physnet_dict.get(g_name[len(\u0027lrp-\u0027):])"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_0163231c","line":319,"range":{"start_line":319,"start_character":8,"end_line":319,"end_character":24},"in_reply_to":"dfbec78f_a6858daf","updated":"2019-05-07 14:07:28.000000000","message":"this looks much better to play with.","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4ff2831e0046b9fd45bdd9e5fc2717917b40bc63","unresolved":false,"context_lines":[{"line_number":327,"context_line":"                chassis_list\u003dchassis_list)"},{"line_number":328,"context_line":"            gw_count -\u003d 1"},{"line_number":329,"context_line":"            if rebalance:"},{"line_number":330,"context_line":"                if count \u003d\u003d 1 and gw_count \u003c len(unhosted_gateways) / 4:"},{"line_number":331,"context_line":"                    # Swap only for the last 25%. This might probably"},{"line_number":332,"context_line":"                    # swap the LeastLoaded logic when initially run,"},{"line_number":333,"context_line":"                    # since it doesnt take into account number of ports."}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_21674750","line":330,"range":{"start_line":330,"start_character":34,"end_line":330,"end_character":71},"updated":"2019-05-09 10:34:46.000000000","message":"I\u0027m trying to get my head around the 25% threshold, why is it needed ?","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":326,"context_line":"                self._ovn, self._sb_ovn, g_name, candidates\u003dcandidates,"},{"line_number":327,"context_line":"                chassis_list\u003dchassis_list)"},{"line_number":328,"context_line":"            gw_count -\u003d 1"},{"line_number":329,"context_line":"            if rebalance:"},{"line_number":330,"context_line":"                if count \u003d\u003d 1 and gw_count \u003c len(unhosted_gateways) / 4:"},{"line_number":331,"context_line":"                    # Swap only for the last 25%. This might probably"},{"line_number":332,"context_line":"                    # swap the LeastLoaded logic when initially run,"},{"line_number":333,"context_line":"                    # since it doesnt take into account number of ports."}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_a6aeed2b","line":330,"range":{"start_line":329,"start_character":12,"end_line":330,"end_character":29},"updated":"2019-05-07 12:17:13.000000000","message":"if case \u003d\u003d TWO_CHASSIS_REBALANCE:","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"cb56e7395cccd9621c3f265277382f4f7d110355","unresolved":false,"context_lines":[{"line_number":327,"context_line":"                chassis_list\u003dchassis_list)"},{"line_number":328,"context_line":"            gw_count -\u003d 1"},{"line_number":329,"context_line":"            if rebalance:"},{"line_number":330,"context_line":"                if count \u003d\u003d 1 and gw_count \u003c len(unhosted_gateways) / 4:"},{"line_number":331,"context_line":"                    # Swap only for the last 25%. This might probably"},{"line_number":332,"context_line":"                    # swap the LeastLoaded logic when initially run,"},{"line_number":333,"context_line":"                    # since it doesnt take into account number of ports."}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_f6b8f276","line":330,"range":{"start_line":330,"start_character":34,"end_line":330,"end_character":71},"in_reply_to":"dfbec78f_21674750","updated":"2019-05-09 10:57:12.000000000","message":"So, if we have all routers in one gateway chassis, then during rebalance, we can either move 50% to balance them out properly, or move some ( in this case, I thought of moving 1/4th ) so that there is not a major downtime experienced by the customer due to rebalance. \nHowever, as suggested, we can move the rebalance logic to a separate patch , and it would be user based and not automated, so that the user knows that rebalance is being done and therefore the downtime is expected. The API should have both PUT and GET request, so that user knows if rebalance is required, and if so, then move them accordingly","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":326,"context_line":"                self._ovn, self._sb_ovn, g_name, candidates\u003dcandidates,"},{"line_number":327,"context_line":"                chassis_list\u003dchassis_list)"},{"line_number":328,"context_line":"            gw_count -\u003d 1"},{"line_number":329,"context_line":"            if rebalance:"},{"line_number":330,"context_line":"                if count \u003d\u003d 1 and gw_count \u003c len(unhosted_gateways) / 4:"},{"line_number":331,"context_line":"                    # Swap only for the last 25%. This might probably"},{"line_number":332,"context_line":"                    # swap the LeastLoaded logic when initially run,"},{"line_number":333,"context_line":"                    # since it doesnt take into account number of ports."}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_2168a7f3","line":330,"range":{"start_line":329,"start_character":12,"end_line":330,"end_character":29},"in_reply_to":"dfbec78f_a6aeed2b","updated":"2019-05-07 14:07:28.000000000","message":"Yeah, following up with the comment above","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":332,"context_line":"                    # swap the LeastLoaded logic when initially run,"},{"line_number":333,"context_line":"                    # since it doesnt take into account number of ports."},{"line_number":334,"context_line":"                    chassis[0], chassis[1] \u003d chassis[1], chassis[0]"},{"line_number":335,"context_line":"                elif count \u003d\u003d 2:"},{"line_number":336,"context_line":"                    master \u003d \\"},{"line_number":337,"context_line":"                        self._sb_ovn.get_logical_port_master_chassis(g_name)"},{"line_number":338,"context_line":"                    if master and master !\u003d chassis[0]:"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_0663391c","line":335,"range":{"start_line":335,"start_character":21,"end_line":335,"end_character":31},"updated":"2019-05-07 12:17:13.000000000","message":"case \u003d\u003d MORE_CHASSIS","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":332,"context_line":"                    # swap the LeastLoaded logic when initially run,"},{"line_number":333,"context_line":"                    # since it doesnt take into account number of ports."},{"line_number":334,"context_line":"                    chassis[0], chassis[1] \u003d chassis[1], chassis[0]"},{"line_number":335,"context_line":"                elif count \u003d\u003d 2:"},{"line_number":336,"context_line":"                    master \u003d \\"},{"line_number":337,"context_line":"                        self._sb_ovn.get_logical_port_master_chassis(g_name)"},{"line_number":338,"context_line":"                    if master and master !\u003d chassis[0]:"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_817633d8","line":335,"range":{"start_line":335,"start_character":21,"end_line":335,"end_character":31},"in_reply_to":"dfbec78f_0663391c","updated":"2019-05-07 14:07:28.000000000","message":"yeah, following it up","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                    # since it doesnt take into account number of ports."},{"line_number":334,"context_line":"                    chassis[0], chassis[1] \u003d chassis[1], chassis[0]"},{"line_number":335,"context_line":"                elif count \u003d\u003d 2:"},{"line_number":336,"context_line":"                    master \u003d \\"},{"line_number":337,"context_line":"                        self._sb_ovn.get_logical_port_master_chassis(g_name)"},{"line_number":338,"context_line":"                    if master and master !\u003d chassis[0]:"},{"line_number":339,"context_line":"                        LOG.debug(\"Gateway %s is hosted at %s\", g_name, master)"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_c66c410a","line":336,"range":{"start_line":336,"start_character":29,"end_line":336,"end_character":30},"updated":"2019-05-07 12:17:13.000000000","message":"Parenthesis are preferred when wrapping a line","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                    # since it doesnt take into account number of ports."},{"line_number":334,"context_line":"                    chassis[0], chassis[1] \u003d chassis[1], chassis[0]"},{"line_number":335,"context_line":"                elif count \u003d\u003d 2:"},{"line_number":336,"context_line":"                    master \u003d \\"},{"line_number":337,"context_line":"                        self._sb_ovn.get_logical_port_master_chassis(g_name)"},{"line_number":338,"context_line":"                    if master and master !\u003d chassis[0]:"},{"line_number":339,"context_line":"                        LOG.debug(\"Gateway %s is hosted at %s\", g_name, master)"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_c16c2b0a","line":336,"range":{"start_line":336,"start_character":29,"end_line":336,"end_character":30},"in_reply_to":"dfbec78f_c66c410a","updated":"2019-05-07 14:07:28.000000000","message":"oh ok","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":335,"context_line":"                elif count \u003d\u003d 2:"},{"line_number":336,"context_line":"                    master \u003d \\"},{"line_number":337,"context_line":"                        self._sb_ovn.get_logical_port_master_chassis(g_name)"},{"line_number":338,"context_line":"                    if master and master !\u003d chassis[0]:"},{"line_number":339,"context_line":"                        LOG.debug(\"Gateway %s is hosted at %s\", g_name, master)"},{"line_number":340,"context_line":"                        # Means master is hosted somewhere else, update"},{"line_number":341,"context_line":"                        # the master chassis priority to the top"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_a13817d3","line":338,"range":{"start_line":338,"start_character":23,"end_line":338,"end_character":54},"updated":"2019-05-07 12:17:13.000000000","message":"in which scenario is chassis[0] equal to None? I don\u0027t think it can happen, thus just:\n\n if master !\u003d chassis[0]","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":335,"context_line":"                elif count \u003d\u003d 2:"},{"line_number":336,"context_line":"                    master \u003d \\"},{"line_number":337,"context_line":"                        self._sb_ovn.get_logical_port_master_chassis(g_name)"},{"line_number":338,"context_line":"                    if master and master !\u003d chassis[0]:"},{"line_number":339,"context_line":"                        LOG.debug(\"Gateway %s is hosted at %s\", g_name, master)"},{"line_number":340,"context_line":"                        # Means master is hosted somewhere else, update"},{"line_number":341,"context_line":"                        # the master chassis priority to the top"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_21518737","line":338,"range":{"start_line":338,"start_character":23,"end_line":338,"end_character":54},"in_reply_to":"dfbec78f_a13817d3","updated":"2019-05-07 14:07:28.000000000","message":"In case the highest priority is given to a node which has shut down, the master points to the next node in line ( master !\u003d chassis[0] ). The chassis list retrieved is based on priority, so there is the possibility","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            # NOTE(dalvarez): Let\u0027s commit the changes in separate transactions"},{"line_number":348,"context_line":"            # as we will rely on those for scheduling subsequent gateways."},{"line_number":349,"context_line":"            with self._ovn.transaction(check_error\u003dTrue) as txn:"},{"line_number":350,"context_line":"                txn.add((self._ovn.update_lrouter_port("},{"line_number":351,"context_line":"                        g_name, gateway_chassis\u003dchassis)))"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_0176c3a5","line":350,"range":{"start_line":350,"start_character":24,"end_line":350,"end_character":25},"updated":"2019-05-07 12:17:13.000000000","message":"Why did you add these parens?","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":347,"context_line":"            # NOTE(dalvarez): Let\u0027s commit the changes in separate transactions"},{"line_number":348,"context_line":"            # as we will rely on those for scheduling subsequent gateways."},{"line_number":349,"context_line":"            with self._ovn.transaction(check_error\u003dTrue) as txn:"},{"line_number":350,"context_line":"                txn.add((self._ovn.update_lrouter_port("},{"line_number":351,"context_line":"                        g_name, gateway_chassis\u003dchassis)))"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    @staticmethod"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_a15c974b","line":350,"range":{"start_line":350,"start_character":24,"end_line":350,"end_character":25},"in_reply_to":"dfbec78f_0176c3a5","updated":"2019-05-07 14:07:28.000000000","message":"I was doing some PoC and may have missed this","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e33ab546f5fb7e21b0c8866363c1c0882f614709","unresolved":false,"context_lines":[{"line_number":325,"context_line":"                chassis_list\u003dchassis_list)"},{"line_number":326,"context_line":"            if chassis \u003d\u003d chassis_list:"},{"line_number":327,"context_line":"                # Skipping transaction if there is no change in chassis"},{"line_number":328,"context_line":"                pass"},{"line_number":329,"context_line":"            # NOTE(dalvarez): Let\u0027s commit the changes in separate transactions"},{"line_number":330,"context_line":"            # as we will rely on those for scheduling subsequent gateways."},{"line_number":331,"context_line":"            with self._ovn.transaction(check_error\u003dTrue) as txn:"}],"source_content_type":"text/x-python","patch_set":23,"id":"dfbec78f_93c18831","line":328,"range":{"start_line":328,"start_character":16,"end_line":328,"end_character":20},"updated":"2019-05-09 09:47:34.000000000","message":"I don\u0027t think this is skipping anything","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4ff2831e0046b9fd45bdd9e5fc2717917b40bc63","unresolved":false,"context_lines":[{"line_number":325,"context_line":"                chassis_list\u003dchassis_list)"},{"line_number":326,"context_line":"            if chassis \u003d\u003d chassis_list:"},{"line_number":327,"context_line":"                # Skipping transaction if there is no change in chassis"},{"line_number":328,"context_line":"                pass"},{"line_number":329,"context_line":"            # NOTE(dalvarez): Let\u0027s commit the changes in separate transactions"},{"line_number":330,"context_line":"            # as we will rely on those for scheduling subsequent gateways."},{"line_number":331,"context_line":"            with self._ovn.transaction(check_error\u003dTrue) as txn:"}],"source_content_type":"text/x-python","patch_set":23,"id":"dfbec78f_569f7eb3","line":328,"range":{"start_line":328,"start_character":16,"end_line":328,"end_character":20},"in_reply_to":"dfbec78f_93c18831","updated":"2019-05-09 10:34:46.000000000","message":"++\n\nSounds like it should be a \"continue\" statement ?","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":320,"context_line":"            physnet \u003d port_physnet_dict.get(g_name[len(\u0027lrp-\u0027):])"},{"line_number":321,"context_line":"            # Remove any invalid gateway chassis from the list, otherwise"},{"line_number":322,"context_line":"            # we can have a situation where all existing_chassis are invalid"},{"line_number":323,"context_line":"            existing_chassis \u003d self.scheduler.validate_existing_chassis("},{"line_number":324,"context_line":"                nb_idl\u003dself._ovn, gw_chassis\u003dg_name,"},{"line_number":325,"context_line":"                physnet\u003dphysnet, chassis_physnets\u003dchassis_physnets,"},{"line_number":326,"context_line":"                existing_chassis\u003dself._ovn.get_gateway_chassis_binding(g_name))"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_7db56d7d","line":323,"range":{"start_line":323,"start_character":46,"end_line":323,"end_character":55},"updated":"2019-05-14 16:23:24.000000000","message":"nit: Sounds more like filtering than validating. Usually validation doesn\u0027t really change the input, which is the case here.","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":320,"context_line":"            physnet \u003d port_physnet_dict.get(g_name[len(\u0027lrp-\u0027):])"},{"line_number":321,"context_line":"            # Remove any invalid gateway chassis from the list, otherwise"},{"line_number":322,"context_line":"            # we can have a situation where all existing_chassis are invalid"},{"line_number":323,"context_line":"            existing_chassis \u003d self.scheduler.validate_existing_chassis("},{"line_number":324,"context_line":"                nb_idl\u003dself._ovn, gw_chassis\u003dg_name,"},{"line_number":325,"context_line":"                physnet\u003dphysnet, chassis_physnets\u003dchassis_physnets,"},{"line_number":326,"context_line":"                existing_chassis\u003dself._ovn.get_gateway_chassis_binding(g_name))"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_e1a3eefe","line":323,"range":{"start_line":323,"start_character":46,"end_line":323,"end_character":55},"in_reply_to":"dfbec78f_7db56d7d","updated":"2019-05-15 03:09:38.000000000","message":"hmm, ok. I can change that","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":320,"context_line":"            physnet \u003d port_physnet_dict.get(g_name[len(\u0027lrp-\u0027):])"},{"line_number":321,"context_line":"            # Remove any invalid gateway chassis from the list, otherwise"},{"line_number":322,"context_line":"            # we can have a situation where all existing_chassis are invalid"},{"line_number":323,"context_line":"            existing_chassis \u003d self.scheduler.validate_existing_chassis("},{"line_number":324,"context_line":"                nb_idl\u003dself._ovn, gw_chassis\u003dg_name,"},{"line_number":325,"context_line":"                physnet\u003dphysnet, chassis_physnets\u003dchassis_physnets,"},{"line_number":326,"context_line":"                existing_chassis\u003dself._ovn.get_gateway_chassis_binding(g_name))"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_c17b4a25","line":323,"range":{"start_line":323,"start_character":46,"end_line":323,"end_character":55},"in_reply_to":"dfbec78f_e1a3eefe","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":323,"context_line":"            existing_chassis \u003d self.scheduler.filter_existing_chassis("},{"line_number":324,"context_line":"                nb_idl\u003dself._ovn, gw_chassis\u003dg_name,"},{"line_number":325,"context_line":"                physnet\u003dphysnet, chassis_physnets\u003dchassis_physnets,"},{"line_number":326,"context_line":"                existing_chassis\u003dself._ovn.get_gateway_chassis_binding(g_name))"},{"line_number":327,"context_line":"            candidates \u003d self._ovn_client.get_candidates_for_scheduling("},{"line_number":328,"context_line":"                physnet, cms\u003dcms, chassis_physnets\u003dchassis_physnets)"},{"line_number":329,"context_line":"            master \u003d self._sb_ovn._get_logical_port_master_chassis(g_name)"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_4a31af59","line":326,"range":{"start_line":326,"start_character":33,"end_line":326,"end_character":78},"updated":"2019-05-15 09:13:18.000000000","message":"Assign it to a variable first, please. It\u0027s annoying to enter such function when stepping in filter_existing_chassis method with debugger :)","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":323,"context_line":"            existing_chassis \u003d self.scheduler.filter_existing_chassis("},{"line_number":324,"context_line":"                nb_idl\u003dself._ovn, gw_chassis\u003dg_name,"},{"line_number":325,"context_line":"                physnet\u003dphysnet, chassis_physnets\u003dchassis_physnets,"},{"line_number":326,"context_line":"                existing_chassis\u003dself._ovn.get_gateway_chassis_binding(g_name))"},{"line_number":327,"context_line":"            candidates \u003d self._ovn_client.get_candidates_for_scheduling("},{"line_number":328,"context_line":"                physnet, cms\u003dcms, chassis_physnets\u003dchassis_physnets)"},{"line_number":329,"context_line":"            master \u003d self._sb_ovn._get_logical_port_master_chassis(g_name)"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_2a4f9b93","line":326,"range":{"start_line":326,"start_character":33,"end_line":326,"end_character":78},"in_reply_to":"dfbec78f_4a31af59","updated":"2019-05-15 09:26:43.000000000","message":"Sure, I can, but since that variable would be used just once, I thought of skipping it.\nI will put it","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"df77976af99699e3cc1777b7a1202a88ec7dc25f","unresolved":false,"context_lines":[{"line_number":328,"context_line":"            candidates \u003d self._ovn_client.get_candidates_for_scheduling("},{"line_number":329,"context_line":"                physnet, cms\u003dcms, chassis_physnets\u003dchassis_physnets)"},{"line_number":330,"context_line":"            master \u003d self._sb_ovn._get_logical_port_master_chassis(g_name)"},{"line_number":331,"context_line":"            chassis \u003d self.scheduler.select("},{"line_number":332,"context_line":"                self._ovn, self._sb_ovn, g_name, candidates\u003dcandidates,"},{"line_number":333,"context_line":"                existing_chassis\u003dexisting_chassis)"},{"line_number":334,"context_line":"            if master and master !\u003d chassis[0]:"}],"source_content_type":"text/x-python","patch_set":37,"id":"7faddb67_abe9c61a","line":331,"updated":"2019-07-09 11:20:41.000000000","message":"If there are no candidates and no existing_chassis why not to make here early exist, like:\n\nif not existing_chassis and not candidates:\n   return","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"df77976af99699e3cc1777b7a1202a88ec7dc25f","unresolved":false,"context_lines":[{"line_number":329,"context_line":"                physnet, cms\u003dcms, chassis_physnets\u003dchassis_physnets)"},{"line_number":330,"context_line":"            master \u003d self._sb_ovn._get_logical_port_master_chassis(g_name)"},{"line_number":331,"context_line":"            chassis \u003d self.scheduler.select("},{"line_number":332,"context_line":"                self._ovn, self._sb_ovn, g_name, candidates\u003dcandidates,"},{"line_number":333,"context_line":"                existing_chassis\u003dexisting_chassis)"},{"line_number":334,"context_line":"            if master and master !\u003d chassis[0]:"},{"line_number":335,"context_line":"                LOG.debug(\"Gateway %s is hosted at %s\", g_name, master)"}],"source_content_type":"text/x-python","patch_set":37,"id":"7faddb67_3860ce01","line":332,"range":{"start_line":332,"start_character":60,"end_line":332,"end_character":70},"updated":"2019-07-09 11:20:41.000000000","message":"What if there are no candidates in given physnet?","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"5cd7ac75180d9d05398630e3ba35d48c3120a73f","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                existing_chassis\u003dexisting_chassis)"},{"line_number":334,"context_line":"            if master and master !\u003d chassis[0]:"},{"line_number":335,"context_line":"                if master not in chassis:"},{"line_number":336,"context_line":"                    LOG.debug(\"Master gateway chassis %(previous_chassis)s \""},{"line_number":337,"context_line":"                              \"has been removed from the system. Moving \""},{"line_number":338,"context_line":"                              \"gateway to other chassis %s.\","},{"line_number":339,"context_line":"                              {\u0027gw\u0027: g_name,"},{"line_number":340,"context_line":"                               \u0027previous_chassis\u0027: master,"},{"line_number":341,"context_line":"                               \u0027new_chassis\u0027: chassis[0]})"},{"line_number":342,"context_line":"                else:"},{"line_number":343,"context_line":"                    LOG.debug(\"Gateway %s is hosted at %s.\", g_name, master)"},{"line_number":344,"context_line":"                    # NOTE(mjozefcz): It means scheduler moved master chassis"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_584e5438","line":341,"range":{"start_line":336,"start_character":0,"end_line":341,"end_character":58},"updated":"2019-07-18 13:54:03.000000000","message":"There\u0027s a combination here of named parameters (previous_chassis) and non-named ones (%s), which I don\u0027t know if it works.\n\nAlso, the string is expecting two parameters and we are passing a dict with three elements (\"gw\" seems to be missing in the string)","commit_id":"22fdad781942673012e42191517c6a6047a12d74"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"2e6f715879546a276743b1663f568e4087ba98ca","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                existing_chassis\u003dexisting_chassis)"},{"line_number":334,"context_line":"            if master and master !\u003d chassis[0]:"},{"line_number":335,"context_line":"                if master not in chassis:"},{"line_number":336,"context_line":"                    LOG.debug(\"Master gateway chassis %(previous_chassis)s \""},{"line_number":337,"context_line":"                              \"has been removed from the system. Moving \""},{"line_number":338,"context_line":"                              \"gateway to other chassis %s.\","},{"line_number":339,"context_line":"                              {\u0027gw\u0027: g_name,"},{"line_number":340,"context_line":"                               \u0027previous_chassis\u0027: master,"},{"line_number":341,"context_line":"                               \u0027new_chassis\u0027: chassis[0]})"},{"line_number":342,"context_line":"                else:"},{"line_number":343,"context_line":"                    LOG.debug(\"Gateway %s is hosted at %s.\", g_name, master)"},{"line_number":344,"context_line":"                    # NOTE(mjozefcz): It means scheduler moved master chassis"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_98d84cef","line":341,"range":{"start_line":336,"start_character":0,"end_line":341,"end_character":58},"in_reply_to":"7faddb67_584e5438","updated":"2019-07-18 14:37:59.000000000","message":"Yes, you\u0027re right. Sorry for that. I\u0027ll fix it.","commit_id":"22fdad781942673012e42191517c6a6047a12d74"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"c7252a071534161907591c3ac275fda9a77df7a6","unresolved":false,"context_lines":[{"line_number":333,"context_line":"                existing_chassis\u003dexisting_chassis)"},{"line_number":334,"context_line":"            if master and master !\u003d chassis[0]:"},{"line_number":335,"context_line":"                if master not in chassis:"},{"line_number":336,"context_line":"                    LOG.debug(\"Master gateway chassis %(previous_chassis)s \""},{"line_number":337,"context_line":"                              \"has been removed from the system. Moving \""},{"line_number":338,"context_line":"                              \"gateway to other chassis %s.\","},{"line_number":339,"context_line":"                              {\u0027gw\u0027: g_name,"},{"line_number":340,"context_line":"                               \u0027previous_chassis\u0027: master,"},{"line_number":341,"context_line":"                               \u0027new_chassis\u0027: chassis[0]})"},{"line_number":342,"context_line":"                else:"},{"line_number":343,"context_line":"                    LOG.debug(\"Gateway %s is hosted at %s.\", g_name, master)"},{"line_number":344,"context_line":"                    # NOTE(mjozefcz): It means scheduler moved master chassis"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_00c11a81","line":341,"range":{"start_line":336,"start_character":0,"end_line":341,"end_character":58},"in_reply_to":"7faddb67_98d84cef","updated":"2019-07-22 09:17:22.000000000","message":"Done","commit_id":"22fdad781942673012e42191517c6a6047a12d74"}],"networking_ovn/l3/l3_ovn_scheduler.py":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e3818d867224d307b0bafc196de5a59adbccc580","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        chassis_bindings \u003d nb_idl.get_all_chassis_gateway_bindings(candidates)"},{"line_number":124,"context_line":"        return [chassis for chassis, load in sorted(chassis_bindings.items(),"},{"line_number":125,"context_line":"                key\u003dOVNGatewayLeastLoadedScheduler._get_chassis_load)]"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"OVN_SCHEDULER_STR_TO_CLASS \u003d {"},{"line_number":129,"context_line":"    OVN_SCHEDULER_CHANCE: OVNGatewayChanceScheduler,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_677543fa","side":"PARENT","line":126,"updated":"2018-08-20 08:26:52.000000000","message":"nit: pls add this line again :)","commit_id":"e63f55a308e2cec22bdc56601e89ae5181786a2a"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"4f6b3b3365d3359d43e5a96e5e4b2b1078afc904","unresolved":false,"context_lines":[{"line_number":123,"context_line":"        chassis_bindings \u003d nb_idl.get_all_chassis_gateway_bindings(candidates)"},{"line_number":124,"context_line":"        return [chassis for chassis, load in sorted(chassis_bindings.items(),"},{"line_number":125,"context_line":"                key\u003dOVNGatewayLeastLoadedScheduler._get_chassis_load)]"},{"line_number":126,"context_line":""},{"line_number":127,"context_line":""},{"line_number":128,"context_line":"OVN_SCHEDULER_STR_TO_CLASS \u003d {"},{"line_number":129,"context_line":"    OVN_SCHEDULER_CHANCE: OVNGatewayChanceScheduler,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_bb7292e2","side":"PARENT","line":126,"in_reply_to":"3f79a3b5_677543fa","updated":"2018-08-20 11:25:18.000000000","message":"Oh damn :P","commit_id":"e63f55a308e2cec22bdc56601e89ae5181786a2a"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"ed718787ae0b81eca94a9475ed03ce67bac3afc9","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        # The actual binding of the gateway to a chassis via the options"},{"line_number":60,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":61,"context_line":"        # by the caller"},{"line_number":62,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":63,"context_line":"            nb_idl, candidates)[:ovn_const.MAX_GW_CHASSIS]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_c1e88a7d","line":62,"range":{"start_line":62,"start_character":23,"end_line":62,"end_character":46},"updated":"2018-09-03 09:03:10.000000000","message":"Here you\u0027ll be trying to (re)schedule an LRP on all the possible chassis. It may happen that this LRP is moved from C1 with highest prio to C2 with highest prio causing (unnecessary?) downtime. Am I missing something?\n\nIf you plan to handle in a follow up patch, perhaps this patch should be just \"Partial\" for the reported bug and leaving a TODO here may help. I\u0027m not sure about merging this without handling it though. Although perhaps adding/removing a gateway is not that common, I think that this patch will perhaps make the follow situation happen:\n\n1. N LRPs equally distributed among 3 controllers (N/3 on each).\n2. Restarting controller 1\n3. Load will be balanced so that N/2 are now hosted on controllers 2 and 3 (this happens through BFD itself at core OVN).\n4. With this patch, we may have some master gateways failing (unnecessarily) over from controller 2 to 3 and viceversa causing downtime.\n\nIf I\u0027m wrong here, please let me know :)","commit_id":"3422f0abef56a858baab3afcb1a0bdd41d265b86"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"8086de67df7686665dfcbdefe2c4846f4e528e00","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        # The actual binding of the gateway to a chassis via the options"},{"line_number":60,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":61,"context_line":"        # by the caller"},{"line_number":62,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":63,"context_line":"            nb_idl, candidates)[:ovn_const.MAX_GW_CHASSIS]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_cd9431eb","line":62,"range":{"start_line":62,"start_character":23,"end_line":62,"end_character":46},"in_reply_to":"3f79a3b5_c1e88a7d","updated":"2018-09-04 06:14:30.000000000","message":"I *think* that when we call _select_gateway_chassis, the  function in https://review.openstack.org/#/c/591461/6/networking_ovn/l3/l3_ovn_scheduler.py@122 would be called.\n\nThe function https://review.openstack.org/#/c/591461/6/networking_ovn/l3/l3_ovn_scheduler.py@116 would be called, which would call https://review.openstack.org/#/c/591461/6/networking_ovn/l3/l3_ovn_scheduler.py@103. The function there would actually sort the Gw in the priority.If we already have a gateway at highest priority, the same priority ,ight not be assigned to the gateway again.\nI think that the rescheduling which concerns you, occurs if a gateway chassis is assigned the same priority to another controller, is it? If so, maybe we should prevent this failover","commit_id":"3422f0abef56a858baab3afcb1a0bdd41d265b86"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"ba1334a5ad395a903805f2680d816d147c98e32d","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        # The actual binding of the gateway to a chassis via the options"},{"line_number":60,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":61,"context_line":"        # by the caller"},{"line_number":62,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":63,"context_line":"            nb_idl, candidates)[:ovn_const.MAX_GW_CHASSIS]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_f7b0b68d","line":62,"range":{"start_line":62,"start_character":23,"end_line":62,"end_character":46},"in_reply_to":"3f79a3b5_cd9431eb","updated":"2018-09-05 10:03:43.000000000","message":"it shouldn\u0027t be possible that it\u0027s scheduled on two chassis with the same priority. Is it?\nWhen I wrote this code I made sure it couldn\u0027t happen but perhaps there\u0027s a bug or this patch changes it?","commit_id":"3422f0abef56a858baab3afcb1a0bdd41d265b86"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c6b0286f27f82336f28341c184b807d53c07a7ad","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        # The actual binding of the gateway to a chassis via the options"},{"line_number":60,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":61,"context_line":"        # by the caller"},{"line_number":62,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":63,"context_line":"            nb_idl, candidates)[:ovn_const.MAX_GW_CHASSIS]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_57464a7d","line":62,"range":{"start_line":62,"start_character":23,"end_line":62,"end_character":46},"in_reply_to":"3f79a3b5_f7b0b68d","updated":"2018-09-05 10:06:48.000000000","message":"I have put a comment on PS#10 for this. I am now starting to check for only those candidates where the gateway is not scheduled.\nAnd the new chassis can be added to the existing chassis and returned. That would not change the xisting priority, isnt it?","commit_id":"3422f0abef56a858baab3afcb1a0bdd41d265b86"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"32ac04d1ecacb514175ac05c07888657b890c6fe","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":48,"context_line":"                          chassis_list\u003dNone):"},{"line_number":49,"context_line":"        existing_chassis \u003d ["},{"line_number":50,"context_line":"            chassis for chassis, pri in chassis_list] if chassis_list else None"},{"line_number":51,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":52,"context_line":"        # if no candidates or all chassis in existing_chassis also present"},{"line_number":53,"context_line":"        # in candidates, then return existing_chassis"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_0cef9987","line":50,"updated":"2018-09-03 10:13:49.000000000","message":"We are missing retrieving existing chassis when scheduler.select() called from _create_lrouter_port[1]\n\n\n[1] https://github.com/openstack/networking-ovn/blob/master/networking_ovn/common/ovn_client.py#L1092","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f428d8467b2e98696877f6cd77f6e82092a479cf","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":48,"context_line":"                          chassis_list\u003dNone):"},{"line_number":49,"context_line":"        existing_chassis \u003d ["},{"line_number":50,"context_line":"            chassis for chassis, pri in chassis_list] if chassis_list else None"},{"line_number":51,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":52,"context_line":"        # if no candidates or all chassis in existing_chassis also present"},{"line_number":53,"context_line":"        # in candidates, then return existing_chassis"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_f7543656","line":50,"in_reply_to":"3f79a3b5_0cef9987","updated":"2018-09-05 09:58:21.000000000","message":"Done","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"ed718787ae0b81eca94a9475ed03ce67bac3afc9","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":52,"context_line":"        # if no candidates or all chassis in existing_chassis also present"},{"line_number":53,"context_line":"        # in candidates, then return existing_chassis"},{"line_number":54,"context_line":"        if existing_chassis and (not candidates or not ("},{"line_number":55,"context_line":"                set(candidates) - set(existing_chassis))):"},{"line_number":56,"context_line":"            return existing_chassis"},{"line_number":57,"context_line":"        if not candidates:"},{"line_number":58,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_e6159c4a","line":55,"range":{"start_line":54,"start_character":32,"end_line":55,"end_character":56},"updated":"2018-09-03 09:03:10.000000000","message":"it\u0027s more clear:\n\nif existing_chassis and not set(candidates) - set(existing_chassis):\n\n\nAs I think that candidates can\u0027t be None but instead it would be []","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"984ce09a77029160740121ec78a7d54ac8c981d8","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":52,"context_line":"        # if no candidates or all chassis in existing_chassis also present"},{"line_number":53,"context_line":"        # in candidates, then return existing_chassis"},{"line_number":54,"context_line":"        if existing_chassis and (not candidates or not ("},{"line_number":55,"context_line":"                set(candidates) - set(existing_chassis))):"},{"line_number":56,"context_line":"            return existing_chassis"},{"line_number":57,"context_line":"        if not candidates:"},{"line_number":58,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_a738fe3a","line":55,"range":{"start_line":54,"start_character":32,"end_line":55,"end_character":56},"in_reply_to":"3f79a3b5_4cfcb13d","updated":"2018-09-03 10:55:56.000000000","message":"Perhaps we can change it in L97 as I can\u0027t see where in production code it can be None :?\nStill then we can just rewrite it clearly like\n\nif existing_chassis and not (candidates and ...","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"59aed51b8b7b6195efef7796f1eba69359d48932","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":52,"context_line":"        # if no candidates or all chassis in existing_chassis also present"},{"line_number":53,"context_line":"        # in candidates, then return existing_chassis"},{"line_number":54,"context_line":"        if existing_chassis and (not candidates or not ("},{"line_number":55,"context_line":"                set(candidates) - set(existing_chassis))):"},{"line_number":56,"context_line":"            return existing_chassis"},{"line_number":57,"context_line":"        if not candidates:"},{"line_number":58,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_bca785a8","line":55,"range":{"start_line":54,"start_character":32,"end_line":55,"end_character":56},"in_reply_to":"3f79a3b5_a738fe3a","updated":"2018-09-05 09:56:58.000000000","message":"I can change it, but it existed in the previous code, so I was apprehensive about changing it.","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"32ac04d1ecacb514175ac05c07888657b890c6fe","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":52,"context_line":"        # if no candidates or all chassis in existing_chassis also present"},{"line_number":53,"context_line":"        # in candidates, then return existing_chassis"},{"line_number":54,"context_line":"        if existing_chassis and (not candidates or not ("},{"line_number":55,"context_line":"                set(candidates) - set(existing_chassis))):"},{"line_number":56,"context_line":"            return existing_chassis"},{"line_number":57,"context_line":"        if not candidates:"},{"line_number":58,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_4cfcb13d","line":55,"range":{"start_line":54,"start_character":32,"end_line":55,"end_character":56},"in_reply_to":"3f79a3b5_e6159c4a","updated":"2018-09-03 10:13:49.000000000","message":"From line 97 of this file, candidates can be None :)","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"badcc770c4bf3332e076d6f7ac1aa8b7a03f7732","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":52,"context_line":"        # if no candidates or all chassis in existing_chassis also present"},{"line_number":53,"context_line":"        # in candidates, then return existing_chassis"},{"line_number":54,"context_line":"        if existing_chassis and (not candidates or not ("},{"line_number":55,"context_line":"                set(candidates) - set(existing_chassis))):"},{"line_number":56,"context_line":"            return existing_chassis"},{"line_number":57,"context_line":"        if not candidates:"},{"line_number":58,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_ac91c59c","line":55,"range":{"start_line":54,"start_character":32,"end_line":55,"end_character":56},"in_reply_to":"3f79a3b5_e6159c4a","updated":"2018-09-03 12:54:34.000000000","message":"nit but +1 :D","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":10267,"name":"venkata anil","email":"anilvenkata@redhat.com","username":"anil"},"change_message_id":"32ac04d1ecacb514175ac05c07888657b890c6fe","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        # The actual binding of the gateway to a chassis via the options"},{"line_number":60,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":61,"context_line":"        # by the caller"},{"line_number":62,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":63,"context_line":"            nb_idl, candidates)[:ovn_const.MAX_GW_CHASSIS]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_07fe9204","line":62,"updated":"2018-09-03 10:13:49.000000000","message":"For example, I have below scenario.\n\nRouter gateway hosted on c1:1,c2:2,c3:3 with these priorities. Now new chassis c4 is added to the environment. Then this function (_select_gateway_chassis) can return chassis as [c4,c1,c2,c3], as c4 is least scheduled. Then priorities will be set as c4:1,c1:2,c2:2,c3:3 in NBDB and SBDB and the gateway router will rescheduled. \n\nWhen a new chassis comes up, we don\u0027t want existing router to transition to new state(ex, master to slave) and disturb data plane.\n\nMay be in this case, assign least priority (for example c4:4) to the newly added chassis?","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"984ce09a77029160740121ec78a7d54ac8c981d8","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        # The actual binding of the gateway to a chassis via the options"},{"line_number":60,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":61,"context_line":"        # by the caller"},{"line_number":62,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":63,"context_line":"            nb_idl, candidates)[:ovn_const.MAX_GW_CHASSIS]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_2764ee48","line":62,"in_reply_to":"3f79a3b5_07fe9204","updated":"2018-09-03 10:55:56.000000000","message":"or perhaps we can try to rebalance taking into accounts priorities !\u003d 1 :) so we\u0027ll achieve more balance without disrupting dataplane. Thoughts?","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"59aed51b8b7b6195efef7796f1eba69359d48932","unresolved":false,"context_lines":[{"line_number":59,"context_line":"        # The actual binding of the gateway to a chassis via the options"},{"line_number":60,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":61,"context_line":"        # by the caller"},{"line_number":62,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":63,"context_line":"            nb_idl, candidates)[:ovn_const.MAX_GW_CHASSIS]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_fcdbbd79","line":62,"in_reply_to":"3f79a3b5_2764ee48","updated":"2018-09-05 09:56:58.000000000","message":"This can be done... I am thinking if we just take the set of elements which are in candidate and not in existing_chassis, then it might be enough. We can simply add the new candidates with the existing chassis and return it as the chassis. Lets see if it works?","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":8788,"name":"Miguel Angel Ajo","email":"mangelajo@redhat.com","username":"mangelajo"},"change_message_id":"badcc770c4bf3332e076d6f7ac1aa8b7a03f7732","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":61,"context_line":"        # by the caller"},{"line_number":62,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":63,"context_line":"            nb_idl, candidates)[:ovn_const.MAX_GW_CHASSIS]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","},{"line_number":66,"context_line":"                  gateway_name, chassis)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_6c8bad67","line":63,"range":{"start_line":63,"start_character":33,"end_line":63,"end_character":42},"updated":"2018-09-03 12:54:34.000000000","message":"nice cleanup","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f428d8467b2e98696877f6cd77f6e82092a479cf","unresolved":false,"context_lines":[{"line_number":60,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":61,"context_line":"        # by the caller"},{"line_number":62,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":63,"context_line":"            nb_idl, candidates)[:ovn_const.MAX_GW_CHASSIS]"},{"line_number":64,"context_line":""},{"line_number":65,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","},{"line_number":66,"context_line":"                  gateway_name, chassis)"}],"source_content_type":"text/x-python","patch_set":10,"id":"3f79a3b5_d747baa2","line":63,"range":{"start_line":63,"start_character":33,"end_line":63,"end_character":42},"in_reply_to":"3f79a3b5_6c8bad67","updated":"2018-09-05 09:58:21.000000000","message":"thanks :)","commit_id":"dccd0685263569a47234545c7ecbc0c1fbf149b0"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"533fa80a745467f4fbba461655e81384b03d8f97","unresolved":false,"context_lines":[{"line_number":103,"context_line":"            if rebalance:"},{"line_number":104,"context_line":"                for item in chassis_info["},{"line_number":105,"context_line":"                    (len(chassis_info) * 3 / 4):len(chassis_info)]:"},{"line_number":106,"context_line":"                    k \u003d item[0]"},{"line_number":107,"context_line":"                    item[0] \u003d item[1]"},{"line_number":108,"context_line":"                    item[1] \u003d k"},{"line_number":109,"context_line":"            return chassis_info"},{"line_number":110,"context_line":""},{"line_number":111,"context_line":"    @abc.abstractmethod"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_bd2f7486","line":108,"range":{"start_line":106,"start_character":0,"end_line":108,"end_character":31},"updated":"2019-04-30 11:31:18.000000000","message":"Changed it to a better syntax","commit_id":"b688ba92df27176bea65fdc25c92cda1c823ddfd"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":47,"context_line":"                          chassis_list\u003dNone):"},{"line_number":48,"context_line":"        existing_chassis \u003d [chassis for chassis, prio in chassis_list] if \\"},{"line_number":49,"context_line":"            chassis_list else nb_idl.get_gateway_chassis_binding(gateway_name)"},{"line_number":50,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":51,"context_line":"        # If no candidates, or gateway scheduled in max_chassis_count"},{"line_number":52,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_e1d04f53","line":49,"range":{"start_line":48,"start_character":0,"end_line":49,"end_character":78},"updated":"2019-05-07 12:17:13.000000000","message":"Opinion, no action required:\n\n existing_chassis \u003d nb_idl.get_gateway_chassis_binding(gateway_name)\n if chassis_list:\n     existing_chassis \u003d [chassis for chassis, prio in chassis_list]","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"0276a47dedfb25b1b8861adfb1e2d7cde6b58a20","unresolved":false,"context_lines":[{"line_number":43,"context_line":"        scheduled."},{"line_number":44,"context_line":"        \"\"\""},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":47,"context_line":"                          chassis_list\u003dNone):"},{"line_number":48,"context_line":"        existing_chassis \u003d [chassis for chassis, prio in chassis_list] if \\"},{"line_number":49,"context_line":"            chassis_list else nb_idl.get_gateway_chassis_binding(gateway_name)"},{"line_number":50,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":51,"context_line":"        # If no candidates, or gateway scheduled in max_chassis_count"},{"line_number":52,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_a666edec","line":49,"range":{"start_line":46,"start_character":0,"end_line":49,"end_character":78},"updated":"2019-05-07 11:05:56.000000000","message":"this is done to ensure that any physnet which doesnt exist anymore, or an invalid chassis , doesnt take part in the existing chassis ( obtained from the get_unhosted_gateway() )","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":47,"context_line":"                          chassis_list\u003dNone):"},{"line_number":48,"context_line":"        existing_chassis \u003d [chassis for chassis, prio in chassis_list] if \\"},{"line_number":49,"context_line":"            chassis_list else nb_idl.get_gateway_chassis_binding(gateway_name)"},{"line_number":50,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":51,"context_line":"        # If no candidates, or gateway scheduled in max_chassis_count"},{"line_number":52,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_a121f7b6","line":49,"range":{"start_line":48,"start_character":0,"end_line":49,"end_character":78},"in_reply_to":"dfbec78f_e1d04f53","updated":"2019-05-07 14:07:28.000000000","message":"something similar was present in PS#14.\nThis also sounds good, but I do not think there is anything wrong, except maybe the beauty of the code :)","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        # by the caller"},{"line_number":67,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":68,"context_line":"            nb_idl, candidates)[:chassis_size]"},{"line_number":69,"context_line":"        if existing_chassis:"},{"line_number":70,"context_line":"            # priority of existing chassis is higher than candidates"},{"line_number":71,"context_line":"            chassis \u003d existing_chassis + chassis"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","},{"line_number":74,"context_line":"                  gateway_name, chassis)"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_616a1f81","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":48},"updated":"2019-05-07 12:17:13.000000000","message":"chassis.extend(existing_chassis)","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        # by the caller"},{"line_number":67,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":68,"context_line":"            nb_idl, candidates)[:chassis_size]"},{"line_number":69,"context_line":"        if existing_chassis:"},{"line_number":70,"context_line":"            # priority of existing chassis is higher than candidates"},{"line_number":71,"context_line":"            chassis \u003d existing_chassis + chassis"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","},{"line_number":74,"context_line":"                  gateway_name, chassis)"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_810dd33f","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":48},"in_reply_to":"dfbec78f_616a1f81","updated":"2019-05-07 14:07:28.000000000","message":"I want to add the existing chassis to the beginning of the list as the element at the beginning of the list gets the highest priority ( when the backend code starts working )","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                  gateway_name, chassis)"},{"line_number":75,"context_line":"        return chassis"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def need_rebalance(self, nb_idl):"},{"line_number":78,"context_line":"        \"\"\"Check if rebalance is required or not"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        Case 1: Only one chassis, no rebalance"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_46761109","line":77,"updated":"2019-05-07 12:17:13.000000000","message":"You don\u0027t need to make this a bound method, make it a static method. Also it is not unittested.","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":74,"context_line":"                  gateway_name, chassis)"},{"line_number":75,"context_line":"        return chassis"},{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def need_rebalance(self, nb_idl):"},{"line_number":78,"context_line":"        \"\"\"Check if rebalance is required or not"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        Case 1: Only one chassis, no rebalance"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_91ff6400","line":77,"in_reply_to":"dfbec78f_46761109","updated":"2019-05-07 14:07:28.000000000","message":"Yeah, this crossed my mind, since there is no self used inside the function.\nI will add the UT","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":76,"context_line":""},{"line_number":77,"context_line":"    def need_rebalance(self, nb_idl):"},{"line_number":78,"context_line":"        \"\"\"Check if rebalance is required or not"},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"        Case 1: Only one chassis, no rebalance"},{"line_number":81,"context_line":"        Case 2: 2 Chassis, rebalance required if a new chassis is added"},{"line_number":82,"context_line":"        Case 3: More than 2 Chassis, rebalance required."}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_06f01967","line":79,"updated":"2019-05-07 12:17:13.000000000","message":"Case 0: No chassis","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        Input:"},{"line_number":85,"context_line":"        * nb_idl : North Bound DB\u0027s IDL connection"},{"line_number":86,"context_line":"        Output:"},{"line_number":87,"context_line":"        * Tuple of (Rebalance Required, Case Number -1) if chassis present"},{"line_number":88,"context_line":"        * None, None if no chassis present"},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        chassis \u003d nb_idl.get_all_chassis_gateway_bindings()"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_e6d5c5ba","line":87,"range":{"start_line":87,"start_character":40,"end_line":87,"end_character":51},"updated":"2019-05-07 12:17:13.000000000","message":"Instead of using Case Number as integer, name the cases with constants, it makes the code easier to read and you won\u0027t need None and have consistent interface for returned values.","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":84,"context_line":"        Input:"},{"line_number":85,"context_line":"        * nb_idl : North Bound DB\u0027s IDL connection"},{"line_number":86,"context_line":"        Output:"},{"line_number":87,"context_line":"        * Tuple of (Rebalance Required, Case Number -1) if chassis present"},{"line_number":88,"context_line":"        * None, None if no chassis present"},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        chassis \u003d nb_idl.get_all_chassis_gateway_bindings()"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_310eb832","line":87,"range":{"start_line":87,"start_character":40,"end_line":87,"end_character":51},"in_reply_to":"dfbec78f_e6d5c5ba","updated":"2019-05-07 14:07:28.000000000","message":"Would be using the enum/list","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":85,"context_line":"        * nb_idl : North Bound DB\u0027s IDL connection"},{"line_number":86,"context_line":"        Output:"},{"line_number":87,"context_line":"        * Tuple of (Rebalance Required, Case Number -1) if chassis present"},{"line_number":88,"context_line":"        * None, None if no chassis present"},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        chassis \u003d nb_idl.get_all_chassis_gateway_bindings()"},{"line_number":91,"context_line":"        if not chassis:"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_8655e952","line":88,"range":{"start_line":88,"start_character":10,"end_line":88,"end_character":14},"updated":"2019-05-07 12:17:13.000000000","message":"It is False","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        Case 2: 2 Chassis, rebalance required if a new chassis is added"},{"line_number":82,"context_line":"        Case 3: More than 2 Chassis, rebalance required."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        Input:"},{"line_number":85,"context_line":"        * nb_idl : North Bound DB\u0027s IDL connection"},{"line_number":86,"context_line":"        Output:"},{"line_number":87,"context_line":"        * Tuple of (Rebalance Required, Case Number -1) if chassis present"},{"line_number":88,"context_line":"        * None, None if no chassis present"},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        chassis \u003d nb_idl.get_all_chassis_gateway_bindings()"},{"line_number":91,"context_line":"        if not chassis:"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_c65be184","line":88,"range":{"start_line":84,"start_character":0,"end_line":88,"end_character":42},"updated":"2019-05-07 12:17:13.000000000","message":"Stick to standard docstring, see L154 for example.","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":81,"context_line":"        Case 2: 2 Chassis, rebalance required if a new chassis is added"},{"line_number":82,"context_line":"        Case 3: More than 2 Chassis, rebalance required."},{"line_number":83,"context_line":""},{"line_number":84,"context_line":"        Input:"},{"line_number":85,"context_line":"        * nb_idl : North Bound DB\u0027s IDL connection"},{"line_number":86,"context_line":"        Output:"},{"line_number":87,"context_line":"        * Tuple of (Rebalance Required, Case Number -1) if chassis present"},{"line_number":88,"context_line":"        * None, None if no chassis present"},{"line_number":89,"context_line":"        \"\"\""},{"line_number":90,"context_line":"        chassis \u003d nb_idl.get_all_chassis_gateway_bindings()"},{"line_number":91,"context_line":"        if not chassis:"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_712510ab","line":88,"range":{"start_line":84,"start_character":0,"end_line":88,"end_character":42},"in_reply_to":"dfbec78f_c65be184","updated":"2019-05-07 14:07:28.000000000","message":"Ok, sure will do","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        chassis \u003d nb_idl.get_all_chassis_gateway_bindings()"},{"line_number":91,"context_line":"        if not chassis:"},{"line_number":92,"context_line":"            return False, None"},{"line_number":93,"context_line":"        if len(chassis.keys()) \u003d\u003d 1:"},{"line_number":94,"context_line":"            # Only one chassis, no need to rebalance"},{"line_number":95,"context_line":"            return False, 0"},{"line_number":96,"context_line":"        if len(chassis.keys()) \u003d\u003d 2:"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_06c7b914","line":93,"range":{"start_line":93,"start_character":22,"end_line":93,"end_character":29},"updated":"2019-05-07 12:17:13.000000000","message":"You don\u0027t need this","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":90,"context_line":"        chassis \u003d nb_idl.get_all_chassis_gateway_bindings()"},{"line_number":91,"context_line":"        if not chassis:"},{"line_number":92,"context_line":"            return False, None"},{"line_number":93,"context_line":"        if len(chassis.keys()) \u003d\u003d 1:"},{"line_number":94,"context_line":"            # Only one chassis, no need to rebalance"},{"line_number":95,"context_line":"            return False, 0"},{"line_number":96,"context_line":"        if len(chassis.keys()) \u003d\u003d 2:"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_f117c044","line":93,"range":{"start_line":93,"start_character":22,"end_line":93,"end_character":29},"in_reply_to":"dfbec78f_06c7b914","updated":"2019-05-07 14:07:28.000000000","message":"yeah, I dont I guess","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        if len(chassis.keys()) \u003d\u003d 1:"},{"line_number":94,"context_line":"            # Only one chassis, no need to rebalance"},{"line_number":95,"context_line":"            return False, 0"},{"line_number":96,"context_line":"        if len(chassis.keys()) \u003d\u003d 2:"},{"line_number":97,"context_line":"            # We have 2 chassis, which means, either there was only one"},{"line_number":98,"context_line":"            # initially and then we added a second one,or there were 2 to"},{"line_number":99,"context_line":"            # start with. If a chassis has no ports, i.e. [], means this is"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_26cc3d34","line":96,"range":{"start_line":96,"start_character":22,"end_line":96,"end_character":29},"updated":"2019-05-07 12:17:13.000000000","message":"ditto","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":93,"context_line":"        if len(chassis.keys()) \u003d\u003d 1:"},{"line_number":94,"context_line":"            # Only one chassis, no need to rebalance"},{"line_number":95,"context_line":"            return False, 0"},{"line_number":96,"context_line":"        if len(chassis.keys()) \u003d\u003d 2:"},{"line_number":97,"context_line":"            # We have 2 chassis, which means, either there was only one"},{"line_number":98,"context_line":"            # initially and then we added a second one,or there were 2 to"},{"line_number":99,"context_line":"            # start with. If a chassis has no ports, i.e. [], means this is"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_b12b8880","line":96,"range":{"start_line":96,"start_character":22,"end_line":96,"end_character":29},"in_reply_to":"dfbec78f_26cc3d34","updated":"2019-05-07 14:07:28.000000000","message":"ditto","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":100,"context_line":"            # a fresh chassis which should be the ideal scenario to rebalance."},{"line_number":101,"context_line":"            # If the chassis is discovered by OVN after rebalance is called,"},{"line_number":102,"context_line":"            # then all ports on it would be assigned the priority 1."},{"line_number":103,"context_line":"            rebalance \u003d True"},{"line_number":104,"context_line":"            for chassis_name, values in chassis.items():"},{"line_number":105,"context_line":"                if not values:"},{"line_number":106,"context_line":"                    return rebalance, 1"},{"line_number":107,"context_line":"                for lrp, priority in values:"},{"line_number":108,"context_line":"                    if priority !\u003d 1:"},{"line_number":109,"context_line":"                        rebalance \u003d False"},{"line_number":110,"context_line":"                        break"},{"line_number":111,"context_line":"            return rebalance, 1"},{"line_number":112,"context_line":"        if len(chassis.keys()) \u003e 2:"},{"line_number":113,"context_line":"            # We need to check for Master nodes"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_71499089","line":110,"range":{"start_line":103,"start_character":1,"end_line":110,"end_character":29},"updated":"2019-05-07 14:07:28.000000000","message":"There is a fallacy in this code. It highly depends on the order of the chassis retrieved. It is possible that we retrieve the master node first, which has all router gateways at priority 2, which messes things up since it means all router gateway ports are unbalanced!","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4ff2831e0046b9fd45bdd9e5fc2717917b40bc63","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":47,"context_line":"                          chassis_list\u003dNone):"},{"line_number":48,"context_line":"        existing_chassis \u003d [chassis for chassis, prio in chassis_list] if \\"},{"line_number":49,"context_line":"            chassis_list else nb_idl.get_gateway_chassis_binding(gateway_name)"},{"line_number":50,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":51,"context_line":"        # If no candidates, or gateway scheduled in max_chassis_count"},{"line_number":52,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."}],"source_content_type":"text/x-python","patch_set":23,"id":"dfbec78f_162ca645","line":49,"range":{"start_line":48,"start_character":27,"end_line":49,"end_character":24},"updated":"2019-05-09 10:34:46.000000000","message":"This bit here looks like the implementation of get_gateway_chassis_binding() [0].\n\nI\u0027m just wondering if we really need to pass that \"chassis_list\" parameter all that way here (schedule_unhosted_gateways() -\u003e scheduler.select() -\u003e here) or if we could just use get_gateway_chassis_binding() to get the same list.\n\n[0] https://github.com/openstack/networking-ovn/blob/b2c6cda688471dd9fb5085df6ff07c3c5290660b/networking_ovn/ovsdb/impl_idl_ovn.py#L433-L434","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"cb56e7395cccd9621c3f265277382f4f7d110355","unresolved":false,"context_lines":[{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":47,"context_line":"                          chassis_list\u003dNone):"},{"line_number":48,"context_line":"        existing_chassis \u003d [chassis for chassis, prio in chassis_list] if \\"},{"line_number":49,"context_line":"            chassis_list else nb_idl.get_gateway_chassis_binding(gateway_name)"},{"line_number":50,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":51,"context_line":"        # If no candidates, or gateway scheduled in max_chassis_count"},{"line_number":52,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."}],"source_content_type":"text/x-python","patch_set":23,"id":"dfbec78f_967c16b6","line":49,"range":{"start_line":48,"start_character":27,"end_line":49,"end_character":24},"in_reply_to":"dfbec78f_162ca645","updated":"2019-05-09 10:57:12.000000000","message":"I think I can remove it. I changed the logic a bit today and this should therefore not be present in this patch","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e33ab546f5fb7e21b0c8866363c1c0882f614709","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        existing_chassis \u003d [chassis for chassis, prio in chassis_list] if \\"},{"line_number":49,"context_line":"            chassis_list else nb_idl.get_gateway_chassis_binding(gateway_name)"},{"line_number":50,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":51,"context_line":"        # If no candidates, or gateway scheduled in max_chassis_count"},{"line_number":52,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."},{"line_number":53,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":54,"context_line":"        if existing_chassis and (not candidates or len("}],"source_content_type":"text/x-python","patch_set":23,"id":"dfbec78f_13eb58b0","line":51,"range":{"start_line":51,"start_character":52,"end_line":51,"end_character":69},"updated":"2019-05-09 09:47:34.000000000","message":"MAX_GW_CHASSIS ?","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"395be7734a1d6fe230c0570d625ab885599c390d","unresolved":false,"context_lines":[{"line_number":48,"context_line":"        existing_chassis \u003d [chassis for chassis, prio in chassis_list] if \\"},{"line_number":49,"context_line":"            chassis_list else nb_idl.get_gateway_chassis_binding(gateway_name)"},{"line_number":50,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":51,"context_line":"        # If no candidates, or gateway scheduled in max_chassis_count"},{"line_number":52,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."},{"line_number":53,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":54,"context_line":"        if existing_chassis and (not candidates or len("}],"source_content_type":"text/x-python","patch_set":23,"id":"dfbec78f_36d44a20","line":51,"range":{"start_line":51,"start_character":52,"end_line":51,"end_character":69},"in_reply_to":"dfbec78f_13eb58b0","updated":"2019-05-09 10:28:50.000000000","message":"Yes. Would fix this","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"4ff2831e0046b9fd45bdd9e5fc2717917b40bc63","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        # by the caller"},{"line_number":67,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":68,"context_line":"            nb_idl, candidates)[:chassis_size]"},{"line_number":69,"context_line":"        if existing_chassis:"},{"line_number":70,"context_line":"            # priority of existing chassis is higher than candidates"},{"line_number":71,"context_line":"            chassis \u003d existing_chassis + chassis"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","},{"line_number":74,"context_line":"                  gateway_name, chassis)"}],"source_content_type":"text/x-python","patch_set":23,"id":"dfbec78f_5688de6f","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":48},"updated":"2019-05-09 10:34:46.000000000","message":"chassis +\u003d existing_chassis\n\nThe if is not needed because \"existing_chassis\" will be an empty list.","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"cb56e7395cccd9621c3f265277382f4f7d110355","unresolved":false,"context_lines":[{"line_number":66,"context_line":"        # by the caller"},{"line_number":67,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":68,"context_line":"            nb_idl, candidates)[:chassis_size]"},{"line_number":69,"context_line":"        if existing_chassis:"},{"line_number":70,"context_line":"            # priority of existing chassis is higher than candidates"},{"line_number":71,"context_line":"            chassis \u003d existing_chassis + chassis"},{"line_number":72,"context_line":""},{"line_number":73,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","},{"line_number":74,"context_line":"                  gateway_name, chassis)"}],"source_content_type":"text/x-python","patch_set":23,"id":"dfbec78f_f63b12e8","line":71,"range":{"start_line":69,"start_character":0,"end_line":71,"end_character":48},"in_reply_to":"dfbec78f_5688de6f","updated":"2019-05-09 10:57:12.000000000","message":"Why?\nIf Candidates \u003d [C1,C2,C3,C4] and existing_chassis \u003d [C1,C2], we would arrive at this point right?","commit_id":"f5b5e42b253b6f5e6f97e5621e4bb66872ea2af2"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":44,"context_line":"        scheduled."},{"line_number":45,"context_line":"        \"\"\""},{"line_number":46,"context_line":""},{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        for chassis_name in existing_chassis:"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_caceff58","line":47,"range":{"start_line":47,"start_character":7,"end_line":47,"end_character":31},"updated":"2019-05-15 09:13:18.000000000","message":"This method deserves some unit testing.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":51,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":52,"context_line":"                                                physnet, chassis_physnets):"},{"line_number":53,"context_line":"                LOG.debug(\"Chassis %s found to be invalid\", chassis_name)"},{"line_number":54,"context_line":"                existing_chassis.remove(chassis_name)"},{"line_number":55,"context_line":"        return existing_chassis"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_aad2ab26","line":53,"range":{"start_line":53,"start_character":38,"end_line":53,"end_character":49},"updated":"2019-05-15 09:13:18.000000000","message":"is","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":50,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":51,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":52,"context_line":"                                                physnet, chassis_physnets):"},{"line_number":53,"context_line":"                LOG.debug(\"Chassis %s found to be invalid\", chassis_name)"},{"line_number":54,"context_line":"                existing_chassis.remove(chassis_name)"},{"line_number":55,"context_line":"        return existing_chassis"},{"line_number":56,"context_line":""}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_0a489784","line":53,"range":{"start_line":53,"start_character":38,"end_line":53,"end_character":49},"in_reply_to":"dfbec78f_aad2ab26","updated":"2019-05-15 09:26:43.000000000","message":"is missing, will be added","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":52,"context_line":"                                                physnet, chassis_physnets):"},{"line_number":53,"context_line":"                LOG.debug(\"Chassis %s found to be invalid\", chassis_name)"},{"line_number":54,"context_line":"                existing_chassis.remove(chassis_name)"},{"line_number":55,"context_line":"        return existing_chassis"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_eae503dd","line":54,"range":{"start_line":54,"start_character":16,"end_line":54,"end_character":53},"updated":"2019-05-15 09:13:18.000000000","message":"I don\u0027t think this side-effect of removing items from passed parameter is intentional. You should make a copy first, then modify it and return. Don\u0027t modify objects that were passed from the caller unless it\u0027s absolutely intentional.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":51,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":52,"context_line":"                                                physnet, chassis_physnets):"},{"line_number":53,"context_line":"                LOG.debug(\"Chassis %s found to be invalid\", chassis_name)"},{"line_number":54,"context_line":"                existing_chassis.remove(chassis_name)"},{"line_number":55,"context_line":"        return existing_chassis"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_8a532739","line":54,"range":{"start_line":54,"start_character":16,"end_line":54,"end_character":53},"in_reply_to":"dfbec78f_eae503dd","updated":"2019-05-15 09:26:43.000000000","message":"Ok, I can do that","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":58,"context_line":"                          existing_chassis):"},{"line_number":59,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":60,"context_line":"        # If no candidates, or gateway scheduled in MAX_GATEWAY_CHASSIS"},{"line_number":61,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."},{"line_number":62,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":63,"context_line":"        if existing_chassis and (not candidates or len("}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_aab14b49","line":60,"range":{"start_line":60,"start_character":49,"end_line":60,"end_character":71},"updated":"2019-05-15 09:13:18.000000000","message":"\"on MAX_GATEWAY_CHASSIS nodes\" ?","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":57,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":58,"context_line":"                          existing_chassis):"},{"line_number":59,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":60,"context_line":"        # If no candidates, or gateway scheduled in MAX_GATEWAY_CHASSIS"},{"line_number":61,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."},{"line_number":62,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":63,"context_line":"        if existing_chassis and (not candidates or len("}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_2a347bfb","line":60,"range":{"start_line":60,"start_character":49,"end_line":60,"end_character":71},"in_reply_to":"dfbec78f_aab14b49","updated":"2019-05-15 09:26:43.000000000","message":"Done","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."},{"line_number":62,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":63,"context_line":"        if existing_chassis and (not candidates or len("},{"line_number":64,"context_line":"            existing_chassis) \u003d\u003d ovn_const.MAX_GW_CHASSIS or not ("},{"line_number":65,"context_line":"                set(candidates) - set(existing_chassis))):"},{"line_number":66,"context_line":"            return existing_chassis"},{"line_number":67,"context_line":"        if not candidates:"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_ea3f4384","line":64,"updated":"2019-05-15 09:13:18.000000000","message":"nit: indentation is wrong but it was wrong already in the previous version :)","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":61,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."},{"line_number":62,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":63,"context_line":"        if existing_chassis and (not candidates or len("},{"line_number":64,"context_line":"            existing_chassis) \u003d\u003d ovn_const.MAX_GW_CHASSIS or not ("},{"line_number":65,"context_line":"                set(candidates) - set(existing_chassis))):"},{"line_number":66,"context_line":"            return existing_chassis"},{"line_number":67,"context_line":"        if not candidates:"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_8a280797","line":64,"in_reply_to":"dfbec78f_ea3f4384","updated":"2019-05-15 09:26:43.000000000","message":"4 spaces?\nLet me check and get back on this","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            return existing_chassis"},{"line_number":67,"context_line":"        if not candidates:"},{"line_number":68,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"},{"line_number":69,"context_line":"        chassis_size \u003d ovn_const.MAX_GW_CHASSIS"},{"line_number":70,"context_line":"        if existing_chassis:"},{"line_number":71,"context_line":"            chassis_size -\u003d len(existing_chassis)"},{"line_number":72,"context_line":"            candidates \u003d list(set(candidates) - set(existing_chassis))"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_8a67a7b7","line":69,"range":{"start_line":69,"start_character":8,"end_line":69,"end_character":20},"updated":"2019-05-15 09:13:18.000000000","message":"nit (no action required): I think chassis_count make more sense.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            return existing_chassis"},{"line_number":67,"context_line":"        if not candidates:"},{"line_number":68,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"},{"line_number":69,"context_line":"        chassis_size \u003d ovn_const.MAX_GW_CHASSIS"},{"line_number":70,"context_line":"        if existing_chassis:"},{"line_number":71,"context_line":"            chassis_size -\u003d len(existing_chassis)"},{"line_number":72,"context_line":"            candidates \u003d list(set(candidates) - set(existing_chassis))"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_2a1d5b73","line":69,"range":{"start_line":69,"start_character":8,"end_line":69,"end_character":20},"in_reply_to":"dfbec78f_8a67a7b7","updated":"2019-05-15 09:26:43.000000000","message":"Can  be changed","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            return existing_chassis"},{"line_number":67,"context_line":"        if not candidates:"},{"line_number":68,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"},{"line_number":69,"context_line":"        chassis_size \u003d ovn_const.MAX_GW_CHASSIS"},{"line_number":70,"context_line":"        if existing_chassis:"},{"line_number":71,"context_line":"            chassis_size -\u003d len(existing_chassis)"},{"line_number":72,"context_line":"            candidates \u003d list(set(candidates) - set(existing_chassis))"},{"line_number":73,"context_line":"        # The actual binding of the gateway to a chassis via the options"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_8a1567e7","line":70,"range":{"start_line":69,"start_character":47,"end_line":70,"end_character":28},"updated":"2019-05-15 09:13:18.000000000","message":"you can get rid of all the \"if existing_chassis\" if you do at the beginning of the method\n\n existing_chassis \u003d existing_chassis or []\n\nand you won\u0027 t need to write into chassis_size twice because you can always do\n\n chassis_size \u003d ovn_const.MAX_GW_CHASSIS - len(existing_chassis)","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a4681a943fb3498f60191aaa50388a6d380bd9b0","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            return existing_chassis"},{"line_number":67,"context_line":"        if not candidates:"},{"line_number":68,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"},{"line_number":69,"context_line":"        chassis_size \u003d ovn_const.MAX_GW_CHASSIS"},{"line_number":70,"context_line":"        if existing_chassis:"},{"line_number":71,"context_line":"            chassis_size -\u003d len(existing_chassis)"},{"line_number":72,"context_line":"            candidates \u003d list(set(candidates) - set(existing_chassis))"},{"line_number":73,"context_line":"        # The actual binding of the gateway to a chassis via the options"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_35c140e6","line":70,"range":{"start_line":69,"start_character":47,"end_line":70,"end_character":28},"in_reply_to":"dfbec78f_353aa098","updated":"2019-05-15 10:10:36.000000000","message":"Done","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            return existing_chassis"},{"line_number":67,"context_line":"        if not candidates:"},{"line_number":68,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"},{"line_number":69,"context_line":"        chassis_size \u003d ovn_const.MAX_GW_CHASSIS"},{"line_number":70,"context_line":"        if existing_chassis:"},{"line_number":71,"context_line":"            chassis_size -\u003d len(existing_chassis)"},{"line_number":72,"context_line":"            candidates \u003d list(set(candidates) - set(existing_chassis))"},{"line_number":73,"context_line":"        # The actual binding of the gateway to a chassis via the options"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_ca0b5f27","line":70,"range":{"start_line":69,"start_character":47,"end_line":70,"end_character":28},"in_reply_to":"dfbec78f_8a1567e7","updated":"2019-05-15 09:26:43.000000000","message":"Wont setting existing chassis to [] require me to still test the condition out? Yes I can probably remove this condition with that one line","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cae481ce8d5aab4f882c57f95857c8690fafea7f","unresolved":false,"context_lines":[{"line_number":66,"context_line":"            return existing_chassis"},{"line_number":67,"context_line":"        if not candidates:"},{"line_number":68,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"},{"line_number":69,"context_line":"        chassis_size \u003d ovn_const.MAX_GW_CHASSIS"},{"line_number":70,"context_line":"        if existing_chassis:"},{"line_number":71,"context_line":"            chassis_size -\u003d len(existing_chassis)"},{"line_number":72,"context_line":"            candidates \u003d list(set(candidates) - set(existing_chassis))"},{"line_number":73,"context_line":"        # The actual binding of the gateway to a chassis via the options"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_353aa098","line":70,"range":{"start_line":69,"start_character":47,"end_line":70,"end_character":28},"in_reply_to":"dfbec78f_ca0b5f27","updated":"2019-05-15 09:36:26.000000000","message":"I don\u0027t see where you would need it. chassis_size would be fine, because len is 0. And L80 will be fine as well as you\u0027d be concatenating empty list with chassis.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"10e7b53b81b77ffdad549cf1f288a5c6f7f088b7","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        chassis_list \u003d copy.deepcopy(existing_chassis)"},{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_360866d8","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":36},"updated":"2019-05-15 13:16:38.000000000","message":"I don\u0027t think you need a deep copy as you don\u0027t modify objects in the list themselves but only the list.\n\n chassis_list \u003d list(existing_chassis)\n\nis enough or instead of chassis_list, you can use existing_chassis as you con\u0027t even need the original.","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"3a8f60763175df0f90e1cbf7a7d217b892a9aef8","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        chassis_list \u003d copy.deepcopy(existing_chassis)"},{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_263f36d7","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":36},"in_reply_to":"bfb3d3c7_0b200fb0","updated":"2019-05-23 03:13:03.000000000","message":"Done","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c65f8856f73296bbe10b88966963e444bca81a12","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        chassis_list \u003d copy.deepcopy(existing_chassis)"},{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_abc5433e","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":36},"in_reply_to":"bfb3d3c7_0b900f4e","updated":"2019-05-22 09:46:43.000000000","message":"My question, which I asked on IRC to Jakub was whether to change it in this patch, if its a blocker, or can I let it go and merge it in next patch ( or patchset if there is another revision ). As discussed with him, this wasnt a deal breaker and if there isnt another iteration of this patch, can be taken care in the next one.","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"b96aee2908bc37a3af7fe392b6b5a88851bc41c1","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        chassis_list \u003d copy.deepcopy(existing_chassis)"},{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_eb033b41","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":36},"in_reply_to":"bfb3d3c7_abc5433e","updated":"2019-05-22 10:00:17.000000000","message":"You asked about indentation changes and not about the copy...","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f370bce9a458470fa2bdb774d733c6555ae8bf12","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        chassis_list \u003d copy.deepcopy(existing_chassis)"},{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_eb1e066f","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":36},"in_reply_to":"bfb3d3c7_cb78e2f9","updated":"2019-05-20 13:14:53.000000000","message":"Should I change?","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"6bcd24b77e523a8bd199035ab6289f7a24d426fc","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        chassis_list \u003d copy.deepcopy(existing_chassis)"},{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_0b200fb0","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":36},"in_reply_to":"bfb3d3c7_eb033b41","updated":"2019-05-22 10:04:35.000000000","message":"I guess I did about the whole thing, but if I missed it, then do let me know if I should change it right now? I agree with your point here.","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"bd032f8ff80b189e2cdda300793973d796f391a7","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        chassis_list \u003d copy.deepcopy(existing_chassis)"},{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_0b900f4e","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":36},"in_reply_to":"bfb3d3c7_eb1e066f","updated":"2019-05-22 09:40:36.000000000","message":"If you don\u0027t agree, don\u0027t change it but please say why.\nIMO, Kuba\u0027s right and we don\u0027t need to do a deep copy as you\u0027re just modifying the list itself but not its elements.","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5c9d5ed5b39d7bbdd0b2fdb73a96041a440c34e6","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        chassis_list \u003d copy.deepcopy(existing_chassis)"},{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_639b7917","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":36},"in_reply_to":"dfbec78f_360866d8","updated":"2019-05-15 17:17:49.000000000","message":"If I use exsiting_chassis, its the same as the implementation earlier.\nI do agree with having a copy of the existing_chassis list, since otherwise we are modifying the list while traversing it ( which is not a problem in Python ), but then the copy IMHO should be a deepcopy, otherwise we have the same list object if we do a shallow copy.","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"9d46f3d77fca878daffb638fb2de81228b12a2e2","unresolved":false,"context_lines":[{"line_number":47,"context_line":"    def filter_existing_chassis(self, nb_idl, gw_chassis,"},{"line_number":48,"context_line":"                                physnet, chassis_physnets,"},{"line_number":49,"context_line":"                                existing_chassis):"},{"line_number":50,"context_line":"        chassis_list \u003d copy.deepcopy(existing_chassis)"},{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_cb78e2f9","line":50,"range":{"start_line":50,"start_character":28,"end_line":50,"end_character":36},"in_reply_to":"dfbec78f_639b7917","updated":"2019-05-20 13:11:06.000000000","message":"Yes, that\u0027s what we want. We don\u0027t modify the items but only the list. And we don\u0027t want to interfere with the original list, that\u0027s why shallow copy is much better than deep copy.","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"10e7b53b81b77ffdad549cf1f288a5c6f7f088b7","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":66,"context_line":"        if existing_chassis:"},{"line_number":67,"context_line":"            if not candidates or len("},{"line_number":68,"context_line":"                existing_chassis) \u003d\u003d ovn_const.MAX_GW_CHASSIS:"},{"line_number":69,"context_line":"                return existing_chassis"},{"line_number":70,"context_line":"        if not candidates:"},{"line_number":71,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_b624565f","line":68,"updated":"2019-05-15 13:16:38.000000000","message":"indentation","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"3a8f60763175df0f90e1cbf7a7d217b892a9aef8","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":66,"context_line":"        if existing_chassis:"},{"line_number":67,"context_line":"            if not candidates or len("},{"line_number":68,"context_line":"                existing_chassis) \u003d\u003d ovn_const.MAX_GW_CHASSIS:"},{"line_number":69,"context_line":"                return existing_chassis"},{"line_number":70,"context_line":"        if not candidates:"},{"line_number":71,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_c625fac3","line":68,"in_reply_to":"bfb3d3c7_eb7da6e7","updated":"2019-05-23 03:13:03.000000000","message":"Done","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f370bce9a458470fa2bdb774d733c6555ae8bf12","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":66,"context_line":"        if existing_chassis:"},{"line_number":67,"context_line":"            if not candidates or len("},{"line_number":68,"context_line":"                existing_chassis) \u003d\u003d ovn_const.MAX_GW_CHASSIS:"},{"line_number":69,"context_line":"                return existing_chassis"},{"line_number":70,"context_line":"        if not candidates:"},{"line_number":71,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_6b0a1627","line":68,"in_reply_to":"bfb3d3c7_eb7da6e7","updated":"2019-05-20 13:14:53.000000000","message":"No, it doesnt.\nShould I change?","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"9d46f3d77fca878daffb638fb2de81228b12a2e2","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":66,"context_line":"        if existing_chassis:"},{"line_number":67,"context_line":"            if not candidates or len("},{"line_number":68,"context_line":"                existing_chassis) \u003d\u003d ovn_const.MAX_GW_CHASSIS:"},{"line_number":69,"context_line":"                return existing_chassis"},{"line_number":70,"context_line":"        if not candidates:"},{"line_number":71,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_eb7da6e7","line":68,"in_reply_to":"dfbec78f_5e9e4cb9","updated":"2019-05-20 13:11:06.000000000","message":"Does\n\n if not candidates or len(\n         existing_chassis) \u003d\u003d ovn_const.MAX_GW_CHASSIS:\n     return existing_chassis\n\ncomplain?","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5c9d5ed5b39d7bbdd0b2fdb73a96041a440c34e6","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        # Otherwise, if more candidates present, then schedule them."},{"line_number":66,"context_line":"        if existing_chassis:"},{"line_number":67,"context_line":"            if not candidates or len("},{"line_number":68,"context_line":"                existing_chassis) \u003d\u003d ovn_const.MAX_GW_CHASSIS:"},{"line_number":69,"context_line":"                return existing_chassis"},{"line_number":70,"context_line":"        if not candidates:"},{"line_number":71,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_5e9e4cb9","line":68,"in_reply_to":"dfbec78f_b624565f","updated":"2019-05-15 17:17:49.000000000","message":"So I tried to fix it but was having pep8\u0027s - E129 error, therefore I have referenced [1] and utilizing a solution mentioned there. Do let me know if there is an issue with it.\nhttps://github.com/PyCQA/pycodestyle/issues/126","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"51ebcd8453a6dba7283ad830782c3cd5a91b3b06","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"},{"line_number":54,"context_line":"                LOG.debug(\"Chassis %s is invalid\", chassis_name)"},{"line_number":55,"context_line":"                chassis_list.remove(chassis_name)"},{"line_number":56,"context_line":"        return chassis_list"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_7ff05e68","line":54,"range":{"start_line":54,"start_character":41,"end_line":54,"end_character":48},"updated":"2019-05-22 15:22:33.000000000","message":"nit: invalid for scheduling routers on\n\nMaking it less generic otherwise, for those just looking at the logs which don\u0027t know the code (\u003d\u003d operators) this may sound confusing/scary.","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"bcff8d6c3ec506ee0489c4e6d6b04684f1ae1626","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"},{"line_number":54,"context_line":"                LOG.debug(\"Chassis %s is invalid\", chassis_name)"},{"line_number":55,"context_line":"                chassis_list.remove(chassis_name)"},{"line_number":56,"context_line":"        return chassis_list"},{"line_number":57,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_1d5b6a54","line":54,"range":{"start_line":54,"start_character":41,"end_line":54,"end_character":48},"in_reply_to":"bfb3d3c7_7ff05e68","updated":"2019-05-22 16:10:51.000000000","message":"Done","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"51ebcd8453a6dba7283ad830782c3cd5a91b3b06","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                return existing_chassis"},{"line_number":70,"context_line":"        if not candidates:"},{"line_number":71,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"},{"line_number":72,"context_line":"        chassis_size \u003d ovn_const.MAX_GW_CHASSIS - len(existing_chassis)"},{"line_number":73,"context_line":"        # The actual binding of the gateway to a chassis via the options"},{"line_number":74,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":75,"context_line":"        # by the caller"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_9f667229","line":72,"range":{"start_line":72,"start_character":16,"end_line":72,"end_character":20},"updated":"2019-05-22 15:22:33.000000000","message":"nit: count ?\n\nSize sounds like the actual size/volume of a given chassis. Not a number of chassis","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"bcff8d6c3ec506ee0489c4e6d6b04684f1ae1626","unresolved":false,"context_lines":[{"line_number":69,"context_line":"                return existing_chassis"},{"line_number":70,"context_line":"        if not candidates:"},{"line_number":71,"context_line":"            return [ovn_const.OVN_GATEWAY_INVALID_CHASSIS]"},{"line_number":72,"context_line":"        chassis_size \u003d ovn_const.MAX_GW_CHASSIS - len(existing_chassis)"},{"line_number":73,"context_line":"        # The actual binding of the gateway to a chassis via the options"},{"line_number":74,"context_line":"        # column or gateway_chassis column in the OVN_Northbound is done"},{"line_number":75,"context_line":"        # by the caller"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_7d31460b","line":72,"range":{"start_line":72,"start_character":16,"end_line":72,"end_character":20},"in_reply_to":"bfb3d3c7_9f667229","updated":"2019-05-22 16:10:51.000000000","message":"Done","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"51ebcd8453a6dba7283ad830782c3cd5a91b3b06","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":77,"context_line":"            nb_idl, candidates)[:chassis_size]"},{"line_number":78,"context_line":"        # priority of existing chassis is higher than candidates"},{"line_number":79,"context_line":"        chassis \u003d existing_chassis + chassis"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","},{"line_number":82,"context_line":"                  gateway_name, chassis)"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_bf9256f5","line":79,"range":{"start_line":79,"start_character":8,"end_line":79,"end_character":44},"updated":"2019-05-22 15:22:33.000000000","message":"chassis +\u003d existing_chassis","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"bcff8d6c3ec506ee0489c4e6d6b04684f1ae1626","unresolved":false,"context_lines":[{"line_number":76,"context_line":"        chassis \u003d self._select_gateway_chassis("},{"line_number":77,"context_line":"            nb_idl, candidates)[:chassis_size]"},{"line_number":78,"context_line":"        # priority of existing chassis is higher than candidates"},{"line_number":79,"context_line":"        chassis \u003d existing_chassis + chassis"},{"line_number":80,"context_line":""},{"line_number":81,"context_line":"        LOG.debug(\"Gateway %s scheduled on chassis %s\","},{"line_number":82,"context_line":"                  gateway_name, chassis)"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_fd2456c8","line":79,"range":{"start_line":79,"start_character":8,"end_line":79,"end_character":44},"in_reply_to":"bfb3d3c7_bf9256f5","updated":"2019-05-22 16:10:51.000000000","message":"i might have explained in a previous PS. We need to keep existing chassis before the candidates so that the existing chassis get highet priority","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"730ec6deb194b244223ef5e41eedae0fa32341c5","unresolved":false,"context_lines":[{"line_number":51,"context_line":"        for chassis_name in existing_chassis:"},{"line_number":52,"context_line":"            if utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":53,"context_line":"                                                physnet, chassis_physnets):"},{"line_number":54,"context_line":"                LOG.debug(\"Chassis %s is invalid for scheduling routers\","},{"line_number":55,"context_line":"                          chassis_name)"},{"line_number":56,"context_line":"                chassis_list.remove(chassis_name)"},{"line_number":57,"context_line":"        return chassis_list"},{"line_number":58,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"7faddb67_989c625e","line":55,"range":{"start_line":54,"start_character":16,"end_line":55,"end_character":39},"updated":"2019-07-09 10:42:24.000000000","message":"Having more verbose debug would be nice.","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"df77976af99699e3cc1777b7a1202a88ec7dc25f","unresolved":false,"context_lines":[{"line_number":56,"context_line":"                chassis_list.remove(chassis_name)"},{"line_number":57,"context_line":"        return chassis_list"},{"line_number":58,"context_line":""},{"line_number":59,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":60,"context_line":"                          existing_chassis):"},{"line_number":61,"context_line":"        existing_chassis \u003d existing_chassis or []"},{"line_number":62,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"}],"source_content_type":"text/x-python","patch_set":37,"id":"7faddb67_585b4a53","line":59,"range":{"start_line":59,"start_character":62,"end_line":59,"end_character":72},"updated":"2019-07-09 11:20:41.000000000","message":"What if this is empty?","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"df77976af99699e3cc1777b7a1202a88ec7dc25f","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":60,"context_line":"                          existing_chassis):"},{"line_number":61,"context_line":"        existing_chassis \u003d existing_chassis or []"},{"line_number":62,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":63,"context_line":"        candidates \u003d list(set(candidates) - set(existing_chassis))"},{"line_number":64,"context_line":"        # If no candidates, or gateway scheduled on MAX_GATEWAY_CHASSIS nodes"},{"line_number":65,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."}],"source_content_type":"text/x-python","patch_set":37,"id":"7faddb67_f859d659","line":62,"range":{"start_line":62,"start_character":40,"end_line":62,"end_character":63},"updated":"2019-07-09 11:20:41.000000000","message":"This will return all chassis, not filtered by physnet? What if there is chassis gateway configured and also there are no physical provider network mapping on computes related to this provider net? It will be processed up to L77.","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"652cda99d5a1807645db1a5548e73ab7da474bd7","unresolved":false,"context_lines":[{"line_number":59,"context_line":"    def _schedule_gateway(self, nb_idl, sb_idl, gateway_name, candidates,"},{"line_number":60,"context_line":"                          existing_chassis):"},{"line_number":61,"context_line":"        existing_chassis \u003d existing_chassis or []"},{"line_number":62,"context_line":"        candidates \u003d candidates or self._get_chassis_candidates(sb_idl)"},{"line_number":63,"context_line":"        candidates \u003d list(set(candidates) - set(existing_chassis))"},{"line_number":64,"context_line":"        # If no candidates, or gateway scheduled on MAX_GATEWAY_CHASSIS nodes"},{"line_number":65,"context_line":"        # or all candidates in existing_chassis, return existing_chassis."}],"source_content_type":"text/x-python","patch_set":37,"id":"7faddb67_406b0f84","line":62,"range":{"start_line":62,"start_character":40,"end_line":62,"end_character":63},"in_reply_to":"7faddb67_f859d659","updated":"2019-07-12 11:21:24.000000000","message":"I tried to modify it and a few test failed. IMO we shouldn\u0027t try to bind a port that has no connectivity to provider network, but its topic for other patch. Leaving as it is for now.","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"}],"networking_ovn/ovsdb/impl_idl_ovn.py":[{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"e3818d867224d307b0bafc196de5a59adbccc580","unresolved":false,"context_lines":[{"line_number":442,"context_line":"                        (gw_chassis and chassis_name not in gw_chassis)):"},{"line_number":443,"context_line":"                    chassis_list.remove((chassis_name, prio))"},{"line_number":444,"context_line":"            if len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS:"},{"line_number":445,"context_line":"                unhosted_gateways.append((lrp.name, chassis_list))"},{"line_number":446,"context_line":"        return unhosted_gateways"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"    def add_dhcp_options(self, subnet_id, port_id\u003dNone, may_exist\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_672d43a7","line":445,"updated":"2018-08-20 08:26:52.000000000","message":"as we\u0027re populating unhosted_gateways as long as it has less than MAX_GW_CHASSIS elements, we can save time and add\nelse:\n    return unhosted_gateways\nwhat do you think?","commit_id":"ba8468c38a334e2a7a5da75f93f5c2473d1e3943"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"4f6b3b3365d3359d43e5a96e5e4b2b1078afc904","unresolved":false,"context_lines":[{"line_number":442,"context_line":"                        (gw_chassis and chassis_name not in gw_chassis)):"},{"line_number":443,"context_line":"                    chassis_list.remove((chassis_name, prio))"},{"line_number":444,"context_line":"            if len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS:"},{"line_number":445,"context_line":"                unhosted_gateways.append((lrp.name, chassis_list))"},{"line_number":446,"context_line":"        return unhosted_gateways"},{"line_number":447,"context_line":""},{"line_number":448,"context_line":"    def add_dhcp_options(self, subnet_id, port_id\u003dNone, may_exist\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_16fefb04","line":445,"in_reply_to":"3f79a3b5_672d43a7","updated":"2018-08-20 11:25:18.000000000","message":"We do not need to return in case somebody changed the MAX_GW_CHASSIS constant and decreased it.\n\nI mean , we have 3 cases :\n# The number of unhosted gateways \u003d MAX_GW_CHASSIS\nThat means we do not need to return it again, because it is already scheduled to the MAX number of chassis\n\n# The number of unhosted gateways \u003c MAX_GW_CHASSIS : \nHandled here\n\n# The number of unhosted gateways  \u003e MAX_GW_CHASSIS : \nVery likely impossible, unless someone actually modifies this constant and the restarts neutron. But if that happens, still the gateways have been hosted to max chassis, so no point of scheduling it again","commit_id":"ba8468c38a334e2a7a5da75f93f5c2473d1e3943"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"ed718787ae0b81eca94a9475ed03ce67bac3afc9","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        except idlutils.RowNotFound:"},{"line_number":423,"context_line":"            return []"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def get_unhosted_gateways(self, port_physnet_dict, chassis_physnets,"},{"line_number":426,"context_line":"                              gw_chassis):"},{"line_number":427,"context_line":"        unhosted_gateways \u003d []"},{"line_number":428,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_611bb6c9","line":425,"range":{"start_line":425,"start_character":8,"end_line":425,"end_character":29},"updated":"2018-09-03 09:03:10.000000000","message":"I\u0027m a bit confused about this. Before this patch, get_unhosted_gateways would go through every LRP and for each one, it\u0027ll go through the list of chassis that this port is scheduled on. If one of those is no longer valid, this LRP was considered as unhosted. (Side Note: There\u0027s a problem with this approach IIUC because if an LRP is not hosted by any chassis at all (is it possible?), it won\u0027t be returned by this method but this is different story).\n\nWith this patch, you\u0027re instead returning the tuple\n(port, list of valid chassis where this port is currently scheduled on) and this list has less elements than it actually has according to the DB (because some chassis no longer exists or is marked as invalid) -\u003e You\u0027re sort of handling the TODO in L435 so it may have implications as stated there.\n\nAm I right?","commit_id":"3422f0abef56a858baab3afcb1a0bdd41d265b86"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"ed718787ae0b81eca94a9475ed03ce67bac3afc9","unresolved":false,"context_lines":[{"line_number":423,"context_line":"            return []"},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"    def get_unhosted_gateways(self, port_physnet_dict, chassis_physnets,"},{"line_number":426,"context_line":"                              gw_chassis):"},{"line_number":427,"context_line":"        unhosted_gateways \u003d []"},{"line_number":428,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":429,"context_line":"        for lrp in self._tables[\u0027Logical_Router_Port\u0027].rows.values():"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_e17fc663","line":426,"updated":"2018-09-03 09:03:10.000000000","message":"Can you add a docstring/comment stating that you\u0027re returning a list of tuples in this method? :)","commit_id":"3422f0abef56a858baab3afcb1a0bdd41d265b86"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"533fa80a745467f4fbba461655e81384b03d8f97","unresolved":false,"context_lines":[{"line_number":409,"context_line":"                chassis.append((rc, 0))"},{"line_number":410,"context_line":"        return chassis"},{"line_number":411,"context_line":""},{"line_number":412,"context_line":"    def get_gateway_port_count_and_chassis_bindings(self):"},{"line_number":413,"context_line":"        lrp_ports \u003d []"},{"line_number":414,"context_line":"        for lrp in self._tables[\u0027Logical_Router_Port\u0027].rows.values():"},{"line_number":415,"context_line":"            lrp_ports.append(lrp.name)"},{"line_number":416,"context_line":"        return(lrp_ports, self.get_all_chassis_gateway_bindings())"},{"line_number":417,"context_line":""},{"line_number":418,"context_line":"    def get_all_chassis_gateway_bindings(self,"},{"line_number":419,"context_line":"                                         chassis_candidate_list\u003dNone):"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_9d32b0f1","line":416,"range":{"start_line":412,"start_character":1,"end_line":416,"end_character":66},"updated":"2019-04-30 11:31:18.000000000","message":"Leftover code, not used, removed in the next iteration","commit_id":"b688ba92df27176bea65fdc25c92cda1c823ddfd"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":818,"context_line":"                chassis \u003d port.chassis[0].name if port.chassis else None"},{"line_number":819,"context_line":"                return chassis, datapath"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"    def get_logical_port_master_chassis(self, name):"},{"line_number":822,"context_line":"        master \u003d None"},{"line_number":823,"context_line":"        # Ideally, chassisredirect port would be named cr-lrp-%s"},{"line_number":824,"context_line":"        # but the naming convention in the northbound db would be"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_0679f9fa","line":821,"range":{"start_line":821,"start_character":46,"end_line":821,"end_character":50},"updated":"2019-05-07 12:17:13.000000000","message":"nit: lrp_name","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":818,"context_line":"                chassis \u003d port.chassis[0].name if port.chassis else None"},{"line_number":819,"context_line":"                return chassis, datapath"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"    def get_logical_port_master_chassis(self, name):"},{"line_number":822,"context_line":"        master \u003d None"},{"line_number":823,"context_line":"        # Ideally, chassisredirect port would be named cr-lrp-%s"},{"line_number":824,"context_line":"        # but the naming convention in the northbound db would be"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_866c0937","line":821,"range":{"start_line":821,"start_character":8,"end_line":821,"end_character":39},"updated":"2019-05-07 12:17:13.000000000","message":"you\u0027re missing unittests for this method","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":818,"context_line":"                chassis \u003d port.chassis[0].name if port.chassis else None"},{"line_number":819,"context_line":"                return chassis, datapath"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"    def get_logical_port_master_chassis(self, name):"},{"line_number":822,"context_line":"        master \u003d None"},{"line_number":823,"context_line":"        # Ideally, chassisredirect port would be named cr-lrp-%s"},{"line_number":824,"context_line":"        # but the naming convention in the northbound db would be"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_51700ca6","line":821,"range":{"start_line":821,"start_character":46,"end_line":821,"end_character":50},"in_reply_to":"dfbec78f_0679f9fa","updated":"2019-05-07 14:07:28.000000000","message":"Done","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":818,"context_line":"                chassis \u003d port.chassis[0].name if port.chassis else None"},{"line_number":819,"context_line":"                return chassis, datapath"},{"line_number":820,"context_line":""},{"line_number":821,"context_line":"    def get_logical_port_master_chassis(self, name):"},{"line_number":822,"context_line":"        master \u003d None"},{"line_number":823,"context_line":"        # Ideally, chassisredirect port would be named cr-lrp-%s"},{"line_number":824,"context_line":"        # but the naming convention in the northbound db would be"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_b1794894","line":821,"range":{"start_line":821,"start_character":8,"end_line":821,"end_character":39},"in_reply_to":"dfbec78f_866c0937","updated":"2019-05-07 14:07:28.000000000","message":"Done","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        # but the naming convention in the northbound db would be"},{"line_number":825,"context_line":"        # lrp so append cr- before finding the name in the SBDB."},{"line_number":826,"context_line":"        port \u003d self.db_find_rows(\u0027Port_Binding\u0027, ("},{"line_number":827,"context_line":"            \u0027logical_port\u0027, \u0027\u003d\u0027, \u0027cr-\u0027 + name)).execute(check_error\u003dTrue)"},{"line_number":828,"context_line":"        if port and port[0].type \u003d\u003d \u0027chassisredirect\u0027:"},{"line_number":829,"context_line":"            # There is a rare scenario where the table isnt properly"},{"line_number":830,"context_line":"            # updated such that chassisredirect is set, chassis name isnt"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_86272913","line":827,"range":{"start_line":827,"start_character":33,"end_line":827,"end_character":45},"updated":"2019-05-07 12:17:13.000000000","message":"nit: \u0027cr-%s\u0027 % name","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":824,"context_line":"        # but the naming convention in the northbound db would be"},{"line_number":825,"context_line":"        # lrp so append cr- before finding the name in the SBDB."},{"line_number":826,"context_line":"        port \u003d self.db_find_rows(\u0027Port_Binding\u0027, ("},{"line_number":827,"context_line":"            \u0027logical_port\u0027, \u0027\u003d\u0027, \u0027cr-\u0027 + name)).execute(check_error\u003dTrue)"},{"line_number":828,"context_line":"        if port and port[0].type \u003d\u003d \u0027chassisredirect\u0027:"},{"line_number":829,"context_line":"            # There is a rare scenario where the table isnt properly"},{"line_number":830,"context_line":"            # updated such that chassisredirect is set, chassis name isnt"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_917684a4","line":827,"range":{"start_line":827,"start_character":33,"end_line":827,"end_character":45},"in_reply_to":"dfbec78f_86272913","updated":"2019-05-07 14:07:28.000000000","message":"Done","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":826,"context_line":"        port \u003d self.db_find_rows(\u0027Port_Binding\u0027, ("},{"line_number":827,"context_line":"            \u0027logical_port\u0027, \u0027\u003d\u0027, \u0027cr-\u0027 + name)).execute(check_error\u003dTrue)"},{"line_number":828,"context_line":"        if port and port[0].type \u003d\u003d \u0027chassisredirect\u0027:"},{"line_number":829,"context_line":"            # There is a rare scenario where the table isnt properly"},{"line_number":830,"context_line":"            # updated such that chassisredirect is set, chassis name isnt"},{"line_number":831,"context_line":"            master \u003d port[0].chassis[0].name if port[0].chassis else None"},{"line_number":832,"context_line":"        return master"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_e64aa57e","line":829,"range":{"start_line":829,"start_character":55,"end_line":829,"end_character":59},"updated":"2019-05-07 12:17:13.000000000","message":"nit: isn\u0027t","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":826,"context_line":"        port \u003d self.db_find_rows(\u0027Port_Binding\u0027, ("},{"line_number":827,"context_line":"            \u0027logical_port\u0027, \u0027\u003d\u0027, \u0027cr-\u0027 + name)).execute(check_error\u003dTrue)"},{"line_number":828,"context_line":"        if port and port[0].type \u003d\u003d \u0027chassisredirect\u0027:"},{"line_number":829,"context_line":"            # There is a rare scenario where the table isnt properly"},{"line_number":830,"context_line":"            # updated such that chassisredirect is set, chassis name isnt"},{"line_number":831,"context_line":"            master \u003d port[0].chassis[0].name if port[0].chassis else None"},{"line_number":832,"context_line":"        return master"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_f1458044","line":829,"range":{"start_line":829,"start_character":55,"end_line":829,"end_character":59},"in_reply_to":"dfbec78f_e64aa57e","updated":"2019-05-07 14:07:28.000000000","message":"Done","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":827,"context_line":"            \u0027logical_port\u0027, \u0027\u003d\u0027, \u0027cr-\u0027 + name)).execute(check_error\u003dTrue)"},{"line_number":828,"context_line":"        if port and port[0].type \u003d\u003d \u0027chassisredirect\u0027:"},{"line_number":829,"context_line":"            # There is a rare scenario where the table isnt properly"},{"line_number":830,"context_line":"            # updated such that chassisredirect is set, chassis name isnt"},{"line_number":831,"context_line":"            master \u003d port[0].chassis[0].name if port[0].chassis else None"},{"line_number":832,"context_line":"        return master"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_46593158","line":830,"range":{"start_line":830,"start_character":69,"end_line":830,"end_character":73},"updated":"2019-05-07 12:17:13.000000000","message":"ditto","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":827,"context_line":"            \u0027logical_port\u0027, \u0027\u003d\u0027, \u0027cr-\u0027 + name)).execute(check_error\u003dTrue)"},{"line_number":828,"context_line":"        if port and port[0].type \u003d\u003d \u0027chassisredirect\u0027:"},{"line_number":829,"context_line":"            # There is a rare scenario where the table isnt properly"},{"line_number":830,"context_line":"            # updated such that chassisredirect is set, chassis name isnt"},{"line_number":831,"context_line":"            master \u003d port[0].chassis[0].name if port[0].chassis else None"},{"line_number":832,"context_line":"        return master"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_d14abc53","line":830,"range":{"start_line":830,"start_character":69,"end_line":830,"end_character":73},"in_reply_to":"dfbec78f_46593158","updated":"2019-05-07 14:07:28.000000000","message":"Done","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":435,"context_line":"        except idlutils.RowNotFound:"},{"line_number":436,"context_line":"            return []"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_787b3b7a","line":438,"updated":"2019-05-14 16:23:24.000000000","message":"Can we have a docstring for this ? I\u0027m having a hard time trying to figure out what each parameter does and what type they have.\n\nFor example \"chassis_physnet\" is converted to list at L440 but it seems to be a dict because there\u0027s a get() at L444.","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":435,"context_line":"        except idlutils.RowNotFound:"},{"line_number":436,"context_line":"            return []"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_38c70399","line":438,"range":{"start_line":438,"start_character":8,"end_line":438,"end_character":27},"updated":"2019-05-14 16:23:24.000000000","message":"Maybe we should call it: \"is_gateway_chassis_invalid()\" since it returns a boolean.","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":435,"context_line":"        except idlutils.RowNotFound:"},{"line_number":436,"context_line":"            return []"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_012ac22a","line":438,"range":{"start_line":438,"start_character":8,"end_line":438,"end_character":27},"in_reply_to":"dfbec78f_38c70399","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":435,"context_line":"        except idlutils.RowNotFound:"},{"line_number":436,"context_line":"            return []"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_c1acaaee","line":438,"range":{"start_line":438,"start_character":8,"end_line":438,"end_character":27},"in_reply_to":"dfbec78f_38c70399","updated":"2019-05-15 03:09:38.000000000","message":"Umm, ok.I can do that","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":435,"context_line":"        except idlutils.RowNotFound:"},{"line_number":436,"context_line":"            return []"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_e1268e68","line":438,"in_reply_to":"dfbec78f_787b3b7a","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":435,"context_line":"        except idlutils.RowNotFound:"},{"line_number":436,"context_line":"            return []"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_a1b17649","line":438,"in_reply_to":"dfbec78f_787b3b7a","updated":"2019-05-15 03:09:38.000000000","message":"Sure,will add a docstring","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":436,"context_line":"            return []"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":442,"context_line":"                chassis_name not in valid_chassis_list or"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_1d29d199","line":439,"updated":"2019-05-14 16:23:24.000000000","message":"Public methods in this class should be part of the api [0] definition.\n\nNow, this doesn\u0027t seem to have anything to do with OVSDB and is used outside of the ovsdb namespace (networking_ovn/l3/l3_ovn_scheduler.py). I think it would be better to add it to a common/ module such as networking_ovn/common/utils.py. What do you think ?\n\n[0] https://github.com/openstack/networking-ovn/blob/master/networking_ovn/ovsdb/ovn_api.py#L351","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":436,"context_line":"            return []"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":442,"context_line":"                chassis_name not in valid_chassis_list or"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_41343a93","line":439,"in_reply_to":"dfbec78f_1d29d199","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":436,"context_line":"            return []"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":442,"context_line":"                chassis_name not in valid_chassis_list or"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_418afa69","line":439,"in_reply_to":"dfbec78f_1d29d199","updated":"2019-05-15 03:09:38.000000000","message":"Yes, sure. Since this doesnt use any specific commands for OVN and just verifies whatever is passed to it in the params","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":442,"context_line":"                chassis_name not in valid_chassis_list or"},{"line_number":443,"context_line":"                (physnet and"},{"line_number":444,"context_line":"                 physnet not in chassis_physnets.get(chassis_name)) or"},{"line_number":445,"context_line":"                (gw_chassis and chassis_name not in gw_chassis))"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    def get_unhosted_gateways(self, port_physnet_dict, chassis_physnets,"},{"line_number":448,"context_line":"                              gw_chassis):"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_982aaf29","line":445,"range":{"start_line":441,"start_character":15,"end_line":445,"end_character":64},"updated":"2019-05-14 16:23:24.000000000","message":"Suggestion: It\u0027s kinda hard to follow what\u0027s up here, it\u0027s a lot of OR\u0027s, AND\u0027s and NOT\u0027s nested. I think we could benefit from some clarity over cleverness by expanding this conditions, what do you think ?\n\n\nIt may be easier to read:\n\n  def is_gateway_chassis_invalid(...):\n  \"\"\"Blah blah blah \"\"\"\n    if not gw_chassis:\n        gw_chassis \u003d []\n\n    if chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS:\n        return True\n    elif chassis_name not in valid_chassis_list:\n        return True\n    elif physnet not in chassis_physnets.get(chassis_name)):\n        return True\n    elif chassis_name not in gw_chassis:\n        return True\n\n    return False","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":442,"context_line":"                chassis_name not in valid_chassis_list or"},{"line_number":443,"context_line":"                (physnet and"},{"line_number":444,"context_line":"                 physnet not in chassis_physnets.get(chassis_name)) or"},{"line_number":445,"context_line":"                (gw_chassis and chassis_name not in gw_chassis))"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    def get_unhosted_gateways(self, port_physnet_dict, chassis_physnets,"},{"line_number":448,"context_line":"                              gw_chassis):"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_a124165f","line":445,"range":{"start_line":441,"start_character":15,"end_line":445,"end_character":64},"in_reply_to":"dfbec78f_982aaf29","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":438,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis,"},{"line_number":439,"context_line":"                            physnet, chassis_physnets):"},{"line_number":440,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":441,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":442,"context_line":"                chassis_name not in valid_chassis_list or"},{"line_number":443,"context_line":"                (physnet and"},{"line_number":444,"context_line":"                 physnet not in chassis_physnets.get(chassis_name)) or"},{"line_number":445,"context_line":"                (gw_chassis and chassis_name not in gw_chassis))"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"    def get_unhosted_gateways(self, port_physnet_dict, chassis_physnets,"},{"line_number":448,"context_line":"                              gw_chassis):"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_c1958a88","line":445,"range":{"start_line":441,"start_character":15,"end_line":445,"end_character":64},"in_reply_to":"dfbec78f_982aaf29","updated":"2019-05-15 03:09:38.000000000","message":"Maybe I was working on it for sometime that I understood the logic. I can break it a bit","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":822,"context_line":"                chassis \u003d port.chassis[0].name if port.chassis else None"},{"line_number":823,"context_line":"                return chassis, datapath"},{"line_number":824,"context_line":""},{"line_number":825,"context_line":"    def get_logical_port_master_chassis(self, lrp_name):"},{"line_number":826,"context_line":"        master \u003d None"},{"line_number":827,"context_line":"        # Ideally, chassisredirect port would be named cr-lrp-%s"},{"line_number":828,"context_line":"        # but the naming convention in the northbound db would be"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_1899df77","line":825,"updated":"2019-05-14 16:23:24.000000000","message":"ditto: Public methods in this class should be part of the api [0] definition.\n\n[0] https://github.com/openstack/networking-ovn/blob/master/networking_ovn/ovsdb/ovn_api.py#L351","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":822,"context_line":"                chassis \u003d port.chassis[0].name if port.chassis else None"},{"line_number":823,"context_line":"                return chassis, datapath"},{"line_number":824,"context_line":""},{"line_number":825,"context_line":"    def get_logical_port_master_chassis(self, lrp_name):"},{"line_number":826,"context_line":"        master \u003d None"},{"line_number":827,"context_line":"        # Ideally, chassisredirect port would be named cr-lrp-%s"},{"line_number":828,"context_line":"        # but the naming convention in the northbound db would be"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_21eca628","line":825,"in_reply_to":"dfbec78f_1899df77","updated":"2019-05-15 03:09:38.000000000","message":"Will make it private, since it does use the db_find_rows, so cant move it to the constant module","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":822,"context_line":"                chassis \u003d port.chassis[0].name if port.chassis else None"},{"line_number":823,"context_line":"                return chassis, datapath"},{"line_number":824,"context_line":""},{"line_number":825,"context_line":"    def get_logical_port_master_chassis(self, lrp_name):"},{"line_number":826,"context_line":"        master \u003d None"},{"line_number":827,"context_line":"        # Ideally, chassisredirect port would be named cr-lrp-%s"},{"line_number":828,"context_line":"        # but the naming convention in the northbound db would be"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_01b882e2","line":825,"in_reply_to":"dfbec78f_21eca628","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":829,"context_line":"        # lrp so append cr- before finding the name in the SBDB."},{"line_number":830,"context_line":"        port \u003d self.db_find_rows(\u0027Port_Binding\u0027, ("},{"line_number":831,"context_line":"            \u0027logical_port\u0027, \u0027\u003d\u0027, \u0027cr-%s\u0027 % lrp_name)).execute(check_error\u003dTrue)"},{"line_number":832,"context_line":"        if port and port[0].type \u003d\u003d \u0027chassisredirect\u0027:"},{"line_number":833,"context_line":"            # There is a rare scenario where the table isn\u0027t properly"},{"line_number":834,"context_line":"            # updated such that chassisredirect is set, chassis name isn\u0027t"},{"line_number":835,"context_line":"            master \u003d port[0].chassis[0].name if port[0].chassis else None"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_d8958734","line":832,"range":{"start_line":832,"start_character":37,"end_line":832,"end_character":52},"updated":"2019-05-14 16:23:24.000000000","message":"nit: Could be a constant","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":829,"context_line":"        # lrp so append cr- before finding the name in the SBDB."},{"line_number":830,"context_line":"        port \u003d self.db_find_rows(\u0027Port_Binding\u0027, ("},{"line_number":831,"context_line":"            \u0027logical_port\u0027, \u0027\u003d\u0027, \u0027cr-%s\u0027 % lrp_name)).execute(check_error\u003dTrue)"},{"line_number":832,"context_line":"        if port and port[0].type \u003d\u003d \u0027chassisredirect\u0027:"},{"line_number":833,"context_line":"            # There is a rare scenario where the table isn\u0027t properly"},{"line_number":834,"context_line":"            # updated such that chassisredirect is set, chassis name isn\u0027t"},{"line_number":835,"context_line":"            master \u003d port[0].chassis[0].name if port[0].chassis else None"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_21a4a6b9","line":832,"range":{"start_line":832,"start_character":37,"end_line":832,"end_character":52},"in_reply_to":"dfbec78f_61905e96","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":829,"context_line":"        # lrp so append cr- before finding the name in the SBDB."},{"line_number":830,"context_line":"        port \u003d self.db_find_rows(\u0027Port_Binding\u0027, ("},{"line_number":831,"context_line":"            \u0027logical_port\u0027, \u0027\u003d\u0027, \u0027cr-%s\u0027 % lrp_name)).execute(check_error\u003dTrue)"},{"line_number":832,"context_line":"        if port and port[0].type \u003d\u003d \u0027chassisredirect\u0027:"},{"line_number":833,"context_line":"            # There is a rare scenario where the table isn\u0027t properly"},{"line_number":834,"context_line":"            # updated such that chassisredirect is set, chassis name isn\u0027t"},{"line_number":835,"context_line":"            master \u003d port[0].chassis[0].name if port[0].chassis else None"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_61905e96","line":832,"range":{"start_line":832,"start_character":37,"end_line":832,"end_character":52},"in_reply_to":"dfbec78f_d8958734","updated":"2019-05-15 03:09:38.000000000","message":"Yes, it can be","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"fb8a7ea7669517e7ddbd321ddb7fdce2c778c506","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_4a0c4fa4","line":451,"updated":"2019-05-15 09:13:18.000000000","message":"indentation","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e1c6d7276d95e93607631a058d15eea32eb5dbd3","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_753498de","line":451,"in_reply_to":"dfbec78f_4a0c4fa4","updated":"2019-05-15 09:26:43.000000000","message":"Not sure, but seemed ok to me.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"cae481ce8d5aab4f882c57f95857c8690fafea7f","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_755338e3","line":451,"in_reply_to":"dfbec78f_753498de","updated":"2019-05-15 09:36:26.000000000","message":"You can get inspired by the original code.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"a4681a943fb3498f60191aaa50388a6d380bd9b0","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_354f0094","line":451,"in_reply_to":"dfbec78f_755338e3","updated":"2019-05-15 10:10:36.000000000","message":"Done","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"10e7b53b81b77ffdad549cf1f288a5c6f7f088b7","unresolved":false,"context_lines":[{"line_number":447,"context_line":"                # TODO(azbiswas): Handle the case when a chassis is no"},{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if (utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":451,"context_line":"                    physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS)):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":"    def add_dhcp_options(self, subnet_id, port_id\u003dNone, may_exist\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_d6cd4a85","line":453,"range":{"start_line":450,"start_character":0,"end_line":453,"end_character":54},"updated":"2019-05-15 13:16:38.000000000","message":"indentation is wrong, should be:\n if utils.is_gateway_chassis_invalid(\n         chassis_name, gw_chassis, physnet, chassis_physnets) or (\n            len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS)):\n     unhosted_gateways.append(lrp.name)","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5c9d5ed5b39d7bbdd0b2fdb73a96041a440c34e6","unresolved":false,"context_lines":[{"line_number":447,"context_line":"                # TODO(azbiswas): Handle the case when a chassis is no"},{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if (utils.is_gateway_chassis_invalid(chassis_name, gw_chassis,"},{"line_number":451,"context_line":"                    physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS)):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"},{"line_number":455,"context_line":""},{"line_number":456,"context_line":"    def add_dhcp_options(self, subnet_id, port_id\u003dNone, may_exist\u003dTrue,"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_236fc1fc","line":453,"range":{"start_line":450,"start_character":0,"end_line":453,"end_character":54},"in_reply_to":"dfbec78f_d6cd4a85","updated":"2019-05-15 17:17:49.000000000","message":"Ok, done, but you had an extra at the end :P","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"9d46f3d77fca878daffb638fb2de81228b12a2e2","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_ab4a4e7d","line":451,"updated":"2019-05-20 13:11:06.000000000","message":"The indentation is still not correct. The idea is that when you\u0027re reading the code, it\u0027s clear on first sight what is part of the condition and what is in the if block.","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"3a8f60763175df0f90e1cbf7a7d217b892a9aef8","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_46326a12","line":451,"in_reply_to":"bfb3d3c7_ab4a4e7d","updated":"2019-05-23 03:13:03.000000000","message":"Done","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f370bce9a458470fa2bdb774d733c6555ae8bf12","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_ce2790b6","line":451,"in_reply_to":"bfb3d3c7_ab4a4e7d","updated":"2019-05-20 13:14:53.000000000","message":"Should I change it in this patch, or do this as a part of another one? Its a nit, I guess, but just want to confirm","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"51ebcd8453a6dba7283ad830782c3cd5a91b3b06","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_625d25e8","line":452,"range":{"start_line":451,"start_character":73,"end_line":452,"end_character":69},"updated":"2019-05-22 15:22:33.000000000","message":"You don\u0027t need to do this operation for every iteration since \"chassis_list\" is computed outside the for loop and it does not change, right ?\n\n chassis_list \u003d self._get_logical_router_port_gateway_chassis(lrp)\n max_gw_reached \u003d len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS\n for chassis_name, _ in chassis_list:\n    invalid \u003d utils.is_gateway_chassis_invalid(...)\n    if invalid or max_gw_reached:\n         unhosted_gateways.append(lrp.name)","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"3a8f60763175df0f90e1cbf7a7d217b892a9aef8","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_66352ef7","line":452,"range":{"start_line":451,"start_character":73,"end_line":452,"end_character":69},"in_reply_to":"bfb3d3c7_625d25e8","updated":"2019-05-23 03:13:03.000000000","message":"Done","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"c50488935fd6e72b802ddf96a1191c066523c272","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_41857459","line":452,"range":{"start_line":451,"start_character":73,"end_line":452,"end_character":69},"in_reply_to":"bfb3d3c7_625d25e8","updated":"2019-05-23 03:28:36.000000000","message":"I didnt change prio to _ because of pep8\u0027s F402 error","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"bcff8d6c3ec506ee0489c4e6d6b04684f1ae1626","unresolved":false,"context_lines":[{"line_number":448,"context_line":"                # longer valid. This may involve moving conntrack states,"},{"line_number":449,"context_line":"                # so it needs to discussed in the OVN community first."},{"line_number":450,"context_line":"                if utils.is_gateway_chassis_invalid("},{"line_number":451,"context_line":"                    chassis_name, gw_chassis, physnet, chassis_physnets) or ("},{"line_number":452,"context_line":"                        len(chassis_list) \u003c ovn_const.MAX_GW_CHASSIS):"},{"line_number":453,"context_line":"                    unhosted_gateways.append(lrp.name)"},{"line_number":454,"context_line":"        return unhosted_gateways"},{"line_number":455,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_5d17a252","line":452,"range":{"start_line":451,"start_character":73,"end_line":452,"end_character":69},"in_reply_to":"bfb3d3c7_625d25e8","updated":"2019-05-22 16:10:51.000000000","message":"let me see what can be done","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"98e0ea25c96f334d549863761eba169b9126bacd","unresolved":false,"context_lines":[{"line_number":813,"context_line":"                chassis \u003d port.chassis[0].name if port.chassis else None"},{"line_number":814,"context_line":"                return chassis, datapath"},{"line_number":815,"context_line":""},{"line_number":816,"context_line":"    def _get_logical_port_master_chassis(self, lrp_name):"},{"line_number":817,"context_line":"        master \u003d None"},{"line_number":818,"context_line":"        # Ideally, chassisredirect port would be named cr-lrp-%s"},{"line_number":819,"context_line":"        # but the naming convention in the northbound db would be"}],"source_content_type":"text/x-python","patch_set":37,"id":"9fb8cfa7_2f0da4a0","line":816,"updated":"2019-06-10 12:00:06.000000000","message":"After what Maciej saw on the other patch [1], it would be really good to cover this with functional test to get real interaction with ovsdb.\n\n[1] https://review.opendev.org/#/c/663046/3/networking_ovn/cmd/rebalance_gw_chassis.py@45","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"002bbc9df70b3cc94a39c8b1c74ca7304ca7ce4d","unresolved":false,"context_lines":[{"line_number":813,"context_line":"                chassis \u003d port.chassis[0].name if port.chassis else None"},{"line_number":814,"context_line":"                return chassis, datapath"},{"line_number":815,"context_line":""},{"line_number":816,"context_line":"    def _get_logical_port_master_chassis(self, lrp_name):"},{"line_number":817,"context_line":"        master \u003d None"},{"line_number":818,"context_line":"        # Ideally, chassisredirect port would be named cr-lrp-%s"},{"line_number":819,"context_line":"        # but the naming convention in the northbound db would be"}],"source_content_type":"text/x-python","patch_set":37,"id":"7faddb67_133ed38b","line":816,"in_reply_to":"9fb8cfa7_2f0da4a0","updated":"2019-07-12 12:05:34.000000000","message":"In my scenario I moved the scope to look for master chassis by checking NB Logical_Router_Port table, and based on gateway_chassis get the master.\n\nIt solved random failures described in related patchset.","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"9c42ae4df35257f5260e2ec2e4016f506242f06e","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            if rc:"},{"line_number":409,"context_line":"                chassis.append((rc, 0))"},{"line_number":410,"context_line":"        # make sure that chassis are sorted by priority"},{"line_number":411,"context_line":"        return sorted(chassis, reverse\u003dTrue, key\u003dlambda x: x[1])"},{"line_number":412,"context_line":""},{"line_number":413,"context_line":"    def get_all_chassis_gateway_bindings(self,"},{"line_number":414,"context_line":"                                         chassis_candidate_list\u003dNone):"}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_6743bdb0","line":411,"range":{"start_line":411,"start_character":8,"end_line":411,"end_character":64},"updated":"2019-07-12 15:43:50.000000000","message":"It is enought. We don\u0027t need _get_logical_port_master_chassis().","commit_id":"8d24650a09fe3fa547ebe8dd08b4f0e0422460a0"}],"networking_ovn/tests/functional/test_router.py":[{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def test_gateway_chassis_rebalance(self):"},{"line_number":327,"context_line":"        if not self._l3_ha_supported():"},{"line_number":328,"context_line":"            return"},{"line_number":329,"context_line":"        ovn_client \u003d self.l3_plugin._ovn_client"},{"line_number":330,"context_line":"        self.chassis4 \u003d self.add_fake_chassis("},{"line_number":331,"context_line":"            \u0027ovs-host4\u0027, physical_nets\u003d[\u0027physnet4\u0027], external_ids\u003d{"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_b8de930e","line":328,"range":{"start_line":328,"start_character":12,"end_line":328,"end_character":18},"updated":"2019-05-14 16:23:24.000000000","message":"self.skipTest(\u0027reason\u0027)","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def test_gateway_chassis_rebalance(self):"},{"line_number":327,"context_line":"        if not self._l3_ha_supported():"},{"line_number":328,"context_line":"            return"},{"line_number":329,"context_line":"        ovn_client \u003d self.l3_plugin._ovn_client"},{"line_number":330,"context_line":"        self.chassis4 \u003d self.add_fake_chassis("},{"line_number":331,"context_line":"            \u0027ovs-host4\u0027, physical_nets\u003d[\u0027physnet4\u0027], external_ids\u003d{"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_e1f1ae02","line":328,"range":{"start_line":328,"start_character":12,"end_line":328,"end_character":18},"in_reply_to":"dfbec78f_b8de930e","updated":"2019-05-15 03:09:38.000000000","message":"Ok","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":325,"context_line":""},{"line_number":326,"context_line":"    def test_gateway_chassis_rebalance(self):"},{"line_number":327,"context_line":"        if not self._l3_ha_supported():"},{"line_number":328,"context_line":"            return"},{"line_number":329,"context_line":"        ovn_client \u003d self.l3_plugin._ovn_client"},{"line_number":330,"context_line":"        self.chassis4 \u003d self.add_fake_chassis("},{"line_number":331,"context_line":"            \u0027ovs-host4\u0027, physical_nets\u003d[\u0027physnet4\u0027], external_ids\u003d{"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_8198f274","line":328,"range":{"start_line":328,"start_character":12,"end_line":328,"end_character":18},"in_reply_to":"dfbec78f_e1f1ae02","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        if not self._l3_ha_supported():"},{"line_number":328,"context_line":"            return"},{"line_number":329,"context_line":"        ovn_client \u003d self.l3_plugin._ovn_client"},{"line_number":330,"context_line":"        self.chassis4 \u003d self.add_fake_chassis("},{"line_number":331,"context_line":"            \u0027ovs-host4\u0027, physical_nets\u003d[\u0027physnet4\u0027], external_ids\u003d{"},{"line_number":332,"context_line":"                \u0027ovn-cms-options\u0027: \u0027enable-chassis-as-gw\u0027})"},{"line_number":333,"context_line":"        ovn_client._ovn_scheduler \u003d l3_sched.OVNGatewayLeastLoadedScheduler()"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_f8d72bed","line":330,"range":{"start_line":330,"start_character":13,"end_line":330,"end_character":21},"updated":"2019-05-14 16:23:24.000000000","message":"chassis3 ? The setUp method seems to be creating chassis1 and chassis2 only.\n\nAlso, since chassis4 (or chassis3) is only used in this test, we do not need to make it a class variable. We can drop the \"self.\"","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        if not self._l3_ha_supported():"},{"line_number":328,"context_line":"            return"},{"line_number":329,"context_line":"        ovn_client \u003d self.l3_plugin._ovn_client"},{"line_number":330,"context_line":"        self.chassis4 \u003d self.add_fake_chassis("},{"line_number":331,"context_line":"            \u0027ovs-host4\u0027, physical_nets\u003d[\u0027physnet4\u0027], external_ids\u003d{"},{"line_number":332,"context_line":"                \u0027ovn-cms-options\u0027: \u0027enable-chassis-as-gw\u0027})"},{"line_number":333,"context_line":"        ovn_client._ovn_scheduler \u003d l3_sched.OVNGatewayLeastLoadedScheduler()"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_4190ba4a","line":330,"range":{"start_line":330,"start_character":13,"end_line":330,"end_character":21},"in_reply_to":"dfbec78f_61e5be37","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":327,"context_line":"        if not self._l3_ha_supported():"},{"line_number":328,"context_line":"            return"},{"line_number":329,"context_line":"        ovn_client \u003d self.l3_plugin._ovn_client"},{"line_number":330,"context_line":"        self.chassis4 \u003d self.add_fake_chassis("},{"line_number":331,"context_line":"            \u0027ovs-host4\u0027, physical_nets\u003d[\u0027physnet4\u0027], external_ids\u003d{"},{"line_number":332,"context_line":"                \u0027ovn-cms-options\u0027: \u0027enable-chassis-as-gw\u0027})"},{"line_number":333,"context_line":"        ovn_client._ovn_scheduler \u003d l3_sched.OVNGatewayLeastLoadedScheduler()"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_61e5be37","line":330,"range":{"start_line":330,"start_character":13,"end_line":330,"end_character":21},"in_reply_to":"dfbec78f_f8d72bed","updated":"2019-05-15 03:09:38.000000000","message":"Yeah, but there is a chassis3 used in other tests, so I thought of chucking it and starting with chassis4. Sure, will drop the self from this and other chassis","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":361,"context_line":"        self.chassis5 \u003d self.add_fake_chassis("},{"line_number":362,"context_line":"            \u0027ovs-host5\u0027, physical_nets\u003d[\u0027physnet4\u0027], external_ids\u003d{"},{"line_number":363,"context_line":"                \u0027ovn-cms-options\u0027: \u0027enable-chassis-as-gw\u0027})"},{"line_number":364,"context_line":"        self.chassis6 \u003d self.add_fake_chassis("},{"line_number":365,"context_line":"            \u0027ovs-host6\u0027, physical_nets\u003d[\u0027physnet4\u0027])"},{"line_number":366,"context_line":"        self.l3_plugin.schedule_unhosted_gateways()"},{"line_number":367,"context_line":"        # Chassis4 should have all ports at Priority 2"},{"line_number":368,"context_line":"        self.assertEqual({2: 20}, _get_result_dict()[self.chassis4])"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_b89693ef","line":365,"range":{"start_line":364,"start_character":0,"end_line":365,"end_character":52},"updated":"2019-05-14 16:23:24.000000000","message":"chassis6 was added but there\u0027s no assertion around it. What is expected from chassis6 ? Should it have priority 3 ?","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b8f3080359af5b1ffa94e608427f2bac4240ecd9","unresolved":false,"context_lines":[{"line_number":361,"context_line":"        self.chassis5 \u003d self.add_fake_chassis("},{"line_number":362,"context_line":"            \u0027ovs-host5\u0027, physical_nets\u003d[\u0027physnet4\u0027], external_ids\u003d{"},{"line_number":363,"context_line":"                \u0027ovn-cms-options\u0027: \u0027enable-chassis-as-gw\u0027})"},{"line_number":364,"context_line":"        self.chassis6 \u003d self.add_fake_chassis("},{"line_number":365,"context_line":"            \u0027ovs-host6\u0027, physical_nets\u003d[\u0027physnet4\u0027])"},{"line_number":366,"context_line":"        self.l3_plugin.schedule_unhosted_gateways()"},{"line_number":367,"context_line":"        # Chassis4 should have all ports at Priority 2"},{"line_number":368,"context_line":"        self.assertEqual({2: 20}, _get_result_dict()[self.chassis4])"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_01864214","line":365,"range":{"start_line":364,"start_character":0,"end_line":365,"end_character":52},"in_reply_to":"dfbec78f_21d58644","updated":"2019-05-15 03:43:36.000000000","message":"Done","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":361,"context_line":"        self.chassis5 \u003d self.add_fake_chassis("},{"line_number":362,"context_line":"            \u0027ovs-host5\u0027, physical_nets\u003d[\u0027physnet4\u0027], external_ids\u003d{"},{"line_number":363,"context_line":"                \u0027ovn-cms-options\u0027: \u0027enable-chassis-as-gw\u0027})"},{"line_number":364,"context_line":"        self.chassis6 \u003d self.add_fake_chassis("},{"line_number":365,"context_line":"            \u0027ovs-host6\u0027, physical_nets\u003d[\u0027physnet4\u0027])"},{"line_number":366,"context_line":"        self.l3_plugin.schedule_unhosted_gateways()"},{"line_number":367,"context_line":"        # Chassis4 should have all ports at Priority 2"},{"line_number":368,"context_line":"        self.assertEqual({2: 20}, _get_result_dict()[self.chassis4])"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_21d58644","line":365,"range":{"start_line":364,"start_character":0,"end_line":365,"end_character":52},"in_reply_to":"dfbec78f_b89693ef","updated":"2019-05-15 03:09:38.000000000","message":"Nope, see the comments in Line#359 ( Maybe I can bring the comment down for more clarity). If there is no ovn-cms-option, then the node is to be added as a compute node, and it wont affect the prioritis, therefore Chassis4 would have Priority 2 and not 3. I can put this explanation here","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"80edc5b921448fb25a380f7057960f1bb916c28e","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        # used to schedule the router gateway ports therefore"},{"line_number":364,"context_line":"        # priority values wont be changed. Therefore chassis4 would"},{"line_number":365,"context_line":"        # still have priority 2"},{"line_number":366,"context_line":"        self.add_fake_chassis(\u0027ovs-host6\u0027, physical_nets\u003d[\u0027physnet4\u0027])"},{"line_number":367,"context_line":"        self.l3_plugin.schedule_unhosted_gateways()"},{"line_number":368,"context_line":"        # Chassis4 should have all ports at Priority 2"},{"line_number":369,"context_line":"        self.assertEqual({2: 20}, _get_result_dict()[chassis4])"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_a4d3c403","line":366,"range":{"start_line":366,"start_character":8,"end_line":366,"end_character":12},"updated":"2019-05-15 06:52:58.000000000","message":"Before this, shall we make sure that you have {1: 20} on ch4?\nLater when you add 5 and 6 maybe you can check that 5 is {1: 20} while 6 is empty?","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b9e7f3f6c4a60877bb8314e60c7ec99162c13433","unresolved":false,"context_lines":[{"line_number":363,"context_line":"        # used to schedule the router gateway ports therefore"},{"line_number":364,"context_line":"        # priority values wont be changed. Therefore chassis4 would"},{"line_number":365,"context_line":"        # still have priority 2"},{"line_number":366,"context_line":"        self.add_fake_chassis(\u0027ovs-host6\u0027, physical_nets\u003d[\u0027physnet4\u0027])"},{"line_number":367,"context_line":"        self.l3_plugin.schedule_unhosted_gateways()"},{"line_number":368,"context_line":"        # Chassis4 should have all ports at Priority 2"},{"line_number":369,"context_line":"        self.assertEqual({2: 20}, _get_result_dict()[chassis4])"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_cad83ff0","line":366,"range":{"start_line":366,"start_character":8,"end_line":366,"end_character":12},"in_reply_to":"dfbec78f_a4d3c403","updated":"2019-05-15 09:17:58.000000000","message":"Line#346 for {1:20} on CH4\nThere would be no entry for ch6, thats why priority will be only 1 and 2","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"51ebcd8453a6dba7283ad830782c3cd5a91b3b06","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        gw_info \u003d {\u0027network_id\u0027: ext1[\u0027network\u0027][\u0027id\u0027]}"},{"line_number":337,"context_line":"        # Create 20 routers with a gateway. Since we\u0027re using physnet4, the"},{"line_number":338,"context_line":"        # chassis candidates will be chassis4 initially."},{"line_number":339,"context_line":"        for i in range(0, 20):"},{"line_number":340,"context_line":"            router \u003d self._create_router(\u0027router%d\u0027 % i, gw_info\u003dgw_info)"},{"line_number":341,"context_line":"            gw_port_id \u003d router.get(\u0027gw_port_id\u0027)"},{"line_number":342,"context_line":"            logical_port \u003d \u0027cr-lrp-%s\u0027 % gw_port_id"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_42b6e1fc","line":339,"range":{"start_line":339,"start_character":17,"end_line":339,"end_character":29},"updated":"2019-05-22 15:22:33.000000000","message":"nit: range(20)","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"bcff8d6c3ec506ee0489c4e6d6b04684f1ae1626","unresolved":false,"context_lines":[{"line_number":336,"context_line":"        gw_info \u003d {\u0027network_id\u0027: ext1[\u0027network\u0027][\u0027id\u0027]}"},{"line_number":337,"context_line":"        # Create 20 routers with a gateway. Since we\u0027re using physnet4, the"},{"line_number":338,"context_line":"        # chassis candidates will be chassis4 initially."},{"line_number":339,"context_line":"        for i in range(0, 20):"},{"line_number":340,"context_line":"            router \u003d self._create_router(\u0027router%d\u0027 % i, gw_info\u003dgw_info)"},{"line_number":341,"context_line":"            gw_port_id \u003d router.get(\u0027gw_port_id\u0027)"},{"line_number":342,"context_line":"            logical_port \u003d \u0027cr-lrp-%s\u0027 % gw_port_id"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_3d466e7e","line":339,"range":{"start_line":339,"start_character":17,"end_line":339,"end_character":29},"in_reply_to":"bfb3d3c7_42b6e1fc","updated":"2019-05-22 16:10:51.000000000","message":"Done","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"9c42ae4df35257f5260e2ec2e4016f506242f06e","unresolved":false,"context_lines":[{"line_number":378,"context_line":"        # priority 1."},{"line_number":379,"context_line":"        self.assertEqual({1: 20}, _get_result_dict()[chassis5])"},{"line_number":380,"context_line":""},{"line_number":381,"context_line":"    def test_gateway_chassis_rebalance_max_chassis(self):"},{"line_number":382,"context_line":"        chassis_list \u003d []"},{"line_number":383,"context_line":"        # spawn 6 chassis and check if port has MAX_CHASSIS candidates."},{"line_number":384,"context_line":"        for i in range(0, ovn_const.MAX_GW_CHASSIS + 1):"}],"source_content_type":"text/x-python","patch_set":38,"id":"7faddb67_271b85d0","line":381,"range":{"start_line":381,"start_character":3,"end_line":381,"end_character":57},"updated":"2019-07-12 15:43:50.000000000","message":"Added this test. It was missing.","commit_id":"8d24650a09fe3fa547ebe8dd08b4f0e0422460a0"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"5cd7ac75180d9d05398630e3ba35d48c3120a73f","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        # Chassis4 should have all ports at Priority 2"},{"line_number":369,"context_line":"        self.l3_plugin.schedule_unhosted_gateways()"},{"line_number":370,"context_line":"        self.assertEqual({2: 20}, _get_result_dict()[chassis4])"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"        # delete chassis that hosts all the gateways"},{"line_number":373,"context_line":"        self.del_fake_chassis(chassis4)"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_d8b324e8","line":370,"updated":"2019-07-18 13:54:03.000000000","message":"nit: should we assert here that chassis5 have the ports with priority 1 (which is lower than chassis4 so they will be slaves right?)","commit_id":"22fdad781942673012e42191517c6a6047a12d74"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"c7252a071534161907591c3ac275fda9a77df7a6","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        # Chassis4 should have all ports at Priority 2"},{"line_number":369,"context_line":"        self.l3_plugin.schedule_unhosted_gateways()"},{"line_number":370,"context_line":"        self.assertEqual({2: 20}, _get_result_dict()[chassis4])"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"        # delete chassis that hosts all the gateways"},{"line_number":373,"context_line":"        self.del_fake_chassis(chassis4)"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_405dd2e7","line":370,"in_reply_to":"7faddb67_788b10c2","updated":"2019-07-22 09:17:22.000000000","message":"Done","commit_id":"22fdad781942673012e42191517c6a6047a12d74"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"2e6f715879546a276743b1663f568e4087ba98ca","unresolved":false,"context_lines":[{"line_number":367,"context_line":""},{"line_number":368,"context_line":"        # Chassis4 should have all ports at Priority 2"},{"line_number":369,"context_line":"        self.l3_plugin.schedule_unhosted_gateways()"},{"line_number":370,"context_line":"        self.assertEqual({2: 20}, _get_result_dict()[chassis4])"},{"line_number":371,"context_line":""},{"line_number":372,"context_line":"        # delete chassis that hosts all the gateways"},{"line_number":373,"context_line":"        self.del_fake_chassis(chassis4)"}],"source_content_type":"text/x-python","patch_set":39,"id":"7faddb67_788b10c2","line":370,"in_reply_to":"7faddb67_d8b324e8","updated":"2019-07-18 14:37:59.000000000","message":"I\u0027ll add this assert.","commit_id":"22fdad781942673012e42191517c6a6047a12d74"}],"networking_ovn/tests/unit/common/test_utils.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"10e7b53b81b77ffdad549cf1f288a5c6f7f088b7","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            resolver_file\u003dresolver_file_name)"},{"line_number":44,"context_line":"        self.assertEqual(expected_dns_resolvers, observed_dns_resolvers)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def test_is_gateway_chassis_invalid(self):"},{"line_number":47,"context_line":"        gw_chassis \u003d [\u0027host1\u0027, \u0027host2\u0027]"},{"line_number":48,"context_line":"        chassis_name \u003d gw_chassis[0]"},{"line_number":49,"context_line":"        physnet \u003d \u0027physical-nw-1\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_16ad229a","line":46,"range":{"start_line":46,"start_character":8,"end_line":46,"end_character":39},"updated":"2019-05-15 13:16:38.000000000","message":"I wrote you on IRC you should never use more than one assert in one method as a hint. This is exactly what I mean that you should *not* do. Split each scenario to a specific test method.\n\nGood rule of a thumb: Given that is_gateway_chassis_invalid is a standalone function, you can put it under single class. It makes it easier when you want to invoke tests for that particular standalone function by passing the path to the testing class only.","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f370bce9a458470fa2bdb774d733c6555ae8bf12","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            resolver_file\u003dresolver_file_name)"},{"line_number":44,"context_line":"        self.assertEqual(expected_dns_resolvers, observed_dns_resolvers)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def test_is_gateway_chassis_invalid(self):"},{"line_number":47,"context_line":"        gw_chassis \u003d [\u0027host1\u0027, \u0027host2\u0027]"},{"line_number":48,"context_line":"        chassis_name \u003d gw_chassis[0]"},{"line_number":49,"context_line":"        physnet \u003d \u0027physical-nw-1\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_2b2bbe94","line":46,"range":{"start_line":46,"start_character":8,"end_line":46,"end_character":39},"in_reply_to":"bfb3d3c7_4b5f1241","updated":"2019-05-20 13:14:53.000000000","message":"really????","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5c9d5ed5b39d7bbdd0b2fdb73a96041a440c34e6","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            resolver_file\u003dresolver_file_name)"},{"line_number":44,"context_line":"        self.assertEqual(expected_dns_resolvers, observed_dns_resolvers)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def test_is_gateway_chassis_invalid(self):"},{"line_number":47,"context_line":"        gw_chassis \u003d [\u0027host1\u0027, \u0027host2\u0027]"},{"line_number":48,"context_line":"        chassis_name \u003d gw_chassis[0]"},{"line_number":49,"context_line":"        physnet \u003d \u0027physical-nw-1\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_43caf51a","line":46,"range":{"start_line":46,"start_character":8,"end_line":46,"end_character":39},"in_reply_to":"dfbec78f_16ad229a","updated":"2019-05-15 17:17:49.000000000","message":"I may have missed that message on IRC since I dont have a bouncer\nBut I know that I can put it in a class, would be easier to handle the stuff :)\nAs always, thanks a lot for your help :)","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"9d46f3d77fca878daffb638fb2de81228b12a2e2","unresolved":false,"context_lines":[{"line_number":43,"context_line":"            resolver_file\u003dresolver_file_name)"},{"line_number":44,"context_line":"        self.assertEqual(expected_dns_resolvers, observed_dns_resolvers)"},{"line_number":45,"context_line":""},{"line_number":46,"context_line":"    def test_is_gateway_chassis_invalid(self):"},{"line_number":47,"context_line":"        gw_chassis \u003d [\u0027host1\u0027, \u0027host2\u0027]"},{"line_number":48,"context_line":"        chassis_name \u003d gw_chassis[0]"},{"line_number":49,"context_line":"        physnet \u003d \u0027physical-nw-1\u0027"}],"source_content_type":"text/x-python","patch_set":27,"id":"bfb3d3c7_4b5f1241","line":46,"range":{"start_line":46,"start_character":8,"end_line":46,"end_character":39},"in_reply_to":"dfbec78f_43caf51a","updated":"2019-05-20 13:11:06.000000000","message":"Man, you replied to my message that you will do it :D","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"10e7b53b81b77ffdad549cf1f288a5c6f7f088b7","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        # Return True since chassis_name not in gw_chassis"},{"line_number":83,"context_line":"        gw_chassis \u003d [\u0027host-2\u0027]"},{"line_number":84,"context_line":"        self.assertTrue(utils.is_gateway_chassis_invalid("},{"line_number":85,"context_line":"            chassis_name, gw_chassis, physnet, chassis_physnets))"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_f6b08edf","line":85,"updated":"2019-05-15 13:16:38.000000000","message":"Good scenarios :)","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"5c9d5ed5b39d7bbdd0b2fdb73a96041a440c34e6","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        # Return True since chassis_name not in gw_chassis"},{"line_number":83,"context_line":"        gw_chassis \u003d [\u0027host-2\u0027]"},{"line_number":84,"context_line":"        self.assertTrue(utils.is_gateway_chassis_invalid("},{"line_number":85,"context_line":"            chassis_name, gw_chassis, physnet, chassis_physnets))"}],"source_content_type":"text/x-python","patch_set":27,"id":"dfbec78f_9e904497","line":85,"in_reply_to":"dfbec78f_f6b08edf","updated":"2019-05-15 17:17:49.000000000","message":"Thank you:D","commit_id":"1f2e5523ff8def36ceb1a3a5c215948cc40e31d4"}],"networking_ovn/tests/unit/l3/test_l3_ovn_scheduler.py":[{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"908813bba3555cfe35ba167a299a4025207dc28e","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        chassis \u003d self.select(mapping, gateway_name)"},{"line_number":107,"context_line":"        self.assertItemsEqual(chassis, mapping.get(\u0027Chassis\u0027))"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def test_existing_chassis_available_for_existing_gateway(self):"},{"line_number":110,"context_line":"        mapping \u003d self.fake_chassis_gateway_mappings[\u0027Multiple1\u0027]"},{"line_number":111,"context_line":"        gateway_name \u003d random.choice(list(mapping[\u0027Gateways\u0027].keys()))"},{"line_number":112,"context_line":"        chassis \u003d self.select(mapping, gateway_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_033b06c8","side":"PARENT","line":109,"updated":"2018-08-21 08:15:37.000000000","message":"I have removed this test, because:\n- GatewayChanceScheduler works on randomizing the chassis.\nThere is NO WAY I can predict it, unless I actually hack the randamization. So I have removed it from the test. If you disagree, please let me know","commit_id":"e63f55a308e2cec22bdc56601e89ae5181786a2a"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"ed718787ae0b81eca94a9475ed03ce67bac3afc9","unresolved":false,"context_lines":[{"line_number":106,"context_line":"        chassis \u003d self.select(mapping, gateway_name)"},{"line_number":107,"context_line":"        self.assertItemsEqual(chassis, mapping.get(\u0027Chassis\u0027))"},{"line_number":108,"context_line":""},{"line_number":109,"context_line":"    def test_existing_chassis_available_for_existing_gateway(self):"},{"line_number":110,"context_line":"        mapping \u003d self.fake_chassis_gateway_mappings[\u0027Multiple1\u0027]"},{"line_number":111,"context_line":"        gateway_name \u003d random.choice(list(mapping[\u0027Gateways\u0027].keys()))"},{"line_number":112,"context_line":"        chassis \u003d self.select(mapping, gateway_name)"}],"source_content_type":"text/x-python","patch_set":6,"id":"3f79a3b5_411b1a72","side":"PARENT","line":109,"in_reply_to":"3f79a3b5_033b06c8","updated":"2018-09-03 09:03:10.000000000","message":"How was it working before?","commit_id":"e63f55a308e2cec22bdc56601e89ae5181786a2a"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"533fa80a745467f4fbba461655e81384b03d8f97","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        chassis \u003d self.select(mapping, gateway_name)"},{"line_number":163,"context_line":"        # least loaded chassis will be in the front of the list"},{"line_number":164,"context_line":"        self.assertEqual([\u0027hv2\u0027, \u0027hv1\u0027], chassis)"},{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    def test_existing_chassis_available_for_existing_gateway(self):"},{"line_number":167,"context_line":"        mapping \u003d self.fake_chassis_gateway_mappings[\u0027Multiple1\u0027]"},{"line_number":168,"context_line":"        gateway_name \u003d \u0027g1\u0027"}],"source_content_type":"text/x-python","patch_set":18,"id":"ffb9cba7_7d8a5c6a","line":165,"updated":"2019-04-30 11:31:18.000000000","message":"Needed: A few more test cases which test out the rebalance function.","commit_id":"b688ba92df27176bea65fdc25c92cda1c823ddfd"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        mapping \u003d self.fake_chassis_gateway_mappings[\u0027Multiple1\u0027]"},{"line_number":168,"context_line":"        gateway_name \u003d \u0027g1\u0027"},{"line_number":169,"context_line":"        chassis \u003d self.select(mapping, gateway_name)"},{"line_number":170,"context_line":"        self.assertEqual(5, len(chassis))"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def test__get_chassis_load_by_prios_several_ports(self):"},{"line_number":173,"context_line":"        # Adding 5 ports of prio 1 and 5 ports of prio 2"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_e1e12f00","line":170,"range":{"start_line":170,"start_character":25,"end_line":170,"end_character":26},"updated":"2019-05-07 12:17:13.000000000","message":"MAX_GW_CHASSIS","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":167,"context_line":"        mapping \u003d self.fake_chassis_gateway_mappings[\u0027Multiple1\u0027]"},{"line_number":168,"context_line":"        gateway_name \u003d \u0027g1\u0027"},{"line_number":169,"context_line":"        chassis \u003d self.select(mapping, gateway_name)"},{"line_number":170,"context_line":"        self.assertEqual(5, len(chassis))"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"    def test__get_chassis_load_by_prios_several_ports(self):"},{"line_number":173,"context_line":"        # Adding 5 ports of prio 1 and 5 ports of prio 2"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_119854be","line":170,"range":{"start_line":170,"start_character":25,"end_line":170,"end_character":26},"in_reply_to":"dfbec78f_e1e12f00","updated":"2019-05-07 14:07:28.000000000","message":"Yeah","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"a8ef4e44c90b60658af4c0efba343c24a64ef209","unresolved":false,"context_lines":[{"line_number":29,"context_line":"            return_value\u003dchassis_gateway_mapping[\u0027Gateways\u0027].get(gateway,"},{"line_number":30,"context_line":"                                                                 None))"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis, physnet,"},{"line_number":33,"context_line":"                            chassis_physnets):"},{"line_number":34,"context_line":"        # Copy of the implementation of check_valid_chassis in"},{"line_number":35,"context_line":"        # impl_ovn_idl.py"},{"line_number":36,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":37,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":38,"context_line":"                chassis_name not in valid_chassis_list or"},{"line_number":39,"context_line":"                (physnet and"},{"line_number":40,"context_line":"                 physnet not in chassis_physnets.get(chassis_name)) or"},{"line_number":41,"context_line":"                (gw_chassis and chassis_name not in gw_chassis))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class FakeOVNGatewaySchedulerSbOvnIdl(object):"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_38b3839a","line":41,"range":{"start_line":32,"start_character":0,"end_line":41,"end_character":64},"updated":"2019-05-14 16:23:24.000000000","message":"Oh noes!\n\nLet\u0027s add that method to a common module as suggested in a previous comment. That way we can reuse it here too.","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"b0f67fa0e942cae0409ad58339872f31d0be640d","unresolved":false,"context_lines":[{"line_number":29,"context_line":"            return_value\u003dchassis_gateway_mapping[\u0027Gateways\u0027].get(gateway,"},{"line_number":30,"context_line":"                                                                 None))"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"    def check_valid_chassis(self, chassis_name, gw_chassis, physnet,"},{"line_number":33,"context_line":"                            chassis_physnets):"},{"line_number":34,"context_line":"        # Copy of the implementation of check_valid_chassis in"},{"line_number":35,"context_line":"        # impl_ovn_idl.py"},{"line_number":36,"context_line":"        valid_chassis_list \u003d list(chassis_physnets)"},{"line_number":37,"context_line":"        return (chassis_name \u003d\u003d ovn_const.OVN_GATEWAY_INVALID_CHASSIS or"},{"line_number":38,"context_line":"                chassis_name not in valid_chassis_list or"},{"line_number":39,"context_line":"                (physnet and"},{"line_number":40,"context_line":"                 physnet not in chassis_physnets.get(chassis_name)) or"},{"line_number":41,"context_line":"                (gw_chassis and chassis_name not in gw_chassis))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class FakeOVNGatewaySchedulerSbOvnIdl(object):"}],"source_content_type":"text/x-python","patch_set":25,"id":"dfbec78f_01ce42b3","line":41,"range":{"start_line":32,"start_character":0,"end_line":41,"end_character":64},"in_reply_to":"dfbec78f_38b3839a","updated":"2019-05-15 03:09:38.000000000","message":"Yes, agreed!","commit_id":"4a54a5cb2e2879ef2e12d08560c33fbd7f7178d5"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"8881b509620b972dec405e5d8cb95b4d9f89fef5","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                                  ovn_const.OVN_GATEWAY_INVALID_CHASSIS]))"},{"line_number":140,"context_line":"        # Check if invalid is removed -II"},{"line_number":141,"context_line":"        self.assertEqual("},{"line_number":142,"context_line":"            [], self.filter_existing_chassis("},{"line_number":143,"context_line":"                nb_idl\u003dnb_idl, gw_chassis\u003d[\"temp\"],"},{"line_number":144,"context_line":"                physnet\u003d\u0027phys-network-1\u0027,"},{"line_number":145,"context_line":"                chassis_physnets\u003dchassis_physnets,"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_9140c537","line":142,"range":{"start_line":142,"start_character":12,"end_line":142,"end_character":15},"updated":"2019-05-21 09:59:14.000000000","message":"assertTrue can be used , but it spoils clarity, thats why didnt use it here","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"51ebcd8453a6dba7283ad830782c3cd5a91b3b06","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                                  ovn_const.OVN_GATEWAY_INVALID_CHASSIS]))"},{"line_number":140,"context_line":"        # Check if invalid is removed -II"},{"line_number":141,"context_line":"        self.assertEqual("},{"line_number":142,"context_line":"            [], self.filter_existing_chassis("},{"line_number":143,"context_line":"                nb_idl\u003dnb_idl, gw_chassis\u003d[\"temp\"],"},{"line_number":144,"context_line":"                physnet\u003d\u0027phys-network-1\u0027,"},{"line_number":145,"context_line":"                chassis_physnets\u003dchassis_physnets,"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_e2a7d5a6","line":142,"range":{"start_line":142,"start_character":12,"end_line":142,"end_character":15},"in_reply_to":"bfb3d3c7_9140c537","updated":"2019-05-22 15:22:33.000000000","message":"++","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":23858,"name":"reedip","username":"reedip","inactive":true},"change_message_id":"bcff8d6c3ec506ee0489c4e6d6b04684f1ae1626","unresolved":false,"context_lines":[{"line_number":139,"context_line":"                                  ovn_const.OVN_GATEWAY_INVALID_CHASSIS]))"},{"line_number":140,"context_line":"        # Check if invalid is removed -II"},{"line_number":141,"context_line":"        self.assertEqual("},{"line_number":142,"context_line":"            [], self.filter_existing_chassis("},{"line_number":143,"context_line":"                nb_idl\u003dnb_idl, gw_chassis\u003d[\"temp\"],"},{"line_number":144,"context_line":"                physnet\u003d\u0027phys-network-1\u0027,"},{"line_number":145,"context_line":"                chassis_physnets\u003dchassis_physnets,"}],"source_content_type":"text/x-python","patch_set":29,"id":"bfb3d3c7_fd0d363e","line":142,"range":{"start_line":142,"start_character":12,"end_line":142,"end_character":15},"in_reply_to":"bfb3d3c7_e2a7d5a6","updated":"2019-05-22 16:10:51.000000000","message":"Done","commit_id":"0ef59db35a273a0fbb7cdfd235fea10946dcc42e"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"002bbc9df70b3cc94a39c8b1c74ca7304ca7ce4d","unresolved":false,"context_lines":[{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def test_existing_chassis_available_for_existing_gateway(self):"},{"line_number":213,"context_line":"        mapping \u003d self.fake_chassis_gateway_mappings[\u0027Multiple1\u0027]"},{"line_number":214,"context_line":"        gateway_name \u003d \u0027g1\u0027"},{"line_number":215,"context_line":"        chassis \u003d self.select(mapping, gateway_name)"},{"line_number":216,"context_line":"        self.assertEqual(ovn_const.MAX_GW_CHASSIS, len(chassis))"},{"line_number":217,"context_line":""}],"source_content_type":"text/x-python","patch_set":37,"id":"7faddb67_4090efed","line":214,"range":{"start_line":214,"start_character":8,"end_line":214,"end_character":27},"updated":"2019-07-12 12:05:34.000000000","message":"Not related?","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"}],"networking_ovn/tests/unit/ovsdb/test_impl_idl_ovn.py":[{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":583,"context_line":"        unhosted_gateways \u003d self.nb_ovn_idl.get_unhosted_gateways("},{"line_number":584,"context_line":"            {}, {\u0027host-1\u0027: \u0027physnet1\u0027}, [])"},{"line_number":585,"context_line":"        expected \u003d {"},{"line_number":586,"context_line":"            utils.ovn_lrouter_port_name(\u0027orp-id-b2\u0027): {"},{"line_number":587,"context_line":"                ovn_const.OVN_GATEWAY_CHASSIS_KEY: \u0027host-2\u0027},"},{"line_number":588,"context_line":"            utils.ovn_lrouter_port_name(\u0027orp-id-a3\u0027): {"},{"line_number":589,"context_line":"                ovn_const.OVN_GATEWAY_CHASSIS_KEY:"},{"line_number":590,"context_line":"                    ovn_const.OVN_GATEWAY_INVALID_CHASSIS}}"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_86d089f9","side":"PARENT","line":587,"range":{"start_line":586,"start_character":52,"end_line":587,"end_character":61},"updated":"2019-05-07 12:17:13.000000000","message":"I find it interesting how wrong this was :)","commit_id":"b04a2341126becbd7b449be6950cfaae4b01a2e5"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":578,"context_line":"        self.assertEqual(chassis, [])"},{"line_number":579,"context_line":""},{"line_number":580,"context_line":"    def test_get_unhosted_gateways(self):"},{"line_number":581,"context_line":"        self._load_nb_db()"},{"line_number":582,"context_line":"        # Test only host-1 in the valid list"},{"line_number":583,"context_line":"        unhosted_gateways \u003d self.nb_ovn_idl.get_unhosted_gateways("},{"line_number":584,"context_line":"            {}, {\u0027host-1\u0027: \u0027physnet1\u0027}, [])"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_86f96981","line":581,"range":{"start_line":581,"start_character":8,"end_line":581,"end_character":24},"updated":"2019-05-07 12:17:13.000000000","message":"Would be good to put more unhosted gateways for given logical router port to the db because you know return list from get_unhosted_gateways()","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":578,"context_line":"        self.assertEqual(chassis, [])"},{"line_number":579,"context_line":""},{"line_number":580,"context_line":"    def test_get_unhosted_gateways(self):"},{"line_number":581,"context_line":"        self._load_nb_db()"},{"line_number":582,"context_line":"        # Test only host-1 in the valid list"},{"line_number":583,"context_line":"        unhosted_gateways \u003d self.nb_ovn_idl.get_unhosted_gateways("},{"line_number":584,"context_line":"            {}, {\u0027host-1\u0027: \u0027physnet1\u0027}, [])"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_319318a6","line":581,"range":{"start_line":581,"start_character":8,"end_line":581,"end_character":24},"in_reply_to":"dfbec78f_86f96981","updated":"2019-05-07 14:07:28.000000000","message":"Okay, will extend the scenario","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"bc4b2a1f86aa8308fc231ffca6ebe8183248a923","unresolved":false,"context_lines":[{"line_number":614,"context_line":"                    (\u0027lrp-orp-id-a3\u0027, [(\u0027host-2\u0027, 0)]),"},{"line_number":615,"context_line":"                    (\u0027lrp-orp-id-b2\u0027, [(\u0027host-2\u0027, 0)]),"},{"line_number":616,"context_line":"                    (\u0027lrp-orp-id-b3\u0027, [(\u0027host-2\u0027, 0)])]"},{"line_number":617,"context_line":"        self.assertItemsEqual(unhosted_gateways, expected)"},{"line_number":618,"context_line":""},{"line_number":619,"context_line":"    def test_get_subnet_dhcp_options(self):"},{"line_number":620,"context_line":"        self._load_nb_db()"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_c634414d","line":617,"updated":"2019-05-07 12:17:13.000000000","message":"You miss a scenario where lrp is hosted on 5 gateways and get_unhosted_gateways return nothing.","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"37691dd24f1b2f6be5847f525192f9c9e740f86f","unresolved":false,"context_lines":[{"line_number":614,"context_line":"                    (\u0027lrp-orp-id-a3\u0027, [(\u0027host-2\u0027, 0)]),"},{"line_number":615,"context_line":"                    (\u0027lrp-orp-id-b2\u0027, [(\u0027host-2\u0027, 0)]),"},{"line_number":616,"context_line":"                    (\u0027lrp-orp-id-b3\u0027, [(\u0027host-2\u0027, 0)])]"},{"line_number":617,"context_line":"        self.assertItemsEqual(unhosted_gateways, expected)"},{"line_number":618,"context_line":""},{"line_number":619,"context_line":"    def test_get_subnet_dhcp_options(self):"},{"line_number":620,"context_line":"        self._load_nb_db()"}],"source_content_type":"text/x-python","patch_set":22,"id":"dfbec78f_6173ff16","line":617,"in_reply_to":"dfbec78f_c634414d","updated":"2019-05-07 14:07:28.000000000","message":"Yeah, thanks. I missed that","commit_id":"786958d8243d909b00b9565c116f3a1610bc65c3"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"3332b42f24372c558facf7553143328a13d9df07","unresolved":false,"context_lines":[{"line_number":762,"context_line":"        port \u003d collections.namedtuple(\u0027port_binding\u0027, \u0027chassis type\u0027)"},{"line_number":763,"context_line":"        chassis \u003d collections.namedtuple(\u0027chassis\u0027, \u0027name\u0027)"},{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"},{"line_number":765,"context_line":"                          type\u003d\u0027chassisredirect\u0027)]"},{"line_number":766,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":767,"context_line":"        inst.db_find_rows \u003d mock.Mock()"},{"line_number":768,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"}],"source_content_type":"text/x-python","patch_set":26,"id":"dfbec78f_84c32057","line":765,"range":{"start_line":765,"start_character":32,"end_line":765,"end_character":47},"updated":"2019-05-15 06:26:35.000000000","message":"This could have been fixed. I can fix it in the next P.S. if there is another cycle required.","commit_id":"00bf3047f1fe5db1c936c4363af3677103e39d68"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f55bafaef38bb83e8478ea1b0b1f511bd133b922","unresolved":false,"context_lines":[{"line_number":724,"context_line":"                               return_value\u003dmock.Mock()):"},{"line_number":725,"context_line":"            impl_idl_ovn.OvsdbSbOvnIdl.ovsdb_connection \u003d None"},{"line_number":726,"context_line":"            self.sb_ovn_idl \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":727,"context_line":""},{"line_number":728,"context_line":"        self.sb_ovn_idl.idl.tables \u003d self._tables"},{"line_number":729,"context_line":""},{"line_number":730,"context_line":"    def _load_sb_db(self):"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_3de17cd1","side":"PARENT","line":727,"updated":"2019-05-23 10:52:47.000000000","message":"Unrelated change","commit_id":"25de3d7183420ecd8af8e4d3f73b3f82c2502a3c"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"1ea8b35d00ff73f6857d2b01ebb8369b73c3f649","unresolved":false,"context_lines":[{"line_number":724,"context_line":"                               return_value\u003dmock.Mock()):"},{"line_number":725,"context_line":"            impl_idl_ovn.OvsdbSbOvnIdl.ovsdb_connection \u003d None"},{"line_number":726,"context_line":"            self.sb_ovn_idl \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":727,"context_line":""},{"line_number":728,"context_line":"        self.sb_ovn_idl.idl.tables \u003d self._tables"},{"line_number":729,"context_line":""},{"line_number":730,"context_line":"    def _load_sb_db(self):"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_9d56685c","side":"PARENT","line":727,"in_reply_to":"bfb3d3c7_3de17cd1","updated":"2019-05-23 11:00:02.000000000","message":"Done","commit_id":"25de3d7183420ecd8af8e4d3f73b3f82c2502a3c"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f55bafaef38bb83e8478ea1b0b1f511bd133b922","unresolved":false,"context_lines":[{"line_number":600,"context_line":"        self.assertItemsEqual(unhosted_gateways, expected)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"    def test_unhosted_gateway_max_chassis(self):"},{"line_number":603,"context_line":"        self.gw_chassis_table \u003d fakes.FakeOvsdbTable.create_one_ovsdb_table()"},{"line_number":604,"context_line":"        self._tables[\u0027Gateway_Chassis\u0027] \u003d self.gw_chassis_table"},{"line_number":605,"context_line":"        gw_chassis \u003d collections.namedtuple(\u0027gw_chassis\u0027,"},{"line_number":606,"context_line":"                                            \u0027chassis_name priority\u0027)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_5dc0f07b","line":603,"range":{"start_line":603,"start_character":8,"end_line":603,"end_character":13},"updated":"2019-05-23 10:52:47.000000000","message":"does it need to be an instance attribute?","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"1ea8b35d00ff73f6857d2b01ebb8369b73c3f649","unresolved":false,"context_lines":[{"line_number":600,"context_line":"        self.assertItemsEqual(unhosted_gateways, expected)"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"    def test_unhosted_gateway_max_chassis(self):"},{"line_number":603,"context_line":"        self.gw_chassis_table \u003d fakes.FakeOvsdbTable.create_one_ovsdb_table()"},{"line_number":604,"context_line":"        self._tables[\u0027Gateway_Chassis\u0027] \u003d self.gw_chassis_table"},{"line_number":605,"context_line":"        gw_chassis \u003d collections.namedtuple(\u0027gw_chassis\u0027,"},{"line_number":606,"context_line":"                                            \u0027chassis_name priority\u0027)"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_9d28a8e2","line":603,"range":{"start_line":603,"start_character":8,"end_line":603,"end_character":13},"in_reply_to":"bfb3d3c7_5dc0f07b","updated":"2019-05-23 11:00:02.000000000","message":"No","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f55bafaef38bb83e8478ea1b0b1f511bd133b922","unresolved":false,"context_lines":[{"line_number":606,"context_line":"                                            \u0027chassis_name priority\u0027)"},{"line_number":607,"context_line":"        TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027][0][\u0027gateway_chassis\u0027] \u003d ["},{"line_number":608,"context_line":"            gw_chassis(chassis_name\u003d\u0027host-%s\u0027 % _,"},{"line_number":609,"context_line":"                       priority\u003d_) for _ in range(1, 6)]"},{"line_number":610,"context_line":"        for i in range(1, len(TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027])):"},{"line_number":611,"context_line":"            TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027][i]["},{"line_number":612,"context_line":"                \u0027gateway_chassis\u0027] \u003d []"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_7d5054d5","line":609,"range":{"start_line":609,"start_character":39,"end_line":609,"end_character":40},"updated":"2019-05-23 10:52:47.000000000","message":"i, _ is a function used for i18n, that\u0027s imported implicitly and you\u0027re shadowing it","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"1ea8b35d00ff73f6857d2b01ebb8369b73c3f649","unresolved":false,"context_lines":[{"line_number":606,"context_line":"                                            \u0027chassis_name priority\u0027)"},{"line_number":607,"context_line":"        TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027][0][\u0027gateway_chassis\u0027] \u003d ["},{"line_number":608,"context_line":"            gw_chassis(chassis_name\u003d\u0027host-%s\u0027 % _,"},{"line_number":609,"context_line":"                       priority\u003d_) for _ in range(1, 6)]"},{"line_number":610,"context_line":"        for i in range(1, len(TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027])):"},{"line_number":611,"context_line":"            TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027][i]["},{"line_number":612,"context_line":"                \u0027gateway_chassis\u0027] \u003d []"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_dd0e208c","line":609,"range":{"start_line":609,"start_character":39,"end_line":609,"end_character":40},"in_reply_to":"bfb3d3c7_7d5054d5","updated":"2019-05-23 11:00:02.000000000","message":"Thats true for production code, pep8 doesnt complain for tests :)","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f55bafaef38bb83e8478ea1b0b1f511bd133b922","unresolved":false,"context_lines":[{"line_number":607,"context_line":"        TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027][0][\u0027gateway_chassis\u0027] \u003d ["},{"line_number":608,"context_line":"            gw_chassis(chassis_name\u003d\u0027host-%s\u0027 % _,"},{"line_number":609,"context_line":"                       priority\u003d_) for _ in range(1, 6)]"},{"line_number":610,"context_line":"        for i in range(1, len(TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027])):"},{"line_number":611,"context_line":"            TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027][i]["},{"line_number":612,"context_line":"                \u0027gateway_chassis\u0027] \u003d []"},{"line_number":613,"context_line":"        self._load_nb_db()"},{"line_number":614,"context_line":"        unhosted_gateways \u003d self.nb_ovn_idl.get_unhosted_gateways("},{"line_number":615,"context_line":"            {}, {\u0027host-1\u0027: \u0027physnet1\u0027, \u0027host-2\u0027: \u0027physnet2\u0027,"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_fdcf64ad","line":612,"range":{"start_line":610,"start_character":0,"end_line":612,"end_character":39},"updated":"2019-05-23 10:52:47.000000000","message":"for port in TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027][1:]:\n     port[\u0027gateway_chassis\u0027] \u003d []","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"1ea8b35d00ff73f6857d2b01ebb8369b73c3f649","unresolved":false,"context_lines":[{"line_number":607,"context_line":"        TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027][0][\u0027gateway_chassis\u0027] \u003d ["},{"line_number":608,"context_line":"            gw_chassis(chassis_name\u003d\u0027host-%s\u0027 % _,"},{"line_number":609,"context_line":"                       priority\u003d_) for _ in range(1, 6)]"},{"line_number":610,"context_line":"        for i in range(1, len(TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027])):"},{"line_number":611,"context_line":"            TestNBImplIdlOvn.fake_set[\u0027lrouter_ports\u0027][i]["},{"line_number":612,"context_line":"                \u0027gateway_chassis\u0027] \u003d []"},{"line_number":613,"context_line":"        self._load_nb_db()"},{"line_number":614,"context_line":"        unhosted_gateways \u003d self.nb_ovn_idl.get_unhosted_gateways("},{"line_number":615,"context_line":"            {}, {\u0027host-1\u0027: \u0027physnet1\u0027, \u0027host-2\u0027: \u0027physnet2\u0027,"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_3d7dfce6","line":612,"range":{"start_line":610,"start_character":0,"end_line":612,"end_character":39},"in_reply_to":"bfb3d3c7_fdcf64ad","updated":"2019-05-23 11:00:02.000000000","message":"Done","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f55bafaef38bb83e8478ea1b0b1f511bd133b922","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":759,"context_line":"        inst.idl._session.reconnect.set_probe_interval.assert_called_with(5000)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def test_get_logical_port_master_chassis(self):"},{"line_number":762,"context_line":"        port \u003d collections.namedtuple(\u0027port_binding\u0027, \u0027chassis type\u0027)"},{"line_number":763,"context_line":"        chassis \u003d collections.namedtuple(\u0027chassis\u0027, \u0027name\u0027)"},{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_1d9cb8be","line":761,"range":{"start_line":761,"start_character":12,"end_line":761,"end_character":13},"updated":"2019-05-23 10:52:47.000000000","message":"missing _","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"f604d67b1c0f56e10d40e32c0191c09759d575eb","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":759,"context_line":"        inst.idl._session.reconnect.set_probe_interval.assert_called_with(5000)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def test_get_logical_port_master_chassis(self):"},{"line_number":762,"context_line":"        port \u003d collections.namedtuple(\u0027port_binding\u0027, \u0027chassis type\u0027)"},{"line_number":763,"context_line":"        chassis \u003d collections.namedtuple(\u0027chassis\u0027, \u0027name\u0027)"},{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_4a7ed619","line":761,"range":{"start_line":761,"start_character":12,"end_line":761,"end_character":13},"in_reply_to":"bfb3d3c7_1d9cb8be","updated":"2019-05-24 05:41:42.000000000","message":"Not missing, until its a helper function, I guess :)","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"908a640dd935935b01f2cbe77c3d6b2421a5eed6","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":759,"context_line":"        inst.idl._session.reconnect.set_probe_interval.assert_called_with(5000)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def test_get_logical_port_master_chassis(self):"},{"line_number":762,"context_line":"        port \u003d collections.namedtuple(\u0027port_binding\u0027, \u0027chassis type\u0027)"},{"line_number":763,"context_line":"        chassis \u003d collections.namedtuple(\u0027chassis\u0027, \u0027name\u0027)"},{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_fb7f5bdd","line":761,"range":{"start_line":761,"start_character":12,"end_line":761,"end_character":13},"in_reply_to":"bfb3d3c7_4a7ed619","updated":"2019-05-24 08:44:46.000000000","message":"_get_logical_port_master_chassis has a leading _ so the name of this test method should compose of test_ prefix + name of the method.\n\n test_ + _get_logical_port_master_chassis \u003d test__get_logical_port_master_chassis","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"977ee0d304c81df423d99606cbb31f2410a1bd59","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":759,"context_line":"        inst.idl._session.reconnect.set_probe_interval.assert_called_with(5000)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def test_get_logical_port_master_chassis(self):"},{"line_number":762,"context_line":"        port \u003d collections.namedtuple(\u0027port_binding\u0027, \u0027chassis type\u0027)"},{"line_number":763,"context_line":"        chassis \u003d collections.namedtuple(\u0027chassis\u0027, \u0027name\u0027)"},{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_de9605f1","line":761,"range":{"start_line":761,"start_character":12,"end_line":761,"end_character":13},"in_reply_to":"bfb3d3c7_fb7f5bdd","updated":"2019-05-24 08:45:31.000000000","message":"Whoops, this was put here by accident as I see Daniel has already replied. Please ignore this last comment","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f55bafaef38bb83e8478ea1b0b1f511bd133b922","unresolved":false,"context_lines":[{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"},{"line_number":765,"context_line":"                          type\u003dovn_const.OVN_CHASSIS_REDIRECT)]"},{"line_number":766,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":767,"context_line":"        inst.db_find_rows \u003d mock.Mock()"},{"line_number":768,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":769,"context_line":"        # Successful search"},{"line_number":770,"context_line":"        self.assertEqual(\"host1\","}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_7d73744e","line":767,"range":{"start_line":767,"start_character":8,"end_line":767,"end_character":39},"updated":"2019-05-23 10:52:47.000000000","message":"better to use mock.object.patch","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"d21ad67cfcf8279335c791fb7ee005e050d7b14b","unresolved":false,"context_lines":[{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"},{"line_number":765,"context_line":"                          type\u003dovn_const.OVN_CHASSIS_REDIRECT)]"},{"line_number":766,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":767,"context_line":"        inst.db_find_rows \u003d mock.Mock()"},{"line_number":768,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":769,"context_line":"        # Successful search"},{"line_number":770,"context_line":"        self.assertEqual(\"host1\","}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_debfe55e","line":767,"range":{"start_line":767,"start_character":8,"end_line":767,"end_character":39},"in_reply_to":"bfb3d3c7_1efb3d47","updated":"2019-05-24 08:46:36.000000000","message":"Ok, I see now","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"1ea8b35d00ff73f6857d2b01ebb8369b73c3f649","unresolved":false,"context_lines":[{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"},{"line_number":765,"context_line":"                          type\u003dovn_const.OVN_CHASSIS_REDIRECT)]"},{"line_number":766,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":767,"context_line":"        inst.db_find_rows \u003d mock.Mock()"},{"line_number":768,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":769,"context_line":"        # Successful search"},{"line_number":770,"context_line":"        self.assertEqual(\"host1\","}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_fd8684db","line":767,"range":{"start_line":767,"start_character":8,"end_line":767,"end_character":39},"in_reply_to":"bfb3d3c7_7d73744e","updated":"2019-05-23 11:00:02.000000000","message":"Done","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"908a640dd935935b01f2cbe77c3d6b2421a5eed6","unresolved":false,"context_lines":[{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"},{"line_number":765,"context_line":"                          type\u003dovn_const.OVN_CHASSIS_REDIRECT)]"},{"line_number":766,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":767,"context_line":"        inst.db_find_rows \u003d mock.Mock()"},{"line_number":768,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":769,"context_line":"        # Successful search"},{"line_number":770,"context_line":"        self.assertEqual(\"host1\","}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_1efb3d47","line":767,"range":{"start_line":767,"start_character":8,"end_line":767,"end_character":39},"in_reply_to":"bfb3d3c7_dea285ae","updated":"2019-05-24 08:44:46.000000000","message":"What do you mean?","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"ea4707bde850817daba57a583cd6080925011ca1","unresolved":false,"context_lines":[{"line_number":764,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"},{"line_number":765,"context_line":"                          type\u003dovn_const.OVN_CHASSIS_REDIRECT)]"},{"line_number":766,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":767,"context_line":"        inst.db_find_rows \u003d mock.Mock()"},{"line_number":768,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":769,"context_line":"        # Successful search"},{"line_number":770,"context_line":"        self.assertEqual(\"host1\","}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_dea285ae","line":767,"range":{"start_line":767,"start_character":8,"end_line":767,"end_character":39},"in_reply_to":"bfb3d3c7_fd8684db","updated":"2019-05-24 08:35:07.000000000","message":"I tried it out, but I seem to have created a similar set of lines. I am reverting back to my original code here.","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f55bafaef38bb83e8478ea1b0b1f511bd133b922","unresolved":false,"context_lines":[{"line_number":771,"context_line":"                         inst._get_logical_port_master_chassis(\u0027host1\u0027))"},{"line_number":772,"context_line":"        # Unsuccesful search - I"},{"line_number":773,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"},{"line_number":774,"context_line":"        self.assertIsNone(inst._get_logical_port_master_chassis(\u0027host1\u0027))"},{"line_number":775,"context_line":"        # Unsuccesful search - II"},{"line_number":776,"context_line":"        fake_port \u003d [port(chassis\u003d[], type\u003d\u0027\u0027)]"},{"line_number":777,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_1ddef810","line":774,"updated":"2019-05-23 10:52:47.000000000","message":"One assert per test","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"1ea8b35d00ff73f6857d2b01ebb8369b73c3f649","unresolved":false,"context_lines":[{"line_number":771,"context_line":"                         inst._get_logical_port_master_chassis(\u0027host1\u0027))"},{"line_number":772,"context_line":"        # Unsuccesful search - I"},{"line_number":773,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"},{"line_number":774,"context_line":"        self.assertIsNone(inst._get_logical_port_master_chassis(\u0027host1\u0027))"},{"line_number":775,"context_line":"        # Unsuccesful search - II"},{"line_number":776,"context_line":"        fake_port \u003d [port(chassis\u003d[], type\u003d\u0027\u0027)]"},{"line_number":777,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_9d6d0834","line":774,"in_reply_to":"bfb3d3c7_1ddef810","updated":"2019-05-23 11:00:02.000000000","message":"Done","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"42186b07a637bb9b5e6d5af42755c890dc7e4abb","unresolved":false,"context_lines":[{"line_number":771,"context_line":"                         inst._get_logical_port_master_chassis(\u0027host1\u0027))"},{"line_number":772,"context_line":"        # Unsuccesful search - I"},{"line_number":773,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"},{"line_number":774,"context_line":"        self.assertIsNone(inst._get_logical_port_master_chassis(\u0027host1\u0027))"},{"line_number":775,"context_line":"        # Unsuccesful search - II"},{"line_number":776,"context_line":"        fake_port \u003d [port(chassis\u003d[], type\u003d\u0027\u0027)]"},{"line_number":777,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_5d223002","line":774,"in_reply_to":"bfb3d3c7_1ddef810","updated":"2019-05-23 10:57:09.000000000","message":"Right, you can have a _helper method and write 4 tests with a  descriptive name of what they\u0027re actually testing","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"f55bafaef38bb83e8478ea1b0b1f511bd133b922","unresolved":false,"context_lines":[{"line_number":774,"context_line":"        self.assertIsNone(inst._get_logical_port_master_chassis(\u0027host1\u0027))"},{"line_number":775,"context_line":"        # Unsuccesful search - II"},{"line_number":776,"context_line":"        fake_port \u003d [port(chassis\u003d[], type\u003d\u0027\u0027)]"},{"line_number":777,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"},{"line_number":778,"context_line":"        self.assertIsNone(inst._get_logical_port_master_chassis(\u0027host1\u0027))"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_3dbc1cba","line":777,"range":{"start_line":777,"start_character":62,"end_line":777,"end_character":64},"updated":"2019-05-23 10:52:47.000000000","message":"fake_port ?","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a1d33ef71a8f3e8cffcbd0b4094a53920e169a5b","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        # Unsuccesful search - II"},{"line_number":776,"context_line":"        fake_port \u003d [port(chassis\u003d[], type\u003d\u0027\u0027)]"},{"line_number":777,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"},{"line_number":778,"context_line":"        self.assertIsNone(inst._get_logical_port_master_chassis(\u0027host1\u0027))"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_1d2cb800","line":778,"updated":"2019-05-23 10:54:35.000000000","message":"you\u0027re missing a case where port chassis is empty","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"1ea8b35d00ff73f6857d2b01ebb8369b73c3f649","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        # Unsuccesful search - II"},{"line_number":776,"context_line":"        fake_port \u003d [port(chassis\u003d[], type\u003d\u0027\u0027)]"},{"line_number":777,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"},{"line_number":778,"context_line":"        self.assertIsNone(inst._get_logical_port_master_chassis(\u0027host1\u0027))"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_7d729413","line":778,"in_reply_to":"bfb3d3c7_1d2cb800","updated":"2019-05-23 11:00:02.000000000","message":"would be taken care by fake_port, isnt it?","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"a139d40cf3037cc08ce281cdeefe1ec653a14960","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        # Unsuccesful search - II"},{"line_number":776,"context_line":"        fake_port \u003d [port(chassis\u003d[], type\u003d\u0027\u0027)]"},{"line_number":777,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d []"},{"line_number":778,"context_line":"        self.assertIsNone(inst._get_logical_port_master_chassis(\u0027host1\u0027))"}],"source_content_type":"text/x-python","patch_set":31,"id":"bfb3d3c7_7df9344b","line":778,"in_reply_to":"bfb3d3c7_7d729413","updated":"2019-05-23 11:03:26.000000000","message":"no, because you have type\u003d\u0027\u0027, so it never hits L826, no? you can try it. change the L826 in the code to return \u0027foo\u0027 and your test should still be passing. Unless I missed something :)","commit_id":"2920a4976ab2bc952dc3c9cbd56ace08f990418f"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"54c27e9da65a2265bc71de7e7ff56998acb16c23","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":759,"context_line":"        inst.idl._session.reconnect.set_probe_interval.assert_called_with(5000)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def _test_get_logical_port_master_chassis(self, fake_port):"},{"line_number":762,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":763,"context_line":"        inst.db_find_rows \u003d mock.object.patch()"},{"line_number":764,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"}],"source_content_type":"text/x-python","patch_set":32,"id":"bfb3d3c7_f8a1a1f9","line":761,"range":{"start_line":761,"start_character":8,"end_line":761,"end_character":45},"updated":"2019-05-24 06:08:07.000000000","message":"Convention is test_\u003cname of the method under test\u003e\nBecause the method is _get_logical... what Kuba said is that it should be\ntest__get_logical...\nAs this is a helper, fine with having a leading underscore but still missing one","commit_id":"4efb54c5c3e59dd62ef96d978046842f265c1c50"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"12087c1aef81ef8584bb0acb38b0d06cf66721c8","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":759,"context_line":"        inst.idl._session.reconnect.set_probe_interval.assert_called_with(5000)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def _test_get_logical_port_master_chassis(self, fake_port):"},{"line_number":762,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":763,"context_line":"        inst.db_find_rows \u003d mock.object.patch()"},{"line_number":764,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"}],"source_content_type":"text/x-python","patch_set":32,"id":"bfb3d3c7_58dead6d","line":761,"range":{"start_line":761,"start_character":8,"end_line":761,"end_character":45},"in_reply_to":"bfb3d3c7_f8a1a1f9","updated":"2019-05-24 06:13:35.000000000","message":"I thought it wont be a major issue, but sure :)","commit_id":"4efb54c5c3e59dd62ef96d978046842f265c1c50"},{"author":{"_account_id":23804,"name":"Daniel Alvarez","email":"dalvarez@redhat.com","username":"dalvarez"},"change_message_id":"54c27e9da65a2265bc71de7e7ff56998acb16c23","unresolved":false,"context_lines":[{"line_number":764,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":765,"context_line":"        return inst._get_logical_port_master_chassis(\u0027host1\u0027)"},{"line_number":766,"context_line":""},{"line_number":767,"context_line":"    def test_logical_port_master_chassis_success(self):"},{"line_number":768,"context_line":"        port \u003d collections.namedtuple(\u0027port_binding\u0027, \u0027chassis type\u0027)"},{"line_number":769,"context_line":"        chassis \u003d collections.namedtuple(\u0027chassis\u0027, \u0027name\u0027)"},{"line_number":770,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"}],"source_content_type":"text/x-python","patch_set":32,"id":"bfb3d3c7_b8a7a90b","line":767,"range":{"start_line":767,"start_character":8,"end_line":767,"end_character":48},"updated":"2019-05-24 06:08:07.000000000","message":"test__get_...\nSame for methods below","commit_id":"4efb54c5c3e59dd62ef96d978046842f265c1c50"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"3a7ea49459009fe3a971fac3774058ef9f728817","unresolved":false,"context_lines":[{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def _test_get_logical_port_master_chassis(self, fake_port):"},{"line_number":762,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":763,"context_line":"        inst.db_find_rows \u003d mock.object.patch()"},{"line_number":764,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":765,"context_line":"        return inst._get_logical_port_master_chassis(\u0027host1\u0027)"},{"line_number":766,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"bfb3d3c7_3ea64155","line":763,"range":{"start_line":763,"start_character":8,"end_line":763,"end_character":47},"updated":"2019-05-24 08:48:29.000000000","message":"You don\u0027t want the db_find_rows to be a function for patching objects but you want the attribute to be patched.\n\n mock.object.patch(inst, \u0027db_find_rows\u0027).start()","commit_id":"5c87bd2c6091cc0dd6dba0d089c09b9c693a1882"},{"author":{"_account_id":17776,"name":"Reedip","email":"reedip.banerjee@gmail.com","username":"Reedip"},"change_message_id":"e79b6bf6444a0678079a20de2e8ea838f32dc035","unresolved":false,"context_lines":[{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def _test_get_logical_port_master_chassis(self, fake_port):"},{"line_number":762,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":763,"context_line":"        inst.db_find_rows \u003d mock.object.patch()"},{"line_number":764,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":765,"context_line":"        return inst._get_logical_port_master_chassis(\u0027host1\u0027)"},{"line_number":766,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"bfb3d3c7_c4962494","line":763,"range":{"start_line":763,"start_character":8,"end_line":763,"end_character":47},"in_reply_to":"bfb3d3c7_3ea64155","updated":"2019-05-26 14:15:58.000000000","message":"Still trying to find where mock.object.patch is :)","commit_id":"5c87bd2c6091cc0dd6dba0d089c09b9c693a1882"},{"author":{"_account_id":8655,"name":"Jakub Libosvar","email":"libosvar@redhat.com","username":"jlibosva"},"change_message_id":"77223d381c09f847d4e5aa7e80db56c0065c7f43","unresolved":false,"context_lines":[{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def _test__get_logical_port_master_chassis(self, fake_port):"},{"line_number":762,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":763,"context_line":"        inst.db_find_rows \u003d mock.Mock()"},{"line_number":764,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":765,"context_line":"        return inst._get_logical_port_master_chassis(\u0027host1\u0027)"},{"line_number":766,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"bfb3d3c7_211f04b8","line":763,"range":{"start_line":763,"start_character":8,"end_line":763,"end_character":39},"updated":"2019-05-24 09:27:22.000000000","message":"Please use mock.patch.object. You can search the codebase to see how it\u0027s being used.","commit_id":"3d7dfa0f230d89732148ef2a9a769fff26f85fa2"},{"author":{"_account_id":24791,"name":"Maciej Jozefczyk","email":"jeicam.pl@gmail.com","username":"maciej.jozefczyk"},"change_message_id":"9c42ae4df35257f5260e2ec2e4016f506242f06e","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":759,"context_line":"        inst.idl._session.reconnect.set_probe_interval.assert_called_with(5000)"},{"line_number":760,"context_line":""},{"line_number":761,"context_line":"    def _test__get_logical_port_master_chassis(self, fake_port):"},{"line_number":762,"context_line":"        inst \u003d impl_idl_ovn.OvsdbSbOvnIdl(mock.Mock())"},{"line_number":763,"context_line":"        mock.patch.object(inst, \u0027db_find_rows\u0027).start()"},{"line_number":764,"context_line":"        inst.db_find_rows.return_value.execute.return_value \u003d fake_port"},{"line_number":765,"context_line":"        return inst._get_logical_port_master_chassis(\u0027host1\u0027)"},{"line_number":766,"context_line":""},{"line_number":767,"context_line":"    def test__get_logical_port_master_chassis_success(self):"},{"line_number":768,"context_line":"        port \u003d collections.namedtuple(\u0027port_binding\u0027, \u0027chassis type\u0027)"},{"line_number":769,"context_line":"        chassis \u003d collections.namedtuple(\u0027chassis\u0027, \u0027name\u0027)"},{"line_number":770,"context_line":"        fake_port \u003d [port(chassis\u003d[chassis(name\u003d\u0027host1\u0027)],"},{"line_number":771,"context_line":"                          type\u003dovn_const.OVN_CHASSIS_REDIRECT)]"},{"line_number":772,"context_line":"        # Successful search"},{"line_number":773,"context_line":"        self.assertEqual("},{"line_number":774,"context_line":"            \"host1\", self._test__get_logical_port_master_chassis(fake_port))"},{"line_number":775,"context_line":""},{"line_number":776,"context_line":"    def test__get_logical_port_master_chassis_no_port(self):"},{"line_number":777,"context_line":"        self.assertIsNone("},{"line_number":778,"context_line":"            self._test__get_logical_port_master_chassis([]))"},{"line_number":779,"context_line":""},{"line_number":780,"context_line":"    def test__get_logical_port_master_chassis_no_chassis_in_port(self):"},{"line_number":781,"context_line":"        port \u003d collections.namedtuple(\u0027port_binding\u0027, \u0027chassis type\u0027)"},{"line_number":782,"context_line":"        fake_port \u003d [port(chassis\u003d[], type\u003dovn_const.OVN_CHASSIS_REDIRECT)]"},{"line_number":783,"context_line":"        self.assertIsNone("},{"line_number":784,"context_line":"            self._test__get_logical_port_master_chassis(fake_port))"},{"line_number":785,"context_line":""},{"line_number":786,"context_line":"    def test__get_logical_port_master_chassis_no_port_of_gw_type(self):"},{"line_number":787,"context_line":"        port \u003d collections.namedtuple(\u0027port_binding\u0027, \u0027chassis type\u0027)"},{"line_number":788,"context_line":"        fake_port \u003d [port(chassis\u003d[], type\u003d\u0027\u0027)]"},{"line_number":789,"context_line":"        self.assertIsNone("},{"line_number":790,"context_line":"            self._test__get_logical_port_master_chassis(fake_port))"}],"source_content_type":"text/x-python","patch_set":37,"id":"7faddb67_471fa1b6","line":790,"range":{"start_line":761,"start_character":4,"end_line":790,"end_character":67},"updated":"2019-07-12 15:43:50.000000000","message":"We don\u0027t need this due we have similar functions that does same job.","commit_id":"89bb04f8f530cb73cff36e6a219175244bfe6dba"}]}
