)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b47a55ed1f95498a2b4a857b33b9cdca5a559aa1","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Routed networks IPv4 inventory in Nova GRP"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Using Nova\u0027s generic resource pools (GRP) API, publish routed networks"},{"line_number":10,"context_line":"IPv4 inventory. This inventory is then used by the Nova scheduler to"},{"line_number":11,"context_line":"place instances based on the availability of IPv4 addresses in"},{"line_number":12,"context_line":"routed networks segments."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9a89bdaa_901e705d","line":10,"updated":"2016-09-07 08:47:07.000000000","message":"I think you know this, but the scheduler actually using this stuff will be in Ocata.","commit_id":"133556df321d1b1d5bfbe7965b3026946e9a55a2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"6defe9f898796aed6b075ce1f0d8e74a810506df","unresolved":false,"context_lines":[{"line_number":7,"context_line":"Routed networks IPv4 inventory in Nova GRP"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Using Nova\u0027s generic resource pools (GRP) API, publish routed networks"},{"line_number":10,"context_line":"IPv4 inventory. This inventory is then used by the Nova scheduler to"},{"line_number":11,"context_line":"place instances based on the availability of IPv4 addresses in"},{"line_number":12,"context_line":"routed networks segments."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"9a89bdaa_bea16cfa","line":10,"in_reply_to":"9a89bdaa_901e705d","updated":"2016-09-07 14:47:31.000000000","message":"Yes I know it! I want to evolve this patchset gradually over the Ocata cycle, with as much feedback as possible. So the commit message reflects what I expect to be true in Ocata.","commit_id":"133556df321d1b1d5bfbe7965b3026946e9a55a2"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"050ad07796e18051e90a6187f406c8d967cf1d21","unresolved":false,"context_lines":[{"line_number":10,"context_line":"IPv4 inventory. This inventory is then used by the Nova scheduler to"},{"line_number":11,"context_line":"place instances based on the availability of IPv4 addresses in"},{"line_number":12,"context_line":"routed networks segments."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ib6b00c4889d6a34765844ce46280819dff0108c5"},{"line_number":15,"context_line":"Partially-Implements: blueprint routed-networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"7a8ec9b2_0dc0414f","line":13,"updated":"2016-09-18 11:57:13.000000000","message":"please add DocImpact and list the new configuration variables. I think that this also requires a release note","commit_id":"e22d07e0f4689d104882a5dfa8dc632e9a95d296"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"1db6d271e8946f1cb6b1870bf6584270e062d612","unresolved":false,"context_lines":[{"line_number":10,"context_line":"IPv4 inventory. This inventory is then used by the Nova scheduler to"},{"line_number":11,"context_line":"place instances based on the availability of IPv4 addresses in"},{"line_number":12,"context_line":"routed networks segments."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ib6b00c4889d6a34765844ce46280819dff0108c5"},{"line_number":15,"context_line":"Partially-Implements: blueprint routed-networks"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":6,"id":"3a98d1f4_351a1b6f","line":13,"in_reply_to":"7a8ec9b2_0dc0414f","updated":"2016-09-30 00:12:51.000000000","message":"Done","commit_id":"e22d07e0f4689d104882a5dfa8dc632e9a95d296"},{"author":{"_account_id":22678,"name":"Bruce Tan","email":"brucetan@linux.vnet.ibm.com","username":"brucetan"},"change_message_id":"5f9515b7f7e00fab41ab1d284a4366b7f663ea7b","unresolved":false,"context_lines":[{"line_number":12,"context_line":"routed networks segments."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"To complete the implementation of this functionality, the following"},{"line_number":15,"context_line":"Nova patchset has to merge: https://review.openstack.org/#/c/357993/"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"DocImpact: Adds [placement] section to neutron.conf with two options:"},{"line_number":18,"context_line":"           region_name and endpoint_type"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"7a77a97e_9c770d08","line":15,"updated":"2016-11-21 07:08:05.000000000","message":"How about adding \"Depends-On\" at the end of the commit message, so that gerrit can merge automatically after the other patch is merged?","commit_id":"fa0e5535bd8689fbed9d61ca72ad2bbfd5de290f"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eae9bd646c46fe19167775bf4054b1b5bb504172","unresolved":false,"context_lines":[{"line_number":12,"context_line":"routed networks segments."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"To complete the implementation of this functionality, the following"},{"line_number":15,"context_line":"Nova patchset has to merge: https://review.openstack.org/#/c/357993/"},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"DocImpact: Adds [placement] section to neutron.conf with two options:"},{"line_number":18,"context_line":"           region_name and endpoint_type"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":17,"id":"5a74a57a_a4dcac19","line":15,"in_reply_to":"7a77a97e_9c770d08","updated":"2016-11-23 01:01:37.000000000","message":"Thanks for the recommendation. I expect the other patchset to merge very soon, so I don\u0027t think it is necessary to create an explicit dependency. If the merge of the other patchset takes longer that I think, I will follow your recommendation :-)","commit_id":"fa0e5535bd8689fbed9d61ca72ad2bbfd5de290f"}],"neutron/conf/common.py":[{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"050ad07796e18051e90a6187f406c8d967cf1d21","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"placement_opts \u003d ["},{"line_number":192,"context_line":"    cfg.StrOpt(\u0027region_name\u0027,"},{"line_number":193,"context_line":"               help\u003d_(\u0027Name of placement region to use. Useful if keystone\u0027"},{"line_number":194,"context_line":"                      \u0027 manages more than one region.\u0027)),"},{"line_number":195,"context_line":"    cfg.StrOpt(\u0027endpoint_type\u0027,"},{"line_number":196,"context_line":"               default\u003d\u0027public\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a8ec9b2_8de5310a","line":193,"updated":"2016-09-18 11:57:13.000000000","message":"please add spaces at the end of the line","commit_id":"e22d07e0f4689d104882a5dfa8dc632e9a95d296"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"1db6d271e8946f1cb6b1870bf6584270e062d612","unresolved":false,"context_lines":[{"line_number":190,"context_line":""},{"line_number":191,"context_line":"placement_opts \u003d ["},{"line_number":192,"context_line":"    cfg.StrOpt(\u0027region_name\u0027,"},{"line_number":193,"context_line":"               help\u003d_(\u0027Name of placement region to use. Useful if keystone\u0027"},{"line_number":194,"context_line":"                      \u0027 manages more than one region.\u0027)),"},{"line_number":195,"context_line":"    cfg.StrOpt(\u0027endpoint_type\u0027,"},{"line_number":196,"context_line":"               default\u003d\u0027public\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a98d1f4_95212fa2","line":193,"in_reply_to":"7a8ec9b2_8de5310a","updated":"2016-09-30 00:12:51.000000000","message":"Done","commit_id":"e22d07e0f4689d104882a5dfa8dc632e9a95d296"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"050ad07796e18051e90a6187f406c8d967cf1d21","unresolved":false,"context_lines":[{"line_number":195,"context_line":"    cfg.StrOpt(\u0027endpoint_type\u0027,"},{"line_number":196,"context_line":"               default\u003d\u0027public\u0027,"},{"line_number":197,"context_line":"               choices\u003d[\u0027public\u0027, \u0027admin\u0027, \u0027internal\u0027],"},{"line_number":198,"context_line":"               help\u003d_(\u0027Type of the placement endpoint to use.  This endpoint\u0027"},{"line_number":199,"context_line":"                      \u0027 will be looked up in the keystone catalog and should\u0027"},{"line_number":200,"context_line":"                      \u0027 be one of public, internal or admin.\u0027)),"},{"line_number":201,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a8ec9b2_adf02dca","line":198,"updated":"2016-09-18 11:57:13.000000000","message":"ditto","commit_id":"e22d07e0f4689d104882a5dfa8dc632e9a95d296"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"1db6d271e8946f1cb6b1870bf6584270e062d612","unresolved":false,"context_lines":[{"line_number":195,"context_line":"    cfg.StrOpt(\u0027endpoint_type\u0027,"},{"line_number":196,"context_line":"               default\u003d\u0027public\u0027,"},{"line_number":197,"context_line":"               choices\u003d[\u0027public\u0027, \u0027admin\u0027, \u0027internal\u0027],"},{"line_number":198,"context_line":"               help\u003d_(\u0027Type of the placement endpoint to use.  This endpoint\u0027"},{"line_number":199,"context_line":"                      \u0027 will be looked up in the keystone catalog and should\u0027"},{"line_number":200,"context_line":"                      \u0027 be one of public, internal or admin.\u0027)),"},{"line_number":201,"context_line":"]"}],"source_content_type":"text/x-python","patch_set":6,"id":"3a98d1f4_d53bb7cf","line":198,"in_reply_to":"7a8ec9b2_adf02dca","updated":"2016-09-30 00:12:51.000000000","message":"Done","commit_id":"e22d07e0f4689d104882a5dfa8dc632e9a95d296"}],"neutron/services/segments/plugin.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b47a55ed1f95498a2b4a857b33b9cdca5a559aa1","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        session \u003d ks_loading.load_session_from_conf_options("},{"line_number":125,"context_line":"            cfg.CONF,"},{"line_number":126,"context_line":"            \u0027nova\u0027,"},{"line_number":127,"context_line":"            auth\u003dauth)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        self.p_client \u003d placement_client.Client("},{"line_number":130,"context_line":"            NOVA_PLACEMENT_API_VERSION, session\u003dsession,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a89bdaa_3045a4b2","line":127,"updated":"2016-09-07 08:47:07.000000000","message":"In the work done recently to get the nova resource tracker reporting inventories to the placement api, a [placement] group, containing auth config for the placement endpoint, so I think you\u0027ll probably want two different sessions here?\n\nhttps://github.com/openstack/nova/blob/ed435f2680c4ce904b47fe5b1fc90c516f148ff6/nova/scheduler/client/report.py#L68","commit_id":"133556df321d1b1d5bfbe7965b3026946e9a55a2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"6defe9f898796aed6b075ce1f0d8e74a810506df","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        session \u003d ks_loading.load_session_from_conf_options("},{"line_number":125,"context_line":"            cfg.CONF,"},{"line_number":126,"context_line":"            \u0027nova\u0027,"},{"line_number":127,"context_line":"            auth\u003dauth)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        self.p_client \u003d placement_client.Client("},{"line_number":130,"context_line":"            NOVA_PLACEMENT_API_VERSION, session\u003dsession,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a89bdaa_7e8b6468","line":127,"in_reply_to":"9a89bdaa_3045a4b2","updated":"2016-09-07 14:47:31.000000000","message":"ahhh. Will take this into consideration for the next revision","commit_id":"133556df321d1b1d5bfbe7965b3026946e9a55a2"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"8a3285ea5ffdd32a5d2653b5b3edd6bbfc173fc3","unresolved":false,"context_lines":[{"line_number":124,"context_line":"        session \u003d ks_loading.load_session_from_conf_options("},{"line_number":125,"context_line":"            cfg.CONF,"},{"line_number":126,"context_line":"            \u0027nova\u0027,"},{"line_number":127,"context_line":"            auth\u003dauth)"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        self.p_client \u003d placement_client.Client("},{"line_number":130,"context_line":"            NOVA_PLACEMENT_API_VERSION, session\u003dsession,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a8ec9b2_a544c749","line":127,"in_reply_to":"9a89bdaa_7e8b6468","updated":"2016-09-18 06:56:46.000000000","message":"In PS6 I have added a \u0027placement\u0027 section to neutron.conf and have modified Neutron to handle this section. Also, I now create a session for the placement client and another for the nova client","commit_id":"133556df321d1b1d5bfbe7965b3026946e9a55a2"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6f0d9c34b4e67cbcb5be25aa94c92d7dc2074197","unresolved":false,"context_lines":[{"line_number":200,"context_line":"            db.SegmentHostMapping).filter_by(segment_id\u003dsegment_id)"},{"line_number":201,"context_line":"        #TODO(mlavalle) associate aggregate with resource provider as soon as"},{"line_number":202,"context_line":"        # placement api is ready"},{"line_number":203,"context_line":"        # self.p_client.aggregates.associate(segment_id, [aggregate_id])"},{"line_number":204,"context_line":"        for mapping in query:"},{"line_number":205,"context_line":"            self.n_client.aggregates.add_host(aggregate_id, mapping[\u0027host\u0027])"},{"line_number":206,"context_line":"        ipv4_inventory \u003d {\u0027total\u0027: total, \u0027reserved\u0027: reserved,"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a629dbe_bbae0fe4","line":203,"updated":"2016-11-09 16:42:32.000000000","message":"sorry it\u0027s taking so long :(\n\nnearly there","commit_id":"d64fd0688c54d4ef08b042a0c3574473e6756b06"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6f0d9c34b4e67cbcb5be25aa94c92d7dc2074197","unresolved":false,"context_lines":[{"line_number":204,"context_line":"        for mapping in query:"},{"line_number":205,"context_line":"            self.n_client.aggregates.add_host(aggregate_id, mapping[\u0027host\u0027])"},{"line_number":206,"context_line":"        ipv4_inventory \u003d {\u0027total\u0027: total, \u0027reserved\u0027: reserved,"},{"line_number":207,"context_line":"                          \u0027min_unit\u0027: 1, \u0027max_unit\u0027: 1, \u0027step_size\u0027: 1,"},{"line_number":208,"context_line":"                          \u0027allocation_ratio\u0027: 1.0,"},{"line_number":209,"context_line":"                          \u0027resource_class\u0027: IPV4_RESOURCE_CLASS}"},{"line_number":210,"context_line":"        self.p_client.inventories.create(segment_id, ipv4_inventory)"}],"source_content_type":"text/x-python","patch_set":15,"id":"9a629dbe_1beb7b14","line":207,"updated":"2016-11-09 16:42:32.000000000","message":"Is max_unit 1 what you really want. We\u0027ve realized in the nova resource tracker that max_unit being 1 is a problem, see:\n\nhttps://bugs.launchpad.net/nova/+bug/1638681","commit_id":"d64fd0688c54d4ef08b042a0c3574473e6756b06"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8147b8dae30f6ed462b4f096ecdadf47c6c94ca3","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                           resources.PORT, events.AFTER_CREATE)"},{"line_number":128,"context_line":"        registry.subscribe(self._notify_port_updated, resources.PORT,"},{"line_number":129,"context_line":"                           events.AFTER_UPDATE)"},{"line_number":130,"context_line":"        registry.subscribe(self._notify_port_created_or_deleted,"},{"line_number":131,"context_line":"                           resources.PORT, events.AFTER_DELETE)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _get_clients(self):"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a77a97e_e493f8fe","line":130,"updated":"2016-11-21 13:17:15.000000000","message":"All of these operations are going to block the core plugin operations from returning until we authenticate with keystone, contact nova, go through the retry logic below, etc.\n\nCan you alter the logic to have these event handlers just queue up a change like we have in the exising nova notifier? In addition to making the API a bit more performant, it gives us the option to aggregate lots of actions into a single call (e.g. create 40 ports on a network and we only update nova once).","commit_id":"fa0e5535bd8689fbed9d61ca72ad2bbfd5de290f"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"492b277433065e9dab3640d4ae9c62cd2e6219cf","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                           resources.PORT, events.AFTER_CREATE)"},{"line_number":128,"context_line":"        registry.subscribe(self._notify_port_updated, resources.PORT,"},{"line_number":129,"context_line":"                           events.AFTER_UPDATE)"},{"line_number":130,"context_line":"        registry.subscribe(self._notify_port_created_or_deleted,"},{"line_number":131,"context_line":"                           resources.PORT, events.AFTER_DELETE)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _get_clients(self):"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a71b18c_0adfaf0d","line":130,"in_reply_to":"5a74a57a_44c64168","updated":"2016-12-05 01:51:21.000000000","message":"Done","commit_id":"fa0e5535bd8689fbed9d61ca72ad2bbfd5de290f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"077b65e0d6e2d4e05fde121f520014175717e83d","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                           resources.PORT, events.AFTER_CREATE)"},{"line_number":128,"context_line":"        registry.subscribe(self._notify_port_updated, resources.PORT,"},{"line_number":129,"context_line":"                           events.AFTER_UPDATE)"},{"line_number":130,"context_line":"        registry.subscribe(self._notify_port_created_or_deleted,"},{"line_number":131,"context_line":"                           resources.PORT, events.AFTER_DELETE)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _get_clients(self):"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a74a57a_44c64168","line":130,"in_reply_to":"5a74a57a_a4874c11","updated":"2016-11-23 23:31:48.000000000","message":"Yep, that sounds exactly like what we want.","commit_id":"fa0e5535bd8689fbed9d61ca72ad2bbfd5de290f"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eae9bd646c46fe19167775bf4054b1b5bb504172","unresolved":false,"context_lines":[{"line_number":127,"context_line":"                           resources.PORT, events.AFTER_CREATE)"},{"line_number":128,"context_line":"        registry.subscribe(self._notify_port_updated, resources.PORT,"},{"line_number":129,"context_line":"                           events.AFTER_UPDATE)"},{"line_number":130,"context_line":"        registry.subscribe(self._notify_port_created_or_deleted,"},{"line_number":131,"context_line":"                           resources.PORT, events.AFTER_DELETE)"},{"line_number":132,"context_line":""},{"line_number":133,"context_line":"    def _get_clients(self):"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a74a57a_a4874c11","line":130,"in_reply_to":"7a77a97e_e493f8fe","updated":"2016-11-23 01:01:37.000000000","message":"Yes I can. To make sure we are aligned at a deeper level of detail, this is what I am going to do:\n\n1) In this __init__ method I am going to instantiate an instance of BatchNotifier: https://github.com/openstack/neutron/blob/master/neutron/notifiers/batch_notifier.py#L16. The BatchNotifier will be instantiated with a callback method that I am going to add to this class\n\n2) I am going to modify the event handlers that I refer to in L118-130 to receive the events, decide whether the events should be passed to the Placement and Nova API\u0027s and queue the events using the queue_event method in BatchNotifier\n\n3) The callback method, when called by the BatchNotifier, will send the accumulated events. For each event, it will send the pertinent requests to the Placement and Nova API\u0027s","commit_id":"fa0e5535bd8689fbed9d61ca72ad2bbfd5de290f"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"8147b8dae30f6ed462b4f096ecdadf47c6c94ca3","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            try:"},{"line_number":183,"context_line":"                self.p_client.inventories.update(segment_id, ipv4_inventory,"},{"line_number":184,"context_line":"                                                 IPV4_RESOURCE_CLASS)"},{"line_number":185,"context_line":"                break"},{"line_number":186,"context_line":"            except placement_exceptions.Conflict:"},{"line_number":187,"context_line":"                LOG.info(_LI(\u0027Re-trying to update Nova IPv4 inventory for \u0027"},{"line_number":188,"context_line":"                             \u0027routed network segment: %s\u0027), segment_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a77a97e_0499d41f","line":185,"updated":"2016-11-21 13:17:15.000000000","message":"As fun as the for-else is, probably just return here instead and remove the else statement.","commit_id":"fa0e5535bd8689fbed9d61ca72ad2bbfd5de290f"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"2e93bc29513cb9e4e1e7c561007f1b40fbe5c9b6","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            try:"},{"line_number":183,"context_line":"                self.p_client.inventories.update(segment_id, ipv4_inventory,"},{"line_number":184,"context_line":"                                                 IPV4_RESOURCE_CLASS)"},{"line_number":185,"context_line":"                break"},{"line_number":186,"context_line":"            except placement_exceptions.Conflict:"},{"line_number":187,"context_line":"                LOG.info(_LI(\u0027Re-trying to update Nova IPv4 inventory for \u0027"},{"line_number":188,"context_line":"                             \u0027routed network segment: %s\u0027), segment_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a74a57a_ad6fccc3","line":185,"in_reply_to":"5a74a57a_e48144fd","updated":"2016-11-25 23:48:36.000000000","message":"Done","commit_id":"fa0e5535bd8689fbed9d61ca72ad2bbfd5de290f"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"eae9bd646c46fe19167775bf4054b1b5bb504172","unresolved":false,"context_lines":[{"line_number":182,"context_line":"            try:"},{"line_number":183,"context_line":"                self.p_client.inventories.update(segment_id, ipv4_inventory,"},{"line_number":184,"context_line":"                                                 IPV4_RESOURCE_CLASS)"},{"line_number":185,"context_line":"                break"},{"line_number":186,"context_line":"            except placement_exceptions.Conflict:"},{"line_number":187,"context_line":"                LOG.info(_LI(\u0027Re-trying to update Nova IPv4 inventory for \u0027"},{"line_number":188,"context_line":"                             \u0027routed network segment: %s\u0027), segment_id)"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a74a57a_e48144fd","line":185,"in_reply_to":"7a77a97e_0499d41f","updated":"2016-11-23 01:01:37.000000000","message":"Will do!","commit_id":"fa0e5535bd8689fbed9d61ca72ad2bbfd5de290f"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"870c1f49bdd2cb79166f86bc9f2e703086b7e4ba","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"NOVA_API_VERSION \u003d \u00272\u0027"},{"line_number":45,"context_line":"NOVA_PLACEMENT_API_VERSION \u003d \u00271\u0027"},{"line_number":46,"context_line":"IPV4_RESOURCE_CLASS \u003d \u0027IPV4_ADDRESS\u0027"},{"line_number":47,"context_line":"SEGMENT_NAME_STUB \u003d \u0027Neutron segment id %s\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a71b18c_20255508","line":44,"updated":"2016-12-11 13:19:17.000000000","message":"should we consider making this configurable?","commit_id":"1ac67566aa975341249e481ea66b9048b471f9dd"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"c61b4148317233da6434e0368aa5c4196ff93687","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"NOVA_API_VERSION \u003d \u00272\u0027"},{"line_number":45,"context_line":"NOVA_PLACEMENT_API_VERSION \u003d \u00271\u0027"},{"line_number":46,"context_line":"IPV4_RESOURCE_CLASS \u003d \u0027IPV4_ADDRESS\u0027"},{"line_number":47,"context_line":"SEGMENT_NAME_STUB \u003d \u0027Neutron segment id %s\u0027"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a71b18c_a28085c0","line":44,"in_reply_to":"3a71b18c_20255508","updated":"2016-12-12 01:27:16.000000000","message":"I used this as my model: https://github.com/openstack/neutron/blob/master/neutron/notifiers/nova.py#L43. So, in principle, I say no. What do you think?","commit_id":"1ac67566aa975341249e481ea66b9048b471f9dd"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d947b3a8078d489c5456169b326227fbaa0d1a1b","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from keystoneauth1 import loading as ks_loading"},{"line_number":19,"context_line":"import netaddr"},{"line_number":20,"context_line":"from neutron_lib import constants"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_8057a9c8","line":17,"updated":"2017-01-06 21:37:34.000000000","message":"nit: extra blank line ?","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":14,"context_line":"#    License for the specific language governing permissions and limitations"},{"line_number":15,"context_line":"#    under the License."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":""},{"line_number":18,"context_line":"from keystoneauth1 import loading as ks_loading"},{"line_number":19,"context_line":"import netaddr"},{"line_number":20,"context_line":"from neutron_lib import constants"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_330b757f","line":17,"in_reply_to":"ba5201f7_8057a9c8","updated":"2017-01-10 01:30:19.000000000","message":"Done","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d947b3a8078d489c5456169b326227fbaa0d1a1b","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"NOVA_API_VERSION \u003d \u00272\u0027"},{"line_number":45,"context_line":"NOVA_PLACEMENT_API_VERSION \u003d \u00271\u0027"},{"line_number":46,"context_line":"IPV4_RESOURCE_CLASS \u003d \u0027IPV4_ADDRESS\u0027"},{"line_number":47,"context_line":"SEGMENT_NAME_STUB \u003d \u0027Neutron segment id %s\u0027"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_e0f795d0","line":44,"updated":"2017-01-06 21:37:34.000000000","message":"This is defined already in neutron/notifiers/nova.py","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":41,"context_line":""},{"line_number":42,"context_line":"LOG \u003d log.getLogger(__name__)"},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"NOVA_API_VERSION \u003d \u00272\u0027"},{"line_number":45,"context_line":"NOVA_PLACEMENT_API_VERSION \u003d \u00271\u0027"},{"line_number":46,"context_line":"IPV4_RESOURCE_CLASS \u003d \u0027IPV4_ADDRESS\u0027"},{"line_number":47,"context_line":"SEGMENT_NAME_STUB \u003d \u0027Neutron segment id %s\u0027"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_33e7f5ad","line":44,"in_reply_to":"ba5201f7_e0f795d0","updated":"2017-01-10 01:30:19.000000000","message":"You are right and I would have agreed with you up until this past Friday. However, with the fix (https://review.openstack.org/#/c/415031/) to bug https://bugs.launchpad.net/nova/+bug/1652642, for this patchset we need Nova microversion 2.41 at least, which allows us to have access to the aggregates UUIDs. So I think we need to keep this here","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d947b3a8078d489c5456169b326227fbaa0d1a1b","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            NOVA_API_VERSION,"},{"line_number":164,"context_line":"            session\u003dn_session,"},{"line_number":165,"context_line":"            region_name\u003dcfg.CONF.nova.region_name,"},{"line_number":166,"context_line":"            endpoint_type\u003dcfg.CONF.nova.endpoint_type,"},{"line_number":167,"context_line":"            extensions\u003dextensions)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        return p_client, n_client"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_00f2d999","line":166,"updated":"2017-01-06 21:37:34.000000000","message":"Are these supposed to be cfg.CONF.placement.* ?  That was added in https://review.openstack.org/#/c/414726/3/neutron/conf/common.py","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            NOVA_API_VERSION,"},{"line_number":164,"context_line":"            session\u003dn_session,"},{"line_number":165,"context_line":"            region_name\u003dcfg.CONF.nova.region_name,"},{"line_number":166,"context_line":"            endpoint_type\u003dcfg.CONF.nova.endpoint_type,"},{"line_number":167,"context_line":"            extensions\u003dextensions)"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"        return p_client, n_client"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_ee24a6b3","line":166,"in_reply_to":"ba5201f7_00f2d999","updated":"2017-01-10 01:30:19.000000000","message":"No. We need to keep two conversations. One with the placement API and one with the Nova API. This client (n_client) is for the latter and allows us to create and delete host aggregates that are associated with a resource provider using the placement client (p_client)","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"5f3fbb9afdc91d0e08b3139c5ccf59645d2f0bbb","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def _send_notifications(self, batched_events):"},{"line_number":172,"context_line":"        for event in batched_events:"},{"line_number":173,"context_line":"            event.method(event)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _notify_subnet_created(self, resource, event, trigger, context,"},{"line_number":176,"context_line":"                               subnet):"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_347c83b4","line":173,"range":{"start_line":173,"start_character":18,"end_line":173,"end_character":24},"updated":"2017-01-06 19:01:15.000000000","message":"This is just a question since I might have misunderstood it, and thus completely wrong.\n\nI thought that the reason to batch is to reduce the communications and send batched requests in a SINGLE message to the server.  In _send_notifications, however, each \u0027method\u0027 seems to send one or more http calls to the server).","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def _send_notifications(self, batched_events):"},{"line_number":172,"context_line":"        for event in batched_events:"},{"line_number":173,"context_line":"            event.method(event)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _notify_subnet_created(self, resource, event, trigger, context,"},{"line_number":176,"context_line":"                               subnet):"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_75987e6b","line":173,"range":{"start_line":173,"start_character":18,"end_line":173,"end_character":24},"in_reply_to":"ba5201f7_347c83b4","updated":"2017-01-10 01:30:19.000000000","message":"There is a specialized call, \"Create external events\", in the Nova API (http://developer.openstack.org/api-ref/compute/?expanded\u003drun-events-detail#create-external-events-os-server-external-events) that is leveraged by Neutron here https://github.com/openstack/neutron/blob/master/neutron/notifiers/nova.py#L250. It\u0027s very specific purpose is for Neutron to notify Nova that a network or a port (VIF) associated with a VM has changed.\n\nThe Nova notifier (https://github.com/openstack/neutron/blob/master/neutron/notifiers/nova.py) minimizes the overhead of using the \"Create external events\" call in two ways:\n\n1) The API call itself allows to send many events\n2) Calls are batched together and sent to Nova from a separate thread periodically: https://github.com/openstack/neutron/blob/master/neutron/notifiers/batch_notifier.py#L23\n\nIn the case of what this patchset needs to do, we don\u0027t have a set of specialized calls equivalent to \"Create external events\". In this patchset, we actually dialog with two API\u0027s: Nova and Placement. And some calls need the result from a previous one. So we don\u0027t have access to the mechanism in point 1 above. However, we are using the batching approach described in point 2. This should help us to minimize the performance impact.","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":6685,"name":"Baodong (Robert) Li","email":"baoli@cisco.com","username":"baoli"},"change_message_id":"29193087df6d9aa50b9170c152389165d146ef0f","unresolved":false,"context_lines":[{"line_number":170,"context_line":""},{"line_number":171,"context_line":"    def _send_notifications(self, batched_events):"},{"line_number":172,"context_line":"        for event in batched_events:"},{"line_number":173,"context_line":"            event.method(event)"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"    def _notify_subnet_created(self, resource, event, trigger, context,"},{"line_number":176,"context_line":"                               subnet):"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_f7dff209","line":173,"range":{"start_line":173,"start_character":18,"end_line":173,"end_character":24},"in_reply_to":"ba5201f7_75987e6b","updated":"2017-01-10 14:38:56.000000000","message":"I see. I was familiar with the VIF notification mechanism, in which case multiple events are queued and sent as a single message.\nIn this case,  _send_notifications() will be called by https://github.com/openstack/neutron/blob/master/neutron/notifiers/batch_notifier.py#L66 with batched_events. And the for loop at line 172 will iterate the events, and make individual call to the corresponding \u0027method\u0027 (at line 173). Looks like to me that the \u0027method\u0027 is just delayed to be called. In other words, it could have been called at the time being queued. But instead, it is queued, and called later.","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d947b3a8078d489c5456169b326227fbaa0d1a1b","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def _notify_subnet_created(self, resource, event, trigger, context,"},{"line_number":176,"context_line":"                               subnet):"},{"line_number":177,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027)"},{"line_number":178,"context_line":"        if not segment_id or subnet[\u0027ip_version\u0027] !\u003d 4:"},{"line_number":179,"context_line":"            return"},{"line_number":180,"context_line":"        total, reserved \u003d self._calculate_inventory_total_and_reserved(subnet)"},{"line_number":181,"context_line":"        if total:"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_c0b37196","line":178,"range":{"start_line":178,"start_character":53,"end_line":178,"end_character":54},"updated":"2017-01-06 21:37:34.000000000","message":"nit: constants.IP_VERSION_4","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":175,"context_line":"    def _notify_subnet_created(self, resource, event, trigger, context,"},{"line_number":176,"context_line":"                               subnet):"},{"line_number":177,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027)"},{"line_number":178,"context_line":"        if not segment_id or subnet[\u0027ip_version\u0027] !\u003d 4:"},{"line_number":179,"context_line":"            return"},{"line_number":180,"context_line":"        total, reserved \u003d self._calculate_inventory_total_and_reserved(subnet)"},{"line_number":181,"context_line":"        if total:"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_2ec94ead","line":178,"range":{"start_line":178,"start_character":53,"end_line":178,"end_character":54},"in_reply_to":"ba5201f7_c0b37196","updated":"2017-01-10 01:30:19.000000000","message":"Done","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d947b3a8078d489c5456169b326227fbaa0d1a1b","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    def _notify_subnet_updated(self, resource, event, trigger, context,"},{"line_number":248,"context_line":"                               subnet, original_subnet):"},{"line_number":249,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027)"},{"line_number":250,"context_line":"        if not segment_id or subnet[\u0027ip_version\u0027] !\u003d 4:"},{"line_number":251,"context_line":"            return"},{"line_number":252,"context_line":"        filters \u003d {\u0027segment_id\u0027: [segment_id], \u0027ip_version\u0027: [4]}"},{"line_number":253,"context_line":"        if not subnet[\u0027allocation_pools\u0027]:"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_00aad918","line":250,"range":{"start_line":250,"start_character":53,"end_line":250,"end_character":54},"updated":"2017-01-06 21:37:34.000000000","message":"nit: constants.IP_VERSION_4","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    def _notify_subnet_updated(self, resource, event, trigger, context,"},{"line_number":248,"context_line":"                               subnet, original_subnet):"},{"line_number":249,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027)"},{"line_number":250,"context_line":"        if not segment_id or subnet[\u0027ip_version\u0027] !\u003d 4:"},{"line_number":251,"context_line":"            return"},{"line_number":252,"context_line":"        filters \u003d {\u0027segment_id\u0027: [segment_id], \u0027ip_version\u0027: [4]}"},{"line_number":253,"context_line":"        if not subnet[\u0027allocation_pools\u0027]:"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_2e25ce5b","line":250,"range":{"start_line":250,"start_character":53,"end_line":250,"end_character":54},"in_reply_to":"ba5201f7_00aad918","updated":"2017-01-10 01:30:19.000000000","message":"Done","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d947b3a8078d489c5456169b326227fbaa0d1a1b","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    def _notify_subnet_deleted(self, resource, event, trigger, context,"},{"line_number":279,"context_line":"                               subnet):"},{"line_number":280,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027)"},{"line_number":281,"context_line":"        if not segment_id or subnet[\u0027ip_version\u0027] !\u003d 4:"},{"line_number":282,"context_line":"            return"},{"line_number":283,"context_line":"        total, reserved \u003d self._calculate_inventory_total_and_reserved(subnet)"},{"line_number":284,"context_line":"        if total:"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_20a51d46","line":281,"range":{"start_line":281,"start_character":53,"end_line":281,"end_character":54},"updated":"2017-01-06 21:37:34.000000000","message":"nit: constants.IP_VERSION_4","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":278,"context_line":"    def _notify_subnet_deleted(self, resource, event, trigger, context,"},{"line_number":279,"context_line":"                               subnet):"},{"line_number":280,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027)"},{"line_number":281,"context_line":"        if not segment_id or subnet[\u0027ip_version\u0027] !\u003d 4:"},{"line_number":282,"context_line":"            return"},{"line_number":283,"context_line":"        total, reserved \u003d self._calculate_inventory_total_and_reserved(subnet)"},{"line_number":284,"context_line":"        if total:"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_6e1fd609","line":281,"range":{"start_line":281,"start_character":53,"end_line":281,"end_character":54},"in_reply_to":"ba5201f7_20a51d46","updated":"2017-01-10 01:30:19.000000000","message":"Done","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d947b3a8078d489c5456169b326227fbaa0d1a1b","unresolved":false,"context_lines":[{"line_number":361,"context_line":"            port_ipv4_subnets_number \u003d 0"},{"line_number":362,"context_line":"        update \u003d port_ipv4_subnets_number - original_port_ipv4_subnets_number"},{"line_number":363,"context_line":"        if update:"},{"line_number":364,"context_line":"            self._update_nova_inventory_on_port_event(update, segment_id)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    def _get_ipv4_subnets_number_and_segment_id(self, port, context):"},{"line_number":367,"context_line":"        ipv4_subnet_ids \u003d self._get_ipv4_subnet_ids(port)"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_1bec0af2","line":364,"updated":"2017-01-06 21:37:34.000000000","message":"I\u0027m just trying to understand this.  Can \u0027update\u0027 be positive or negative?  If we hit L361 but not L359 it could be but would that happen?  Noticed based on my delete\u003dTrue comment below.","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":361,"context_line":"            port_ipv4_subnets_number \u003d 0"},{"line_number":362,"context_line":"        update \u003d port_ipv4_subnets_number - original_port_ipv4_subnets_number"},{"line_number":363,"context_line":"        if update:"},{"line_number":364,"context_line":"            self._update_nova_inventory_on_port_event(update, segment_id)"},{"line_number":365,"context_line":""},{"line_number":366,"context_line":"    def _get_ipv4_subnets_number_and_segment_id(self, port, context):"},{"line_number":367,"context_line":"        ipv4_subnet_ids \u003d self._get_ipv4_subnet_ids(port)"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_40873a12","line":364,"in_reply_to":"ba5201f7_1bec0af2","updated":"2017-01-10 01:30:19.000000000","message":"Yes, update can be negative. The easy way to explain it is that when you update the port, you could be updating it with less ipv4 fixed ips. So yeah, strictly we don\u0027t need the delete\u003dFalse argument below and if I remove it, I don\u0027t see much value in the method at line 391. I\u0027ll just call the batch_notifier from here","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d947b3a8078d489c5456169b326227fbaa0d1a1b","unresolved":false,"context_lines":[{"line_number":384,"context_line":"    def _get_ipv4_subnet_ids(self, port):"},{"line_number":385,"context_line":"        ipv4_subnet_ids \u003d []"},{"line_number":386,"context_line":"        for ip in port.get(\u0027fixed_ips\u0027, []):"},{"line_number":387,"context_line":"            if netaddr.IPAddress(ip[\u0027ip_address\u0027]).version \u003d\u003d 4:"},{"line_number":388,"context_line":"                ipv4_subnet_ids.append(ip[\u0027subnet_id\u0027])"},{"line_number":389,"context_line":"        return ipv4_subnet_ids"},{"line_number":390,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_a06f4dfa","line":387,"range":{"start_line":387,"start_character":62,"end_line":387,"end_character":63},"updated":"2017-01-06 21:37:34.000000000","message":"nit: constants.IP_VERSION_4","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":384,"context_line":"    def _get_ipv4_subnet_ids(self, port):"},{"line_number":385,"context_line":"        ipv4_subnet_ids \u003d []"},{"line_number":386,"context_line":"        for ip in port.get(\u0027fixed_ips\u0027, []):"},{"line_number":387,"context_line":"            if netaddr.IPAddress(ip[\u0027ip_address\u0027]).version \u003d\u003d 4:"},{"line_number":388,"context_line":"                ipv4_subnet_ids.append(ip[\u0027subnet_id\u0027])"},{"line_number":389,"context_line":"        return ipv4_subnet_ids"},{"line_number":390,"context_line":""}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_4eb852e6","line":387,"range":{"start_line":387,"start_character":62,"end_line":387,"end_character":63},"in_reply_to":"ba5201f7_a06f4dfa","updated":"2017-01-10 01:30:19.000000000","message":"Done","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"d947b3a8078d489c5456169b326227fbaa0d1a1b","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        return ipv4_subnet_ids"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def _update_nova_inventory_on_port_event(self, num_fixed_ips, segment_id,"},{"line_number":392,"context_line":"                                             delete\u003dFalse):"},{"line_number":393,"context_line":"        if delete:"},{"line_number":394,"context_line":"            num_fixed_ips \u003d -num_fixed_ips"},{"line_number":395,"context_line":"        self.batch_notifier.queue_event(Event(self._update_nova_inventory,"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_db936259","line":392,"range":{"start_line":392,"start_character":45,"end_line":392,"end_character":57},"updated":"2017-01-06 21:37:34.000000000","message":"nit: could just as easily have caller pass negative value on L338 since it\u0027s the only place delete\u003dTrue could be passed.","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"725ce082a16a27edba3acbe4729b5266a82cba25","unresolved":false,"context_lines":[{"line_number":389,"context_line":"        return ipv4_subnet_ids"},{"line_number":390,"context_line":""},{"line_number":391,"context_line":"    def _update_nova_inventory_on_port_event(self, num_fixed_ips, segment_id,"},{"line_number":392,"context_line":"                                             delete\u003dFalse):"},{"line_number":393,"context_line":"        if delete:"},{"line_number":394,"context_line":"            num_fixed_ips \u003d -num_fixed_ips"},{"line_number":395,"context_line":"        self.batch_notifier.queue_event(Event(self._update_nova_inventory,"}],"source_content_type":"text/x-python","patch_set":34,"id":"ba5201f7_8ed79abe","line":392,"range":{"start_line":392,"start_character":45,"end_line":392,"end_character":57},"in_reply_to":"ba5201f7_db936259","updated":"2017-01-10 01:30:19.000000000","message":"Yes. You are right. Removing the method altogether. I can just call the batch notifier directly above","commit_id":"000aaedb1f9390463f67859fc09f12c7b31d02c0"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"4a25c3133efa0ac76633d7bad474c9491042ab77","unresolved":false,"context_lines":[{"line_number":290,"context_line":"    def _get_aggregate_id(self, segment_id):"},{"line_number":291,"context_line":"        aggregate_uuid \u003d self.p_client.list_aggregates("},{"line_number":292,"context_line":"            segment_id)[\u0027aggregates\u0027][0]"},{"line_number":293,"context_line":"        aggregates \u003d self.n_client.aggregates.list()"},{"line_number":294,"context_line":"        for aggregate in aggregates:"},{"line_number":295,"context_line":"            if aggregate.uuid \u003d\u003d aggregate_uuid:"},{"line_number":296,"context_line":"                return aggregate.id"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a57fde8_8ad14cfe","line":293,"updated":"2017-01-12 16:04:49.000000000","message":"Can you specify a uuid in the list() call ?  or show() ?  Just to save from iterating all the items returned.\n\nI\u0027m not saying you have to change it :)","commit_id":"05cc2c6dea2456fb5ba966e0c6c04473f1c7e7d1"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"f1be1eba6020afd09b748d6cbfa1858903433c3c","unresolved":false,"context_lines":[{"line_number":290,"context_line":"    def _get_aggregate_id(self, segment_id):"},{"line_number":291,"context_line":"        aggregate_uuid \u003d self.p_client.list_aggregates("},{"line_number":292,"context_line":"            segment_id)[\u0027aggregates\u0027][0]"},{"line_number":293,"context_line":"        aggregates \u003d self.n_client.aggregates.list()"},{"line_number":294,"context_line":"        for aggregate in aggregates:"},{"line_number":295,"context_line":"            if aggregate.uuid \u003d\u003d aggregate_uuid:"},{"line_number":296,"context_line":"                return aggregate.id"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a3c09a3_2007791d","line":293,"in_reply_to":"9a57fde8_8ad14cfe","updated":"2017-01-13 23:30:35.000000000","message":"I tried when writing this method. Problem is that, from the user perspective, aggregates in the Placement API side are referred to by uuid but on the Nova API they continue being referred to by their integer id. The only thing that was added in the Nova API was that in the responses they now also include the uuid. Here\u0027s a little experiment I ran for you: http://paste.openstack.org/show/594908/","commit_id":"05cc2c6dea2456fb5ba966e0c6c04473f1c7e7d1"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"cef4f4a0252b73764a11f0ae9fc5620cb22db897","unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def _send_notifications(self, batched_events):"},{"line_number":170,"context_line":"        for event in batched_events:"},{"line_number":171,"context_line":"            event.method(event)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def _notify_subnet_created(self, resource, event, trigger, context,"},{"line_number":174,"context_line":"                               subnet):"}],"source_content_type":"text/x-python","patch_set":37,"id":"7a3c09a3_82cdbc5f","line":171,"updated":"2017-01-18 23:18:20.000000000","message":"Do we have logic to handle the case where the placement API doesn\u0027t exist at all? Say a deployer upgrades Neutron but waits to upgrade Nova for a bit. The placement API wouldn\u0027t exist in that case so would we be throwing exceptions on every notification?","commit_id":"7df351516dce7c3fd2766184979143ca081dd279"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"ad927594499f42e71497b7935402e96a823df891","unresolved":false,"context_lines":[{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    def _send_notifications(self, batched_events):"},{"line_number":170,"context_line":"        for event in batched_events:"},{"line_number":171,"context_line":"            event.method(event)"},{"line_number":172,"context_line":""},{"line_number":173,"context_line":"    def _notify_subnet_created(self, resource, event, trigger, context,"},{"line_number":174,"context_line":"                               subnet):"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_05a0ca42","line":171,"in_reply_to":"7a3c09a3_82cdbc5f","updated":"2017-01-20 00:34:43.000000000","message":"Done","commit_id":"7df351516dce7c3fd2766184979143ca081dd279"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"cef4f4a0252b73764a11f0ae9fc5620cb22db897","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                return"},{"line_number":207,"context_line":"            except n_exc.PlacementInventoryUpdateConflict:"},{"line_number":208,"context_line":"                LOG.info(_LI(\u0027Re-trying to update Nova IPv4 inventory for \u0027"},{"line_number":209,"context_line":"                             \u0027routed network segment: %s\u0027), event.segment_id)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def _create_nova_inventory(self, segment_id, total, reserved,"},{"line_number":212,"context_line":"                               segment_host_mappings):"}],"source_content_type":"text/x-python","patch_set":37,"id":"7a3c09a3_a2dab815","line":209,"updated":"2017-01-18 23:18:20.000000000","message":"Shouldn\u0027t we have an error log at the end here if the retries are exceeded? Also, if retries are expected, I think we should downgrade the retrying message to debug.","commit_id":"7df351516dce7c3fd2766184979143ca081dd279"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"a53436d4424f0c96ae55845a03997c5dbac21548","unresolved":false,"context_lines":[{"line_number":206,"context_line":"                return"},{"line_number":207,"context_line":"            except n_exc.PlacementInventoryUpdateConflict:"},{"line_number":208,"context_line":"                LOG.info(_LI(\u0027Re-trying to update Nova IPv4 inventory for \u0027"},{"line_number":209,"context_line":"                             \u0027routed network segment: %s\u0027), event.segment_id)"},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"    def _create_nova_inventory(self, segment_id, total, reserved,"},{"line_number":212,"context_line":"                               segment_host_mappings):"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_e8dd5c71","line":209,"in_reply_to":"7a3c09a3_a2dab815","updated":"2017-01-20 00:34:14.000000000","message":"Ahhhh! I misunderstood your feedback in a previous review and removed the error log that I had here: https://review.openstack.org/#/c/358658/17/neutron/services/segments/plugin.py@185. Now I know what you meant ;-)\n\nDone!","commit_id":"7df351516dce7c3fd2766184979143ca081dd279"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"cef4f4a0252b73764a11f0ae9fc5620cb22db897","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        return total, reserved"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def _notify_subnet_updated(self, resource, event, trigger, context,"},{"line_number":242,"context_line":"                               subnet, original_subnet):"},{"line_number":243,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027)"},{"line_number":244,"context_line":"        if not segment_id or subnet[\u0027ip_version\u0027] !\u003d constants.IP_VERSION_4:"},{"line_number":245,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":37,"id":"7a3c09a3_c2d7c4eb","line":242,"updated":"2017-01-18 23:18:20.000000000","message":"All of these methods that are subscribed to callbacks should accept a **kwargs as well in case we add a new argument to the notifier in the future. Otherwise this will always break when we add new stuff.","commit_id":"7df351516dce7c3fd2766184979143ca081dd279"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"a53436d4424f0c96ae55845a03997c5dbac21548","unresolved":false,"context_lines":[{"line_number":239,"context_line":"        return total, reserved"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"    def _notify_subnet_updated(self, resource, event, trigger, context,"},{"line_number":242,"context_line":"                               subnet, original_subnet):"},{"line_number":243,"context_line":"        segment_id \u003d subnet.get(\u0027segment_id\u0027)"},{"line_number":244,"context_line":"        if not segment_id or subnet[\u0027ip_version\u0027] !\u003d constants.IP_VERSION_4:"},{"line_number":245,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":37,"id":"5a3905b3_547530f7","line":242,"in_reply_to":"7a3c09a3_c2d7c4eb","updated":"2017-01-20 00:34:14.000000000","message":"Done","commit_id":"7df351516dce7c3fd2766184979143ca081dd279"},{"author":{"_account_id":7787,"name":"Kevin Benton","email":"kevin@benton.pub","username":"blak111"},"change_message_id":"a0eeee3da4900b53a9ec76b815a92bd619af62e1","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            try:"},{"line_number":172,"context_line":"                event.method(event)"},{"line_number":173,"context_line":"            except n_exc.PlacementEndpointNotFound:"},{"line_number":174,"context_line":"                LOG.info(_LI(\u0027Placement API was not found when trying to \u0027"},{"line_number":175,"context_line":"                             \u0027update routed networks IPv4 inventories\u0027))"},{"line_number":176,"context_line":"                return"},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"5a3905b3_a5029609","line":174,"updated":"2017-01-20 00:40:05.000000000","message":"One more nit: we should probably either downgrade this to debug or only log it once. Otherwise the logs will be filled with these.","commit_id":"d961a99bc44d7aa9048a23e9d4c96e0895608fb4"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"2aa9c648cdfbfde14711029271ddbd07a2387b1d","unresolved":false,"context_lines":[{"line_number":171,"context_line":"            try:"},{"line_number":172,"context_line":"                event.method(event)"},{"line_number":173,"context_line":"            except n_exc.PlacementEndpointNotFound:"},{"line_number":174,"context_line":"                LOG.info(_LI(\u0027Placement API was not found when trying to \u0027"},{"line_number":175,"context_line":"                             \u0027update routed networks IPv4 inventories\u0027))"},{"line_number":176,"context_line":"                return"},{"line_number":177,"context_line":""}],"source_content_type":"text/x-python","patch_set":38,"id":"5a3905b3_c1a3e94d","line":174,"in_reply_to":"5a3905b3_a5029609","updated":"2017-01-20 21:36:24.000000000","message":"Good point","commit_id":"d961a99bc44d7aa9048a23e9d4c96e0895608fb4"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"946b2e2e64eb89934413759f9ab8de1503f19626","unresolved":false,"context_lines":[{"line_number":334,"context_line":""},{"line_number":335,"context_line":"            try:"},{"line_number":336,"context_line":"                self.n_client.aggregates.add_host(aggregate_id, event.host)"},{"line_number":337,"context_line":"            except nova_exc.Conflict:"},{"line_number":338,"context_line":"                LOG.info(_LI(\u0027Host %(host)s already exists in aggregate for \u0027"},{"line_number":339,"context_line":"                             \u0027routed network segment %(segment_id)s\u0027),"},{"line_number":340,"context_line":"                         {\u0027host\u0027: event.host, \u0027segment_id\u0027: segment_id})"}],"source_content_type":"text/x-python","patch_set":39,"id":"5a3905b3_00efa1b0","line":337,"updated":"2017-01-20 21:39:18.000000000","message":"Dear reviewers:\n\nIn PS39, besides addressing Kevin\u0027s comment, I added the handling of this exception for the case where the Neutron server is restarted and inventories / aggregates already exist for routed networks segments","commit_id":"5cbdd10b2160d0838cf677eccdc98f7e0e300555"}],"releasenotes/notes/add-placement-api-configuration-options-f1611d0909bf6166.yaml":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"6f0d9c34b4e67cbcb5be25aa94c92d7dc2074197","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Add configuration options to enable the segments plugin to use the the "},{"line_number":4,"context_line":"    placement ReST API. This API enables the segments plugin to influence"},{"line_number":5,"context_line":"    the placement of instances based on the availability of IPv4 addresses"},{"line_number":6,"context_line":"    in routed networks."}],"source_content_type":"text/x-yaml","patch_set":15,"id":"9a629dbe_1b39bba4","line":3,"updated":"2016-11-09 16:42:32.000000000","message":"double the","commit_id":"d64fd0688c54d4ef08b042a0c3574473e6756b06"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"870c1f49bdd2cb79166f86bc9f2e703086b7e4ba","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Add configuration options to enable the segments plugin to use the the "},{"line_number":4,"context_line":"    placement ReST API. This API enables the segments plugin to influence"},{"line_number":5,"context_line":"    the placement of instances based on the availability of IPv4 addresses"},{"line_number":6,"context_line":"    in routed networks."}],"source_content_type":"text/x-yaml","patch_set":20,"id":"3a71b18c_e00efd8a","line":3,"range":{"start_line":3,"start_character":71,"end_line":3,"end_character":74},"updated":"2016-12-11 13:19:17.000000000","message":"please remove the extra the and the whitespace","commit_id":"1ac67566aa975341249e481ea66b9048b471f9dd"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"c61b4148317233da6434e0368aa5c4196ff93687","unresolved":false,"context_lines":[{"line_number":1,"context_line":"---"},{"line_number":2,"context_line":"prelude: \u003e"},{"line_number":3,"context_line":"    Add configuration options to enable the segments plugin to use the the "},{"line_number":4,"context_line":"    placement ReST API. This API enables the segments plugin to influence"},{"line_number":5,"context_line":"    the placement of instances based on the availability of IPv4 addresses"},{"line_number":6,"context_line":"    in routed networks."}],"source_content_type":"text/x-yaml","patch_set":20,"id":"3a71b18c_0225b907","line":3,"range":{"start_line":3,"start_character":71,"end_line":3,"end_character":74},"in_reply_to":"3a71b18c_e00efd8a","updated":"2016-12-12 01:27:16.000000000","message":"Done","commit_id":"1ac67566aa975341249e481ea66b9048b471f9dd"}]}
