)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f57e41dad090be939e352659c53a492376d8ce47","unresolved":false,"context_lines":[{"line_number":12,"context_line":"provider modeling in later patches."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ic032e8eb9f99756537848c01af20e1c533a045ee"},{"line_number":15,"context_line":"Co-Authored-By: Stephen Finucane \u003csfinucan@redhat.com\u003e"},{"line_number":16,"context_line":"blueprint: nested-resource-providers"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"7f515b1d_826e76fd","line":15,"updated":"2017-10-01 14:21:21.000000000","message":"Either this should be changed to jay, or authorship on the patch should be reset. Both authors are Stephen.","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f989739d6cc0737d537d97f6109d2cac0731ca28","unresolved":false,"context_lines":[{"line_number":12,"context_line":"provider modeling in later patches."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ic032e8eb9f99756537848c01af20e1c533a045ee"},{"line_number":15,"context_line":"Co-Authored-By: Stephen Finucane \u003csfinucan@redhat.com\u003e"},{"line_number":16,"context_line":"blueprint: nested-resource-providers"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":19,"id":"7f515b1d_07736d4f","line":15,"in_reply_to":"7f515b1d_826e76fd","updated":"2017-10-04 19:26:55.000000000","message":"Yeah, it\u0027s the whole rebase and change author bug...","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"95d875e97698c5778f7bbba71027d02cbc32c478","unresolved":false,"context_lines":[{"line_number":12,"context_line":"provider modeling in later patches."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"Change-Id: Ic032e8eb9f99756537848c01af20e1c533a045ee"},{"line_number":15,"context_line":"Co-Authored-By: Stephen Finucane \u003csfinucan@redhat.com\u003e"},{"line_number":16,"context_line":"blueprint: nested-resource-providers"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":22,"id":"5f4e5783_1e391ca3","line":15,"updated":"2017-10-13 17:15:16.000000000","message":"This duplicates the existing author if that matters to any of the involved parties.","commit_id":"5f4c3eeb926f361dd42ab3a3c8c641dbd63167f5"}],"nova/compute/provider_tree.py":[{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"fe4d58e7b8c3ae3545e9f6ada4d5019263722dfc","unresolved":false,"context_lines":[{"line_number":101,"context_line":"        provider generation to set the provider to. The method returns whether"},{"line_number":102,"context_line":"        the inventory has changed."},{"line_number":103,"context_line":"        \"\"\""},{"line_number":104,"context_line":"        if generation !\u003d self.generation:"},{"line_number":105,"context_line":"            msg_args \u003d {"},{"line_number":106,"context_line":"                \u0027rp_uuid\u0027: self.uuid,"},{"line_number":107,"context_line":"                \u0027old\u0027: self.generation,"}],"source_content_type":"text/x-python","patch_set":22,"id":"5f4e5783_09b404d0","line":104,"updated":"2017-10-17 08:47:07.000000000","message":"If the generation isn\u0027t changed, that means the inventory isn\u0027t changed also?","commit_id":"5f4c3eeb926f361dd42ab3a3c8c641dbd63167f5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        inventory records at all."},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        :raises: ValueError if a provider with uuid was not found in the tree."},{"line_number":212,"context_line":"        :param name_or_uuid: Either name or UUID of the resource provider to"},{"line_number":213,"context_line":"                             update inventory for."},{"line_number":214,"context_line":"        \"\"\""},{"line_number":215,"context_line":"        with self.lock:"},{"line_number":216,"context_line":"            p \u003d self._find_with_lock(name_or_uuid)"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_58eded23","line":213,"range":{"start_line":212,"start_character":74,"end_line":213,"end_character":50},"updated":"2017-10-18 09:52:49.000000000","message":"I guess it is a copy-paste error as this function does not update the inventory","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0a4f2f267ed9e66ce6c4e45322da71d1ad814e23","unresolved":false,"context_lines":[{"line_number":209,"context_line":"        inventory records at all."},{"line_number":210,"context_line":""},{"line_number":211,"context_line":"        :raises: ValueError if a provider with uuid was not found in the tree."},{"line_number":212,"context_line":"        :param name_or_uuid: Either name or UUID of the resource provider to"},{"line_number":213,"context_line":"                             update inventory for."},{"line_number":214,"context_line":"        \"\"\""},{"line_number":215,"context_line":"        with self.lock:"},{"line_number":216,"context_line":"            p \u003d self._find_with_lock(name_or_uuid)"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_8edad114","line":213,"range":{"start_line":212,"start_character":74,"end_line":213,"end_character":50},"in_reply_to":"3f4b6375_58eded23","updated":"2017-10-19 18:14:50.000000000","message":"Done","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"dd28f2c47b60d751fb2e7a3fa4393a5b52870db8","unresolved":false,"context_lines":[{"line_number":298,"context_line":"            name \u003d name or uuid"},{"line_number":299,"context_line":"            rp \u003d self._create_resource_provider(uuid, name)"},{"line_number":300,"context_line":"            if rp is None:"},{"line_number":301,"context_line":"                return"},{"line_number":302,"context_line":"        self._resource_providers[uuid] \u003d rp"},{"line_number":303,"context_line":"        return rp"},{"line_number":304,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"7a3c09a3_840d5d40","side":"PARENT","line":301,"updated":"2017-01-16 18:52:22.000000000","message":"Since you\u0027re nearby changing all the other return values, could you correct this one to be explicit about it\u0027s None-ness?\n\nOr if not now, we can do that somewhere else, just noticed it now.","commit_id":"3f48548e6adbe2ddc21ff2fa0651aaef487343fc"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"dd28f2c47b60d751fb2e7a3fa4393a5b52870db8","unresolved":false,"context_lines":[{"line_number":280,"context_line":"        the placement API for the supplied UUID, passing in a name for the"},{"line_number":281,"context_line":"        resource provider."},{"line_number":282,"context_line":""},{"line_number":283,"context_line":"        The found or created, an object representing the provider (and"},{"line_number":284,"context_line":"        potential child providers) is returned from this method. If the"},{"line_number":285,"context_line":"        resource provider for the supplied uuid was not found and the resource"},{"line_number":286,"context_line":"        provider record could not be created in the placement API, we return"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a3c09a3_c459255c","line":283,"updated":"2017-01-16 18:52:22.000000000","message":"grammar flub here\n\nThe found or created object representing...\n\n?","commit_id":"8d43d924bc90f478d1028d6f6ea2e45dba58ab88"},{"author":{"_account_id":16688,"name":"Rodolfo Alonso","email":"ralonsoh@redhat.com","username":"rodolfo-alonso-hernandez"},"change_message_id":"7453b19c329304c1ba848cee74ba46788e2f4f11","unresolved":false,"context_lines":[{"line_number":620,"context_line":"        \"\"\"Deletes all inventory records for a resource provider with the"},{"line_number":621,"context_line":"        supplied UUID."},{"line_number":622,"context_line":"        \"\"\""},{"line_number":623,"context_line":"        if not self._provider_tree.has_inventory_changed(rp_uuid, {}):"},{"line_number":624,"context_line":"            return"},{"line_number":625,"context_line":""},{"line_number":626,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"}],"source_content_type":"text/x-python","patch_set":13,"id":"df140735_64c45841","line":623,"range":{"start_line":623,"start_character":8,"end_line":623,"end_character":70},"updated":"2017-06-07 14:19:09.000000000","message":"Why do you need to make this test? If the rp_uuid doesn\u0027t exist, this check will fail; if rp!\u003d{}, will return True and will continue in L626. I\u0027m missing something...","commit_id":"955f6b847ce6eece5bfa352228da37de1b8ab12a"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"002f2b1ac35aa236671eafa22639ab3771d79b14","unresolved":false,"context_lines":[{"line_number":416,"context_line":"        the placement API for the supplied UUID, passing in a name for the"},{"line_number":417,"context_line":"        resource provider."},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"        The found or created, an object representing the provider (and"},{"line_number":420,"context_line":"        potential child providers) is returned from this method. If the"},{"line_number":421,"context_line":"        resource provider for the supplied uuid was not found and the resource"},{"line_number":422,"context_line":"        provider record could not be created in the placement API, we return"}],"source_content_type":"text/x-python","patch_set":14,"id":"7f231b9d_179b8f72","line":419,"updated":"2017-06-12 12:07:50.000000000","message":"If found...","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6d7383a3b5ee9133a3a9ba7e87309a17350c7f4f","unresolved":false,"context_lines":[{"line_number":416,"context_line":"        the placement API for the supplied UUID, passing in a name for the"},{"line_number":417,"context_line":"        resource provider."},{"line_number":418,"context_line":""},{"line_number":419,"context_line":"        The found or created, an object representing the provider (and"},{"line_number":420,"context_line":"        potential child providers) is returned from this method. If the"},{"line_number":421,"context_line":"        resource provider for the supplied uuid was not found and the resource"},{"line_number":422,"context_line":"        provider record could not be created in the placement API, we return"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f201791_c8806949","line":419,"in_reply_to":"7f231b9d_179b8f72","updated":"2017-06-26 10:42:31.000000000","message":"Done","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"002f2b1ac35aa236671eafa22639ab3771d79b14","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        provider record could not be created in the placement API, we return"},{"line_number":423,"context_line":"        None."},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"        If this method returns a non-None value, callers are assured that both"},{"line_number":426,"context_line":"        the placement API contains a record of the provider and the local tree"},{"line_number":427,"context_line":"        of resource provider information contains a record of the provider."},{"line_number":428,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"7f231b9d_777d231b","line":425,"updated":"2017-06-12 12:07:50.000000000","message":"both that\n\n(only if you really really really care)","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6d7383a3b5ee9133a3a9ba7e87309a17350c7f4f","unresolved":false,"context_lines":[{"line_number":422,"context_line":"        provider record could not be created in the placement API, we return"},{"line_number":423,"context_line":"        None."},{"line_number":424,"context_line":""},{"line_number":425,"context_line":"        If this method returns a non-None value, callers are assured that both"},{"line_number":426,"context_line":"        the placement API contains a record of the provider and the local tree"},{"line_number":427,"context_line":"        of resource provider information contains a record of the provider."},{"line_number":428,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"5f201791_08f0a1fd","line":425,"in_reply_to":"7f231b9d_777d231b","updated":"2017-06-26 10:42:31.000000000","message":"_I_ do :)","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"002f2b1ac35aa236671eafa22639ab3771d79b14","unresolved":false,"context_lines":[{"line_number":481,"context_line":"        curr \u003d self._get_inventory(rp_uuid)"},{"line_number":482,"context_line":""},{"line_number":483,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":484,"context_line":"        if cur_gen:"},{"line_number":485,"context_line":"            curr_inv \u003d curr.get(\u0027inventories\u0027, {})"},{"line_number":486,"context_line":"            self._provider_tree.update_inventory(rp_uuid, curr_inv, cur_gen)"},{"line_number":487,"context_line":"        return curr"}],"source_content_type":"text/x-python","patch_set":14,"id":"7f231b9d_57d7c7c0","line":484,"updated":"2017-06-12 12:07:50.000000000","message":"Above the docstring says update cache if \"generation of the resource provider is not the same as the generation\" but no such comparison is in this new code (it was in the old). That comparison has moved to update_inventory, but it\u0027s not clear.\n\nI reckon the right change would be to say: \"attempt to update inventory if any exists, otherwise return empty inventories\" or something along those lines?","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6d7383a3b5ee9133a3a9ba7e87309a17350c7f4f","unresolved":false,"context_lines":[{"line_number":481,"context_line":"        curr \u003d self._get_inventory(rp_uuid)"},{"line_number":482,"context_line":""},{"line_number":483,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":484,"context_line":"        if cur_gen:"},{"line_number":485,"context_line":"            curr_inv \u003d curr.get(\u0027inventories\u0027, {})"},{"line_number":486,"context_line":"            self._provider_tree.update_inventory(rp_uuid, curr_inv, cur_gen)"},{"line_number":487,"context_line":"        return curr"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f201791_88c4b192","line":484,"in_reply_to":"7f231b9d_57d7c7c0","updated":"2017-06-26 10:42:31.000000000","message":"Done","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"002f2b1ac35aa236671eafa22639ab3771d79b14","unresolved":false,"context_lines":[{"line_number":496,"context_line":"        \"\"\""},{"line_number":497,"context_line":"        # TODO(jaypipes): Should we really be calling the placement API to get"},{"line_number":498,"context_line":"        # the current inventory for every resource provider each and every time"},{"line_number":499,"context_line":"        # update_resource_stats() is called? :("},{"line_number":500,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":501,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":502,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"7f231b9d_17fa6f41","line":499,"updated":"2017-06-12 12:07:50.000000000","message":"No but as you say it is something we said we\u0027d figure out later. Adding a proper todo is ++","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"002f2b1ac35aa236671eafa22639ab3771d79b14","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        # the current inventory for every resource provider each and every time"},{"line_number":499,"context_line":"        # update_resource_stats() is called? :("},{"line_number":500,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":501,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"        # Check to see if we need to update placement\u0027s view"},{"line_number":504,"context_line":"        if not self._provider_tree.has_inventory_changed(rp_uuid, inv_data):"}],"source_content_type":"text/x-python","patch_set":14,"id":"7f231b9d_97bc3f6a","line":501,"updated":"2017-06-12 12:07:50.000000000","message":"if you named this cur_rp_gen much of the red and green below wouldn\u0027t need to happen\n\n(again, not that it really matters)","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6d7383a3b5ee9133a3a9ba7e87309a17350c7f4f","unresolved":false,"context_lines":[{"line_number":498,"context_line":"        # the current inventory for every resource provider each and every time"},{"line_number":499,"context_line":"        # update_resource_stats() is called? :("},{"line_number":500,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":501,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":502,"context_line":""},{"line_number":503,"context_line":"        # Check to see if we need to update placement\u0027s view"},{"line_number":504,"context_line":"        if not self._provider_tree.has_inventory_changed(rp_uuid, inv_data):"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f201791_c85ce9ee","line":501,"in_reply_to":"7f231b9d_97bc3f6a","updated":"2017-06-26 10:42:31.000000000","message":"There are generally other changes on the affected lines, so not much point in reverting this IMO","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"002f2b1ac35aa236671eafa22639ab3771d79b14","unresolved":false,"context_lines":[{"line_number":636,"context_line":"                  \"records.\")"},{"line_number":637,"context_line":"        LOG.info(msg, rp_uuid)"},{"line_number":638,"context_line":""},{"line_number":639,"context_line":"        cur_gen \u003d curr[\u0027resource_provider_generation\u0027]"},{"line_number":640,"context_line":"        url \u003d \u0027/resource_providers/%s/inventories\u0027 % rp_uuid"},{"line_number":641,"context_line":"        payload \u003d {"},{"line_number":642,"context_line":"            \u0027resource_provider_generation\u0027: cur_gen,"}],"source_content_type":"text/x-python","patch_set":14,"id":"7f231b9d_9771dfe3","line":639,"updated":"2017-06-12 12:07:50.000000000","message":"ditto","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"6d7383a3b5ee9133a3a9ba7e87309a17350c7f4f","unresolved":false,"context_lines":[{"line_number":636,"context_line":"                  \"records.\")"},{"line_number":637,"context_line":"        LOG.info(msg, rp_uuid)"},{"line_number":638,"context_line":""},{"line_number":639,"context_line":"        cur_gen \u003d curr[\u0027resource_provider_generation\u0027]"},{"line_number":640,"context_line":"        url \u003d \u0027/resource_providers/%s/inventories\u0027 % rp_uuid"},{"line_number":641,"context_line":"        payload \u003d {"},{"line_number":642,"context_line":"            \u0027resource_provider_generation\u0027: cur_gen,"}],"source_content_type":"text/x-python","patch_set":14,"id":"5f201791_685275e0","line":639,"in_reply_to":"7f231b9d_9771dfe3","updated":"2017-06-26 10:42:31.000000000","message":"Done","commit_id":"cbc97c559bcb0ec975f9d4ad97df303d406aac87"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1071e927447bef3821283356083f62081224c8af","unresolved":false,"context_lines":[{"line_number":495,"context_line":"        :returns: True if the inventory was updated (or did not need to be),"},{"line_number":496,"context_line":"                  False otherwise."},{"line_number":497,"context_line":"        \"\"\""},{"line_number":498,"context_line":"        # TODO(jaypipes): Should we really be calling the placement API to get"},{"line_number":499,"context_line":"        # the current inventory for every resource provider each and every time"},{"line_number":500,"context_line":"        # update_resource_stats() is called? :("},{"line_number":501,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":502,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":503,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"5f201791_a8fbed76","line":500,"range":{"start_line":498,"start_character":0,"end_line":500,"end_character":47},"updated":"2017-06-26 11:00:46.000000000","message":"There\u0027s nothing wrong with making the call - it\u0027s how we do the comparison that, IMO, is what we could work on. Something like ETags [1] might be one solution?\n\n[1] https://en.wikipedia.org/wiki/HTTP_ETag","commit_id":"043b15eb63cf52d8fff80506d7443b0984e63d3c"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1071e927447bef3821283356083f62081224c8af","unresolved":false,"context_lines":[{"line_number":621,"context_line":"        \"\"\"Deletes all inventory records for a resource provider with the"},{"line_number":622,"context_line":"        supplied UUID."},{"line_number":623,"context_line":"        \"\"\""},{"line_number":624,"context_line":"        if not self._provider_tree.has_inventory_changed(rp_uuid, {}):"},{"line_number":625,"context_line":"            return"},{"line_number":626,"context_line":""},{"line_number":627,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":628,"context_line":""}],"source_content_type":"text/x-python","patch_set":15,"id":"5f201791_0869c11f","line":625,"range":{"start_line":624,"start_character":8,"end_line":625,"end_character":18},"updated":"2017-06-26 11:00:46.000000000","message":"This confused me as it took me a moment to realize that you were checking against an empty dict to as a sort of \"is already null\" check. It might be better to add a \u0027cleared\u0027 property to the \u0027ProviderTree\u0027 class to formalize this check, letting us do:\n\n  if self._provider_tree.cleared:\n      return","commit_id":"043b15eb63cf52d8fff80506d7443b0984e63d3c"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e9867c926b00416b4fc03677d0fa1fffc4c4249f","unresolved":false,"context_lines":[{"line_number":458,"context_line":"            name \u003d name or uuid"},{"line_number":459,"context_line":"            rp \u003d self._create_resource_provider(uuid, name)"},{"line_number":460,"context_line":"            if rp is None:"},{"line_number":461,"context_line":"                return"},{"line_number":462,"context_line":"        msg \u003d \"Grabbing aggregate associations for resource provider %s\""},{"line_number":463,"context_line":"        LOG.debug(msg, uuid)"},{"line_number":464,"context_line":"        aggs \u003d self._get_provider_aggregates(uuid)"}],"source_content_type":"text/x-python","patch_set":16,"id":"7f287b81_3909af94","line":461,"range":{"start_line":461,"start_character":16,"end_line":461,"end_character":22},"updated":"2017-10-04 14:42:59.000000000","message":"This should explicitly return None","commit_id":"5209903df1c78278de036d9515078c39634906fc"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d2f015780e7534e3e6e0ef5d93df6cc4e897cbf7","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    def __init__(self):"},{"line_number":236,"context_line":"        # An object that contains a nova-compute-side cache of resource"},{"line_number":237,"context_line":"        # provider and inventory information"},{"line_number":238,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":239,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":240,"context_line":"        # the provider is associated with"},{"line_number":241,"context_line":"        self._provider_aggregate_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_b2a1ebfa","line":238,"updated":"2017-09-28 17:03:27.000000000","message":"Okay, so this doesn\u0027t appear to actually do anything until the first time we do something with inventories.\n\nWe can and do instantiate this client in a lot of places, so I want to make sure we\u0027re not building a bunch of state during init for no reason. Looks like we\u0027re not.","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a32288e5a6a5e8cca4b2291770253e196dc10371","unresolved":false,"context_lines":[{"line_number":235,"context_line":"    def __init__(self):"},{"line_number":236,"context_line":"        # An object that contains a nova-compute-side cache of resource"},{"line_number":237,"context_line":"        # provider and inventory information"},{"line_number":238,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":239,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":240,"context_line":"        # the provider is associated with"},{"line_number":241,"context_line":"        self._provider_aggregate_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_b45a8980","line":238,"in_reply_to":"7f515b1d_b2a1ebfa","updated":"2017-10-04 19:02:38.000000000","message":"Correct.","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e9867c926b00416b4fc03677d0fa1fffc4c4249f","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":239,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":240,"context_line":"        # the provider is associated with"},{"line_number":241,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":242,"context_line":"        self._client \u003d self._create_client()"},{"line_number":243,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":244,"context_line":"        self._warn_count \u003d 0"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_f3b6103e","line":241,"range":{"start_line":241,"start_character":8,"end_line":241,"end_character":41},"updated":"2017-10-04 14:42:59.000000000","message":"Why don\u0027t we make this part of ProviderTree, i.e. put an `aggregates` list field into the _Provider object?  Is there some reason the python objects need to retain a high fidelity to the database representations?","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a32288e5a6a5e8cca4b2291770253e196dc10371","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":239,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":240,"context_line":"        # the provider is associated with"},{"line_number":241,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":242,"context_line":"        self._client \u003d self._create_client()"},{"line_number":243,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":244,"context_line":"        self._warn_count \u003d 0"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_347579fb","line":241,"range":{"start_line":241,"start_character":8,"end_line":241,"end_character":41},"in_reply_to":"7f515b1d_f3b6103e","updated":"2017-10-04 19:02:38.000000000","message":"maybe in the future we can, sure. just not in this particular patch series :)","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"4f7fd03422ad6a4796e9e2d525d3d86745f444e5","unresolved":false,"context_lines":[{"line_number":249,"context_line":"    @utils.synchronized(PLACEMENT_CLIENT_SEMAPHORE)"},{"line_number":250,"context_line":"    def _create_client(self):"},{"line_number":251,"context_line":"        \"\"\"Create the HTTP session accessing the placement service.\"\"\""},{"line_number":252,"context_line":"        # Flush _resource_providers and aggregates so we start from a"},{"line_number":253,"context_line":"        # clean slate."},{"line_number":254,"context_line":"        self._resource_providers \u003d {}"},{"line_number":255,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":256,"context_line":"        auth_plugin \u003d keystone.load_auth_from_conf_options("},{"line_number":257,"context_line":"            CONF, \u0027placement\u0027)"},{"line_number":258,"context_line":"        return keystone.load_session_from_conf_options("}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_aef7c2d4","line":255,"range":{"start_line":252,"start_character":0,"end_line":255,"end_character":41},"updated":"2017-10-05 08:42:44.000000000","message":"Is this initialization still needed ?","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a6e4555ffa502c136e77b4771d3b6eee6d8b051a","unresolved":false,"context_lines":[{"line_number":249,"context_line":"    @utils.synchronized(PLACEMENT_CLIENT_SEMAPHORE)"},{"line_number":250,"context_line":"    def _create_client(self):"},{"line_number":251,"context_line":"        \"\"\"Create the HTTP session accessing the placement service.\"\"\""},{"line_number":252,"context_line":"        # Flush _resource_providers and aggregates so we start from a"},{"line_number":253,"context_line":"        # clean slate."},{"line_number":254,"context_line":"        self._resource_providers \u003d {}"},{"line_number":255,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":256,"context_line":"        auth_plugin \u003d keystone.load_auth_from_conf_options("},{"line_number":257,"context_line":"            CONF, \u0027placement\u0027)"},{"line_number":258,"context_line":"        return keystone.load_session_from_conf_options("}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_b4620c3d","line":255,"range":{"start_line":252,"start_character":0,"end_line":255,"end_character":41},"in_reply_to":"7f515b1d_089ec362","updated":"2017-10-09 17:05:44.000000000","message":"Done","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"05faaf163777574603816b42a9a29477dd2356a7","unresolved":false,"context_lines":[{"line_number":249,"context_line":"    @utils.synchronized(PLACEMENT_CLIENT_SEMAPHORE)"},{"line_number":250,"context_line":"    def _create_client(self):"},{"line_number":251,"context_line":"        \"\"\"Create the HTTP session accessing the placement service.\"\"\""},{"line_number":252,"context_line":"        # Flush _resource_providers and aggregates so we start from a"},{"line_number":253,"context_line":"        # clean slate."},{"line_number":254,"context_line":"        self._resource_providers \u003d {}"},{"line_number":255,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":256,"context_line":"        auth_plugin \u003d keystone.load_auth_from_conf_options("},{"line_number":257,"context_line":"            CONF, \u0027placement\u0027)"},{"line_number":258,"context_line":"        return keystone.load_session_from_conf_options("}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_089ec362","line":255,"range":{"start_line":252,"start_character":0,"end_line":255,"end_character":41},"in_reply_to":"7f515b1d_97df760b","updated":"2017-10-05 13:54:56.000000000","message":"Indeed, nice catch. :) Will remove the _resource_providers dict","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"293d49b77567be5d383834bfc315277561b6e80b","unresolved":false,"context_lines":[{"line_number":249,"context_line":"    @utils.synchronized(PLACEMENT_CLIENT_SEMAPHORE)"},{"line_number":250,"context_line":"    def _create_client(self):"},{"line_number":251,"context_line":"        \"\"\"Create the HTTP session accessing the placement service.\"\"\""},{"line_number":252,"context_line":"        # Flush _resource_providers and aggregates so we start from a"},{"line_number":253,"context_line":"        # clean slate."},{"line_number":254,"context_line":"        self._resource_providers \u003d {}"},{"line_number":255,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":256,"context_line":"        auth_plugin \u003d keystone.load_auth_from_conf_options("},{"line_number":257,"context_line":"            CONF, \u0027placement\u0027)"},{"line_number":258,"context_line":"        return keystone.load_session_from_conf_options("}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_97df760b","line":255,"range":{"start_line":252,"start_character":0,"end_line":255,"end_character":41},"in_reply_to":"7f515b1d_aef7c2d4","updated":"2017-10-05 12:37:49.000000000","message":"Ah, good catch.  The reinitialization was being done on purpose, so L255 is likely still needed.  But L254 should be changed to reinitialize self._provider_tree like L238.","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e9867c926b00416b4fc03677d0fa1fffc4c4249f","unresolved":false,"context_lines":[{"line_number":483,"context_line":"                \u0027err_text\u0027: resp.text,"},{"line_number":484,"context_line":"                \u0027placement_req_id\u0027: placement_req_id,"},{"line_number":485,"context_line":"            }"},{"line_number":486,"context_line":"            LOG.error(msg, args)"},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"    def _ensure_resource_provider(self, uuid, name\u003dNone):"},{"line_number":489,"context_line":"        \"\"\"Ensures that the placement API has a record of a resource provider"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_99525d12","line":486,"updated":"2017-10-04 14:42:59.000000000","message":"This should explicitly return None.","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a6e4555ffa502c136e77b4771d3b6eee6d8b051a","unresolved":false,"context_lines":[{"line_number":483,"context_line":"                \u0027err_text\u0027: resp.text,"},{"line_number":484,"context_line":"                \u0027placement_req_id\u0027: placement_req_id,"},{"line_number":485,"context_line":"            }"},{"line_number":486,"context_line":"            LOG.error(msg, args)"},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"    def _ensure_resource_provider(self, uuid, name\u003dNone):"},{"line_number":489,"context_line":"        \"\"\"Ensures that the placement API has a record of a resource provider"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_74581489","line":486,"in_reply_to":"7f515b1d_74541155","updated":"2017-10-09 17:05:44.000000000","message":"Done","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a32288e5a6a5e8cca4b2291770253e196dc10371","unresolved":false,"context_lines":[{"line_number":483,"context_line":"                \u0027err_text\u0027: resp.text,"},{"line_number":484,"context_line":"                \u0027placement_req_id\u0027: placement_req_id,"},{"line_number":485,"context_line":"            }"},{"line_number":486,"context_line":"            LOG.error(msg, args)"},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"    def _ensure_resource_provider(self, uuid, name\u003dNone):"},{"line_number":489,"context_line":"        \"\"\"Ensures that the placement API has a record of a resource provider"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_74541155","line":486,"in_reply_to":"7f515b1d_99525d12","updated":"2017-10-04 19:02:38.000000000","message":"meh, ok :)","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f57e41dad090be939e352659c53a492376d8ce47","unresolved":false,"context_lines":[{"line_number":513,"context_line":"            # provider objects, however the alternative is to force operators"},{"line_number":514,"context_line":"            # to restart all their nova-compute workers every time they add or"},{"line_number":515,"context_line":"            # change an aggregate. We might optionally want to add some sort of"},{"line_number":516,"context_line":"            # cache refresh delay or interval as an optimization?"},{"line_number":517,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":518,"context_line":"            LOG.debug(msg, uuid)"},{"line_number":519,"context_line":"            aggs \u003d self._get_provider_aggregates(uuid)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_e24e4a95","line":516,"updated":"2017-10-01 14:21:21.000000000","message":"Can we get this reviewed please: https://review.openstack.org/#/c/489633/","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e9867c926b00416b4fc03677d0fa1fffc4c4249f","unresolved":false,"context_lines":[{"line_number":513,"context_line":"            # provider objects, however the alternative is to force operators"},{"line_number":514,"context_line":"            # to restart all their nova-compute workers every time they add or"},{"line_number":515,"context_line":"            # change an aggregate. We might optionally want to add some sort of"},{"line_number":516,"context_line":"            # cache refresh delay or interval as an optimization?"},{"line_number":517,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":518,"context_line":"            LOG.debug(msg, uuid)"},{"line_number":519,"context_line":"            aggs \u003d self._get_provider_aggregates(uuid)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_3997e94a","line":516,"in_reply_to":"7f515b1d_e24e4a95","updated":"2017-10-04 14:42:59.000000000","message":"Done","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a32288e5a6a5e8cca4b2291770253e196dc10371","unresolved":false,"context_lines":[{"line_number":513,"context_line":"            # provider objects, however the alternative is to force operators"},{"line_number":514,"context_line":"            # to restart all their nova-compute workers every time they add or"},{"line_number":515,"context_line":"            # change an aggregate. We might optionally want to add some sort of"},{"line_number":516,"context_line":"            # cache refresh delay or interval as an optimization?"},{"line_number":517,"context_line":"            msg \u003d \"Refreshing aggregate associations for resource provider %s\""},{"line_number":518,"context_line":"            LOG.debug(msg, uuid)"},{"line_number":519,"context_line":"            aggs \u003d self._get_provider_aggregates(uuid)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_344e99c1","line":516,"in_reply_to":"7f515b1d_e24e4a95","updated":"2017-10-04 19:02:38.000000000","message":"done.","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e9867c926b00416b4fc03677d0fa1fffc4c4249f","unresolved":false,"context_lines":[{"line_number":529,"context_line":"            name \u003d name or uuid"},{"line_number":530,"context_line":"            rp \u003d self._create_resource_provider(uuid, name)"},{"line_number":531,"context_line":"            if rp is None:"},{"line_number":532,"context_line":"                return"},{"line_number":533,"context_line":"        msg \u003d \"Grabbing aggregate associations for resource provider %s\""},{"line_number":534,"context_line":"        LOG.debug(msg, uuid)"},{"line_number":535,"context_line":"        aggs \u003d self._get_provider_aggregates(uuid)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_9667ca4d","line":532,"range":{"start_line":532,"start_character":16,"end_line":532,"end_character":22},"updated":"2017-10-04 14:42:59.000000000","message":"This should explicitly return None","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a32288e5a6a5e8cca4b2291770253e196dc10371","unresolved":false,"context_lines":[{"line_number":529,"context_line":"            name \u003d name or uuid"},{"line_number":530,"context_line":"            rp \u003d self._create_resource_provider(uuid, name)"},{"line_number":531,"context_line":"            if rp is None:"},{"line_number":532,"context_line":"                return"},{"line_number":533,"context_line":"        msg \u003d \"Grabbing aggregate associations for resource provider %s\""},{"line_number":534,"context_line":"        LOG.debug(msg, uuid)"},{"line_number":535,"context_line":"        aggs \u003d self._get_provider_aggregates(uuid)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_b4cf2928","line":532,"range":{"start_line":532,"start_character":16,"end_line":532,"end_character":22},"in_reply_to":"7f515b1d_9667ca4d","updated":"2017-10-04 19:02:38.000000000","message":"ok","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a6e4555ffa502c136e77b4771d3b6eee6d8b051a","unresolved":false,"context_lines":[{"line_number":529,"context_line":"            name \u003d name or uuid"},{"line_number":530,"context_line":"            rp \u003d self._create_resource_provider(uuid, name)"},{"line_number":531,"context_line":"            if rp is None:"},{"line_number":532,"context_line":"                return"},{"line_number":533,"context_line":"        msg \u003d \"Grabbing aggregate associations for resource provider %s\""},{"line_number":534,"context_line":"        LOG.debug(msg, uuid)"},{"line_number":535,"context_line":"        aggs \u003d self._get_provider_aggregates(uuid)"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_3404dc49","line":532,"range":{"start_line":532,"start_character":16,"end_line":532,"end_character":22},"in_reply_to":"7f515b1d_b4cf2928","updated":"2017-10-09 17:05:44.000000000","message":"Done","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e9867c926b00416b4fc03677d0fa1fffc4c4249f","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        aggs \u003d self._get_provider_aggregates(uuid)"},{"line_number":536,"context_line":"        self._provider_aggregate_map[uuid] \u003d aggs"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        generation \u003d rp[\u0027generation\u0027]"},{"line_number":539,"context_line":"        return self._provider_tree.new_root("},{"line_number":540,"context_line":"            rp[\u0027name\u0027],"},{"line_number":541,"context_line":"            uuid,"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_39436944","line":538,"range":{"start_line":538,"start_character":8,"end_line":538,"end_character":37},"updated":"2017-10-04 14:42:59.000000000","message":"why not inline this below?","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a32288e5a6a5e8cca4b2291770253e196dc10371","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        aggs \u003d self._get_provider_aggregates(uuid)"},{"line_number":536,"context_line":"        self._provider_aggregate_map[uuid] \u003d aggs"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        generation \u003d rp[\u0027generation\u0027]"},{"line_number":539,"context_line":"        return self._provider_tree.new_root("},{"line_number":540,"context_line":"            rp[\u0027name\u0027],"},{"line_number":541,"context_line":"            uuid,"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_b4e8497c","line":538,"range":{"start_line":538,"start_character":8,"end_line":538,"end_character":37},"in_reply_to":"7f515b1d_39436944","updated":"2017-10-04 19:02:38.000000000","message":"I need to fix up the egregious use of parens anyway, so I\u0027ll change it ;)","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a6e4555ffa502c136e77b4771d3b6eee6d8b051a","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        aggs \u003d self._get_provider_aggregates(uuid)"},{"line_number":536,"context_line":"        self._provider_aggregate_map[uuid] \u003d aggs"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        generation \u003d rp[\u0027generation\u0027]"},{"line_number":539,"context_line":"        return self._provider_tree.new_root("},{"line_number":540,"context_line":"            rp[\u0027name\u0027],"},{"line_number":541,"context_line":"            uuid,"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_f4f9a44d","line":538,"range":{"start_line":538,"start_character":8,"end_line":538,"end_character":37},"in_reply_to":"7f515b1d_b4e8497c","updated":"2017-10-09 17:05:44.000000000","message":"Done","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e9867c926b00416b4fc03677d0fa1fffc4c4249f","unresolved":false,"context_lines":[{"line_number":580,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":581,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":582,"context_line":""},{"line_number":583,"context_line":"        # Check to see if we need to update placement\u0027s view"},{"line_number":584,"context_line":"        if not self._provider_tree.has_inventory_changed(rp_uuid, inv_data):"},{"line_number":585,"context_line":"            return True"},{"line_number":586,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_99e25dd4","line":583,"range":{"start_line":583,"start_character":8,"end_line":583,"end_character":60},"updated":"2017-10-04 14:42:59.000000000","message":"Should we also do this if cur_gen is None?","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"e9867c926b00416b4fc03677d0fa1fffc4c4249f","unresolved":false,"context_lines":[{"line_number":596,"context_line":"                         \u0027%(generation)s\u0027),"},{"line_number":597,"context_line":"                     {\u0027placement_req_id\u0027: get_placement_request_id(result),"},{"line_number":598,"context_line":"                      \u0027resource_provider_uuid\u0027: rp_uuid,"},{"line_number":599,"context_line":"                      \u0027generation\u0027: cur_gen})"},{"line_number":600,"context_line":"            # NOTE(jaypipes): There may be cases when we try to set a"},{"line_number":601,"context_line":"            # provider\u0027s inventory that results in attempting to delete an"},{"line_number":602,"context_line":"            # inventory record for a resource class that has an active"}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_59e865b1","line":599,"range":{"start_line":599,"start_character":36,"end_line":599,"end_character":43},"updated":"2017-10-04 14:42:59.000000000","message":"cur_gen or \u0027None\u0027 ?","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d2f015780e7534e3e6e0ef5d93df6cc4e897cbf7","unresolved":false,"context_lines":[{"line_number":704,"context_line":"        this results in a 406, fail over to a PUT."},{"line_number":705,"context_line":"        \"\"\""},{"line_number":706,"context_line":"        if not self._provider_tree.has_inventory_changed(rp_uuid, {}):"},{"line_number":707,"context_line":"            return"},{"line_number":708,"context_line":""},{"line_number":709,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":710,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_72ced3b4","line":707,"updated":"2017-09-28 17:03:27.000000000","message":"Is this a \"don\u0027t delete if we think the current inventory is empty anyway\"?\n\nThat\u0027s just a performance hack to avoid refreshing and deleting noting, is that right? That\u0027s cool, but it\u0027s a little confusing intermixed with the rest of this stuff.","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a32288e5a6a5e8cca4b2291770253e196dc10371","unresolved":false,"context_lines":[{"line_number":704,"context_line":"        this results in a 406, fail over to a PUT."},{"line_number":705,"context_line":"        \"\"\""},{"line_number":706,"context_line":"        if not self._provider_tree.has_inventory_changed(rp_uuid, {}):"},{"line_number":707,"context_line":"            return"},{"line_number":708,"context_line":""},{"line_number":709,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":710,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_d4c185e6","line":707,"in_reply_to":"7f515b1d_72ced3b4","updated":"2017-10-04 19:02:38.000000000","message":"Yeah, agreed. I\u0027ll rework it to be easier to read.","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"a6e4555ffa502c136e77b4771d3b6eee6d8b051a","unresolved":false,"context_lines":[{"line_number":704,"context_line":"        this results in a 406, fail over to a PUT."},{"line_number":705,"context_line":"        \"\"\""},{"line_number":706,"context_line":"        if not self._provider_tree.has_inventory_changed(rp_uuid, {}):"},{"line_number":707,"context_line":"            return"},{"line_number":708,"context_line":""},{"line_number":709,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":710,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"7f515b1d_d400e804","line":707,"in_reply_to":"7f515b1d_d4c185e6","updated":"2017-10-09 17:05:44.000000000","message":"Done","commit_id":"7c3cd9287d4f7aff31ab9340da43f8826d42e1dd"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"fe4d58e7b8c3ae3545e9f6ada4d5019263722dfc","unresolved":false,"context_lines":[{"line_number":601,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":602,"context_line":""},{"line_number":603,"context_line":"        # Check to see if we need to update placement\u0027s view"},{"line_number":604,"context_line":"        if not self._provider_tree.has_inventory_changed(rp_uuid, inv_data):"},{"line_number":605,"context_line":"            return True"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"        payload \u003d {"}],"source_content_type":"text/x-python","patch_set":22,"id":"5f4e5783_0937644f","line":604,"range":{"start_line":604,"start_character":8,"end_line":604,"end_character":76},"updated":"2017-10-17 08:47:07.000000000","message":"In line 556, we already know the inventory is changed or not...","commit_id":"5f4c3eeb926f361dd42ab3a3c8c641dbd63167f5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def __init__(self):"},{"line_number":238,"context_line":"        # An object that contains a nova-compute-side cache of resource"},{"line_number":239,"context_line":"        # provider and inventory information"},{"line_number":240,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":241,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":242,"context_line":"        # the provider is associated with"},{"line_number":243,"context_line":"        self._provider_aggregate_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_18453518","line":240,"updated":"2017-10-18 09:52:49.000000000","message":"This might not even needed as _create_client() will initialize the self._provider_tree anyhow.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"093922ef7706120402fb26512e5bff892722ca50","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def __init__(self):"},{"line_number":238,"context_line":"        # An object that contains a nova-compute-side cache of resource"},{"line_number":239,"context_line":"        # provider and inventory information"},{"line_number":240,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":241,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":242,"context_line":"        # the provider is associated with"},{"line_number":243,"context_line":"        self._provider_aggregate_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_204f85be","line":240,"in_reply_to":"3f4b6375_18453518","updated":"2017-10-18 21:51:15.000000000","message":"This has been brought up before: it\u0027s good form to introduce all instance variables in __init__.  Though I\u0027ll agree that there\u0027s no value in calling the ProviderTree() initializer here - may as well just initialize it to None.  Same thing with self._provider_aggregate_map and self.aggregate_refresh_time.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"da33831c4cac462e51e045b493a637e7750e8e7c","unresolved":false,"context_lines":[{"line_number":237,"context_line":"    def __init__(self):"},{"line_number":238,"context_line":"        # An object that contains a nova-compute-side cache of resource"},{"line_number":239,"context_line":"        # provider and inventory information"},{"line_number":240,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":241,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":242,"context_line":"        # the provider is associated with"},{"line_number":243,"context_line":"        self._provider_aggregate_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_fb6333db","line":240,"in_reply_to":"3f4b6375_204f85be","updated":"2017-10-20 09:20:40.000000000","message":"While we are not strictly following the \u0027define every field in __init__\u0027 elsewhere in the code base, I agree that having the definition in place helps my IDE to offer better code completion suggestions. :)","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":553,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":554,"context_line":"        if cur_gen:"},{"line_number":555,"context_line":"            curr_inv \u003d curr.get(\u0027inventories\u0027, {})"},{"line_number":556,"context_line":"            self._provider_tree.update_inventory(rp_uuid, curr_inv, cur_gen)"},{"line_number":557,"context_line":"        return curr"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    def _refresh_aggregate_map(self, rp_uuid, force\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_781309ba","line":556,"updated":"2017-10-18 09:52:49.000000000","message":"Does this mean that if we cannot reach the placement API then we assume an empty inventory? Do we need to retry?","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0a4f2f267ed9e66ce6c4e45322da71d1ad814e23","unresolved":false,"context_lines":[{"line_number":553,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":554,"context_line":"        if cur_gen:"},{"line_number":555,"context_line":"            curr_inv \u003d curr.get(\u0027inventories\u0027, {})"},{"line_number":556,"context_line":"            self._provider_tree.update_inventory(rp_uuid, curr_inv, cur_gen)"},{"line_number":557,"context_line":"        return curr"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    def _refresh_aggregate_map(self, rp_uuid, force\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_ce556952","line":556,"in_reply_to":"3f4b6375_00e1299b","updated":"2017-10-19 18:14:50.000000000","message":"This isn\u0027t something germane to this patch itself. Whether or not this (or any, frankly) call to the placement API should be decorated with some sort of retry is out of scope for this patch.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"093922ef7706120402fb26512e5bff892722ca50","unresolved":false,"context_lines":[{"line_number":553,"context_line":"        cur_gen \u003d curr.get(\u0027resource_provider_generation\u0027)"},{"line_number":554,"context_line":"        if cur_gen:"},{"line_number":555,"context_line":"            curr_inv \u003d curr.get(\u0027inventories\u0027, {})"},{"line_number":556,"context_line":"            self._provider_tree.update_inventory(rp_uuid, curr_inv, cur_gen)"},{"line_number":557,"context_line":"        return curr"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    def _refresh_aggregate_map(self, rp_uuid, force\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_00e1299b","line":556,"in_reply_to":"3f4b6375_781309ba","updated":"2017-10-18 21:51:15.000000000","message":"This is a good point.  _get_inventory isn\u0027t going to raise if something goes wrong in the HTTP call - it\u0027ll just report an empty inventory.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6f6f4f664c93758b9bff53f0f63c3d3ce573fb8e","unresolved":false,"context_lines":[{"line_number":605,"context_line":"            return True"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"        payload \u003d {"},{"line_number":608,"context_line":"            \u0027resource_provider_generation\u0027: cur_gen,"},{"line_number":609,"context_line":"            \u0027inventories\u0027: inv_data,"},{"line_number":610,"context_line":"        }"},{"line_number":611,"context_line":"        url \u003d \u0027/resource_providers/%s/inventories\u0027 % rp_uuid"}],"source_content_type":"text/x-python","patch_set":23,"id":"5f4e5783_de268e68","line":608,"range":{"start_line":608,"start_character":44,"end_line":608,"end_character":51},"updated":"2017-10-17 19:46:18.000000000","message":"This could be None now, where it couldn\u0027t before. I kinda expect that providing a generation of None is not going to be considered the same as it being missing, or otherwise tolerated by placement. The .get()s above make this ambigious and I don\u0027t think it needs to be. If we get to this point without having been able to pull a generation, surely we should have exploded earlier, right?","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b0ed30d61d1fdcb0fd8fd41e1ff9f52eea8a0252","unresolved":false,"context_lines":[{"line_number":605,"context_line":"            return True"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"        payload \u003d {"},{"line_number":608,"context_line":"            \u0027resource_provider_generation\u0027: cur_gen,"},{"line_number":609,"context_line":"            \u0027inventories\u0027: inv_data,"},{"line_number":610,"context_line":"        }"},{"line_number":611,"context_line":"        url \u003d \u0027/resource_providers/%s/inventories\u0027 % rp_uuid"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_4e31790b","line":608,"range":{"start_line":608,"start_character":44,"end_line":608,"end_character":51},"in_reply_to":"3f4b6375_eed5c5ba","updated":"2017-10-19 18:22:06.000000000","message":"Changed this to dict access instead of get().","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"0807b365a578f3b2134766b2619787cfa1c03bf6","unresolved":false,"context_lines":[{"line_number":605,"context_line":"            return True"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"        payload \u003d {"},{"line_number":608,"context_line":"            \u0027resource_provider_generation\u0027: cur_gen,"},{"line_number":609,"context_line":"            \u0027inventories\u0027: inv_data,"},{"line_number":610,"context_line":"        }"},{"line_number":611,"context_line":"        url \u003d \u0027/resource_providers/%s/inventories\u0027 % rp_uuid"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_03147af4","line":608,"range":{"start_line":608,"start_character":44,"end_line":608,"end_character":51},"in_reply_to":"5f4e5783_c1946e39","updated":"2017-10-19 17:17:27.000000000","message":"Where would we explode prior to this? I was asking.\n\nPersonally, I think this should blow up after L601 if we don\u0027t get a usable generation back. Unless I\u0027m missing something, that would be a broken API, and something is wrong so we shouldn\u0027t continue.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"c5224fefd36b207e2419287cbe981dff110b2739","unresolved":false,"context_lines":[{"line_number":605,"context_line":"            return True"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"        payload \u003d {"},{"line_number":608,"context_line":"            \u0027resource_provider_generation\u0027: cur_gen,"},{"line_number":609,"context_line":"            \u0027inventories\u0027: inv_data,"},{"line_number":610,"context_line":"        }"},{"line_number":611,"context_line":"        url \u003d \u0027/resource_providers/%s/inventories\u0027 % rp_uuid"}],"source_content_type":"text/x-python","patch_set":23,"id":"5f4e5783_c1946e39","line":608,"range":{"start_line":608,"start_character":44,"end_line":608,"end_character":51},"in_reply_to":"5f4e5783_de268e68","updated":"2017-10-17 20:49:49.000000000","message":"I looked into this, and the answer is almost certainly yes, we would have blown up (or more likely, refetched the RP) earlier.\n\nBut if we did manage to get here with a cur_gen of None, it\u0027s copacetic: the PUT will fail 409, and the caller will refetch the RP and retry this method.\n\nSo this is safe, and also a bit more future-proof than switching to [\u0027resource_provider_generation\u0027].  It would therefore be my preference to keep it this way.\n\n(If that\u0027s not what you were suggesting, please elaborate.)","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0a4f2f267ed9e66ce6c4e45322da71d1ad814e23","unresolved":false,"context_lines":[{"line_number":605,"context_line":"            return True"},{"line_number":606,"context_line":""},{"line_number":607,"context_line":"        payload \u003d {"},{"line_number":608,"context_line":"            \u0027resource_provider_generation\u0027: cur_gen,"},{"line_number":609,"context_line":"            \u0027inventories\u0027: inv_data,"},{"line_number":610,"context_line":"        }"},{"line_number":611,"context_line":"        url \u003d \u0027/resource_providers/%s/inventories\u0027 % rp_uuid"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_eed5c5ba","line":608,"range":{"start_line":608,"start_character":44,"end_line":608,"end_character":51},"in_reply_to":"5f4e5783_de268e68","updated":"2017-10-19 18:14:50.000000000","message":"Sorry, but how could cur_gen be None?","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6f6f4f664c93758b9bff53f0f63c3d3ce573fb8e","unresolved":false,"context_lines":[{"line_number":702,"context_line":"    @safe_connect"},{"line_number":703,"context_line":"    def _update_inventory(self, rp_uuid, inv_data):"},{"line_number":704,"context_line":"        for attempt in (1, 2, 3):"},{"line_number":705,"context_line":"            if not self._provider_tree.exists(rp_uuid):"},{"line_number":706,"context_line":"                # NOTE(danms): Either we failed to fetch/create the RP"},{"line_number":707,"context_line":"                # on our first attempt, or a previous attempt had to"},{"line_number":708,"context_line":"                # invalidate the cache, and we were unable to refresh"}],"source_content_type":"text/x-python","patch_set":23,"id":"5f4e5783_1ebf86d1","line":705,"updated":"2017-10-17 19:46:18.000000000","message":"Side note, __contains__ for ProviderTree would probably be quite useful.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b0ed30d61d1fdcb0fd8fd41e1ff9f52eea8a0252","unresolved":false,"context_lines":[{"line_number":702,"context_line":"    @safe_connect"},{"line_number":703,"context_line":"    def _update_inventory(self, rp_uuid, inv_data):"},{"line_number":704,"context_line":"        for attempt in (1, 2, 3):"},{"line_number":705,"context_line":"            if not self._provider_tree.exists(rp_uuid):"},{"line_number":706,"context_line":"                # NOTE(danms): Either we failed to fetch/create the RP"},{"line_number":707,"context_line":"                # on our first attempt, or a previous attempt had to"},{"line_number":708,"context_line":"                # invalidate the cache, and we were unable to refresh"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_8e2e51a3","line":705,"in_reply_to":"5f4e5783_1ebf86d1","updated":"2017-10-19 18:22:06.000000000","message":"ack. can add in followup patch.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":723,"context_line":"        First attempt to DELETE the inventory using microversion 1.5. If"},{"line_number":724,"context_line":"        this results in a 406, fail over to a PUT."},{"line_number":725,"context_line":"        \"\"\""},{"line_number":726,"context_line":"        if not self._provider_tree.has_inventory(rp_uuid):"},{"line_number":727,"context_line":"            return"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_f3683abb","line":726,"range":{"start_line":726,"start_character":35,"end_line":726,"end_character":48},"updated":"2017-10-18 09:52:49.000000000","message":"Could we reach this point after a _refresh_and_get_inventory() call that updated the inventory to {} because placement was unavailable? If yes then this check will prevent us to delete the inventory from placement.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"da33831c4cac462e51e045b493a637e7750e8e7c","unresolved":false,"context_lines":[{"line_number":723,"context_line":"        First attempt to DELETE the inventory using microversion 1.5. If"},{"line_number":724,"context_line":"        this results in a 406, fail over to a PUT."},{"line_number":725,"context_line":"        \"\"\""},{"line_number":726,"context_line":"        if not self._provider_tree.has_inventory(rp_uuid):"},{"line_number":727,"context_line":"            return"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_bb37fbb0","line":726,"range":{"start_line":726,"start_character":35,"end_line":726,"end_character":48},"in_reply_to":"3f4b6375_09093b2b","updated":"2017-10-20 09:20:40.000000000","message":"OK. This behavior is now changed due to L553 in PS24. So at least this code will try the delete even if before placement was unavailable.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b0ed30d61d1fdcb0fd8fd41e1ff9f52eea8a0252","unresolved":false,"context_lines":[{"line_number":723,"context_line":"        First attempt to DELETE the inventory using microversion 1.5. If"},{"line_number":724,"context_line":"        this results in a 406, fail over to a PUT."},{"line_number":725,"context_line":"        \"\"\""},{"line_number":726,"context_line":"        if not self._provider_tree.has_inventory(rp_uuid):"},{"line_number":727,"context_line":"            return"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_09093b2b","line":726,"range":{"start_line":726,"start_character":35,"end_line":726,"end_character":48},"in_reply_to":"3f4b6375_f3683abb","updated":"2017-10-19 18:22:06.000000000","message":"If you can\u0027t get in touch with placement, you won\u0027t be able to delete the inventory anyway.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":724,"context_line":"        this results in a 406, fail over to a PUT."},{"line_number":725,"context_line":"        \"\"\""},{"line_number":726,"context_line":"        if not self._provider_tree.has_inventory(rp_uuid):"},{"line_number":727,"context_line":"            return"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":730,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_130d1637","line":727,"updated":"2017-10-18 09:52:49.000000000","message":"This patch explicitly return None in some cases so for consistency this should return None explicitly too.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b0ed30d61d1fdcb0fd8fd41e1ff9f52eea8a0252","unresolved":false,"context_lines":[{"line_number":724,"context_line":"        this results in a 406, fail over to a PUT."},{"line_number":725,"context_line":"        \"\"\""},{"line_number":726,"context_line":"        if not self._provider_tree.has_inventory(rp_uuid):"},{"line_number":727,"context_line":"            return"},{"line_number":728,"context_line":""},{"line_number":729,"context_line":"        curr \u003d self._refresh_and_get_inventory(rp_uuid)"},{"line_number":730,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_0e14a14d","line":727,"in_reply_to":"3f4b6375_130d1637","updated":"2017-10-19 18:22:06.000000000","message":"ok.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"03f063ce1fcbf34ca1a78c0aaaa3700ca81695f1","unresolved":false,"context_lines":[{"line_number":537,"context_line":"        result \u003d self.get(url)"},{"line_number":538,"context_line":"        if not result:"},{"line_number":539,"context_line":"            return None"},{"line_number":540,"context_line":"        return result.json()"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":"    def _refresh_and_get_inventory(self, rp_uuid):"},{"line_number":543,"context_line":"        \"\"\"Helper method that retrieves the current inventory for the supplied"}],"source_content_type":"text/x-python","patch_set":24,"id":"3f4b6375_928c1280","line":540,"range":{"start_line":540,"start_character":8,"end_line":540,"end_character":28},"updated":"2017-10-20 19:21:00.000000000","message":"If the result is a 4xx or 5xx, result.json() is likely to raise TypeError or ValueError.  That okay?","commit_id":"4b5608ecb99b3103ed6f6293b8969bc138185bc9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"f40b36c251d48b1c0e730324070104a4f5e3e5f3","unresolved":false,"context_lines":[{"line_number":537,"context_line":"        result \u003d self.get(url)"},{"line_number":538,"context_line":"        if not result:"},{"line_number":539,"context_line":"            return None"},{"line_number":540,"context_line":"        return result.json()"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":"    def _refresh_and_get_inventory(self, rp_uuid):"},{"line_number":543,"context_line":"        \"\"\"Helper method that retrieves the current inventory for the supplied"}],"source_content_type":"text/x-python","patch_set":24,"id":"3f4b6375_738ab81b","line":540,"range":{"start_line":540,"start_character":8,"end_line":540,"end_character":28},"in_reply_to":"3f4b6375_928c1280","updated":"2017-10-20 22:27:35.000000000","message":"result can only be between 200 and 299 if we get here. It\u0027s a magic thingee about checking the requests.Request result...","commit_id":"4b5608ecb99b3103ed6f6293b8969bc138185bc9"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"da33831c4cac462e51e045b493a637e7750e8e7c","unresolved":false,"context_lines":[{"line_number":549,"context_line":"        return empty inventories."},{"line_number":550,"context_line":"        \"\"\""},{"line_number":551,"context_line":"        curr \u003d self._get_inventory(rp_uuid)"},{"line_number":552,"context_line":"        if curr is None:"},{"line_number":553,"context_line":"            return None"},{"line_number":554,"context_line":""},{"line_number":555,"context_line":"        cur_gen \u003d curr[\u0027resource_provider_generation\u0027]"},{"line_number":556,"context_line":"        if cur_gen:"}],"source_content_type":"text/x-python","patch_set":24,"id":"3f4b6375_fb48d3cc","line":553,"range":{"start_line":552,"start_character":1,"end_line":553,"end_character":23},"updated":"2017-10-20 09:20:40.000000000","message":"This change solves at least some part of the problem of an unavailable placement during _get_inventory as this way we are not trying to cache an empty inventory in this case but we blow up. Thanks.\nI agree that the need for a retry should be addressed separately. Do we already have a plan / patch to do that?","commit_id":"4b5608ecb99b3103ed6f6293b8969bc138185bc9"}],"nova/tests/functional/api/openstack/placement/test_report_client.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def __init__(self):"},{"line_number":36,"context_line":"        super(NoAuthReportClient, self).__init__()"},{"line_number":37,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":38,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":39,"context_line":"        # Supply our own session so the wsgi-intercept can intercept"},{"line_number":40,"context_line":"        # the right thing. Another option would be to use the direct"},{"line_number":41,"context_line":"        # urllib3 interceptor."}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_53d6ee51","line":38,"range":{"start_line":37,"start_character":0,"end_line":38,"end_character":58},"updated":"2017-10-18 09:52:49.000000000","message":"The base class already defines these fields","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"eeb2e7f05476a4744a7dc509e1dc1a0ca45e7f2c","unresolved":false,"context_lines":[{"line_number":34,"context_line":""},{"line_number":35,"context_line":"    def __init__(self):"},{"line_number":36,"context_line":"        super(NoAuthReportClient, self).__init__()"},{"line_number":37,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":38,"context_line":"        self._provider_tree \u003d provider_tree.ProviderTree()"},{"line_number":39,"context_line":"        # Supply our own session so the wsgi-intercept can intercept"},{"line_number":40,"context_line":"        # the right thing. Another option would be to use the direct"},{"line_number":41,"context_line":"        # urllib3 interceptor."}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_49d2935e","line":38,"range":{"start_line":37,"start_character":0,"end_line":38,"end_character":58},"in_reply_to":"3f4b6375_53d6ee51","updated":"2017-10-19 18:33:16.000000000","message":"Done","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"}],"nova/tests/unit/scheduler/client/test_report.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"1071e927447bef3821283356083f62081224c8af","unresolved":false,"context_lines":[{"line_number":208,"context_line":"                    \u0027allocation_ratio\u0027: cn.disk_allocation_ratio,"},{"line_number":209,"context_line":"                },"},{"line_number":210,"context_line":"            }"},{"line_number":211,"context_line":"        generation \u003d generation_override or 1"},{"line_number":212,"context_line":"        rp \u003d self.client._provider_tree.new_root("},{"line_number":213,"context_line":"            cn.hypervisor_hostname,"},{"line_number":214,"context_line":"            cn.uuid,"}],"source_content_type":"text/x-python","patch_set":15,"id":"5f201791_28f23d71","line":211,"range":{"start_line":211,"start_character":8,"end_line":211,"end_character":45},"updated":"2017-06-26 11:00:46.000000000","message":"This is a funny way to do this, but it\u0027s consistent with the \u0027resources_override\u0027 bit so meh","commit_id":"043b15eb63cf52d8fff80506d7443b0984e63d3c"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"01ee6323abce8e7d92a74d73c1c5b61be0e5736f","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        resources \u003d resources_override"},{"line_number":184,"context_line":"        if resources_override is None:"},{"line_number":185,"context_line":"            resources \u003d {"},{"line_number":186,"context_line":"                \u0027VCPU\u0027: {"},{"line_number":187,"context_line":"                    \u0027total\u0027: cn.vcpus,"},{"line_number":188,"context_line":"                    \u0027reserved\u0027: 0,"},{"line_number":189,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":190,"context_line":"                    \u0027max_unit\u0027: cn.vcpus,"},{"line_number":191,"context_line":"                    \u0027step_size\u0027: 1,"},{"line_number":192,"context_line":"                    \u0027allocation_ratio\u0027: cn.cpu_allocation_ratio,"},{"line_number":193,"context_line":"                },"},{"line_number":194,"context_line":"                \u0027MEMORY_MB\u0027: {"},{"line_number":195,"context_line":"                    \u0027total\u0027: cn.memory_mb,"},{"line_number":196,"context_line":"                    \u0027reserved\u0027: 512,"},{"line_number":197,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":198,"context_line":"                    \u0027max_unit\u0027: cn.memory_mb,"},{"line_number":199,"context_line":"                    \u0027step_size\u0027: 1,"},{"line_number":200,"context_line":"                    \u0027allocation_ratio\u0027: cn.ram_allocation_ratio,"},{"line_number":201,"context_line":"                },"},{"line_number":202,"context_line":"                \u0027DISK_GB\u0027: {"},{"line_number":203,"context_line":"                    \u0027total\u0027: cn.local_gb,"},{"line_number":204,"context_line":"                    \u0027reserved\u0027: 0,"}],"source_content_type":"text/x-python","patch_set":16,"id":"9f436f4f_b87bb8bc","line":201,"range":{"start_line":186,"start_character":14,"end_line":201,"end_character":18},"updated":"2017-08-17 17:52:28.000000000","message":"just as a taught for the future but im not sure we will want to have a global memory or vcpu resource provider long term. once we have socket,pcpu and numa providers these two attributes will need to be moved to be children of those resource providers.\n\nor to say that another way, we may want to model the total system vcpu and memory as aggreations of inventories numa afined vcpu and memory at some point instead of doing allocation directly form them.\n\nin its present form though this looks fine to me.","commit_id":"5209903df1c78278de036d9515078c39634906fc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"c8c7d26ccc0509980fc1d3ef4fde38e5bc5a809b","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        resources \u003d resources_override"},{"line_number":184,"context_line":"        if resources_override is None:"},{"line_number":185,"context_line":"            resources \u003d {"},{"line_number":186,"context_line":"                \u0027VCPU\u0027: {"},{"line_number":187,"context_line":"                    \u0027total\u0027: cn.vcpus,"},{"line_number":188,"context_line":"                    \u0027reserved\u0027: 0,"},{"line_number":189,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":190,"context_line":"                    \u0027max_unit\u0027: cn.vcpus,"},{"line_number":191,"context_line":"                    \u0027step_size\u0027: 1,"},{"line_number":192,"context_line":"                    \u0027allocation_ratio\u0027: cn.cpu_allocation_ratio,"},{"line_number":193,"context_line":"                },"},{"line_number":194,"context_line":"                \u0027MEMORY_MB\u0027: {"},{"line_number":195,"context_line":"                    \u0027total\u0027: cn.memory_mb,"},{"line_number":196,"context_line":"                    \u0027reserved\u0027: 512,"},{"line_number":197,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":198,"context_line":"                    \u0027max_unit\u0027: cn.memory_mb,"},{"line_number":199,"context_line":"                    \u0027step_size\u0027: 1,"},{"line_number":200,"context_line":"                    \u0027allocation_ratio\u0027: cn.ram_allocation_ratio,"},{"line_number":201,"context_line":"                },"},{"line_number":202,"context_line":"                \u0027DISK_GB\u0027: {"},{"line_number":203,"context_line":"                    \u0027total\u0027: cn.local_gb,"},{"line_number":204,"context_line":"                    \u0027reserved\u0027: 0,"}],"source_content_type":"text/x-python","patch_set":16,"id":"7f515b1d_9b0d8e92","line":201,"range":{"start_line":186,"start_character":14,"end_line":201,"end_character":18},"in_reply_to":"9f436f4f_b87bb8bc","updated":"2017-09-22 12:54:13.000000000","message":"It seems that the spec also mention this problem and suggest one particular solution (which seems to be debated):\nhttps://review.openstack.org/#/c/505209/3/specs/queens/approved/nested-resource-providers.rst@104","commit_id":"5209903df1c78278de036d9515078c39634906fc"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6bed8cf581538fc0ef8ff04d96abbfcc45715d4d","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        resources \u003d resources_override"},{"line_number":184,"context_line":"        if resources_override is None:"},{"line_number":185,"context_line":"            resources \u003d {"},{"line_number":186,"context_line":"                \u0027VCPU\u0027: {"},{"line_number":187,"context_line":"                    \u0027total\u0027: cn.vcpus,"},{"line_number":188,"context_line":"                    \u0027reserved\u0027: 0,"},{"line_number":189,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":190,"context_line":"                    \u0027max_unit\u0027: cn.vcpus,"},{"line_number":191,"context_line":"                    \u0027step_size\u0027: 1,"},{"line_number":192,"context_line":"                    \u0027allocation_ratio\u0027: cn.cpu_allocation_ratio,"},{"line_number":193,"context_line":"                },"},{"line_number":194,"context_line":"                \u0027MEMORY_MB\u0027: {"},{"line_number":195,"context_line":"                    \u0027total\u0027: cn.memory_mb,"},{"line_number":196,"context_line":"                    \u0027reserved\u0027: 512,"},{"line_number":197,"context_line":"                    \u0027min_unit\u0027: 1,"},{"line_number":198,"context_line":"                    \u0027max_unit\u0027: cn.memory_mb,"},{"line_number":199,"context_line":"                    \u0027step_size\u0027: 1,"},{"line_number":200,"context_line":"                    \u0027allocation_ratio\u0027: cn.ram_allocation_ratio,"},{"line_number":201,"context_line":"                },"},{"line_number":202,"context_line":"                \u0027DISK_GB\u0027: {"},{"line_number":203,"context_line":"                    \u0027total\u0027: cn.local_gb,"},{"line_number":204,"context_line":"                    \u0027reserved\u0027: 0,"}],"source_content_type":"text/x-python","patch_set":16,"id":"7f515b1d_3ed79df0","line":201,"range":{"start_line":186,"start_character":14,"end_line":201,"end_character":18},"in_reply_to":"9f436f4f_b87bb8bc","updated":"2017-09-22 19:51:02.000000000","message":"Sure, though nothing about this setup prevents that in the future :) In the future, if a NUMA node or a socket or whatever wants to provide MEMORY_MB resource, it can do so. It will be up to the virt driver in conjunction with the generic device manager stuff to create inventory records against the appropriate provider of that resource.","commit_id":"5209903df1c78278de036d9515078c39634906fc"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":1193,"context_line":"        # that includes the placement request id and return None"},{"line_number":1194,"context_line":"        # from _get_resource_provider()"},{"line_number":1195,"context_line":"        self.assertTrue(logging_mock.called)"},{"line_number":1196,"context_line":"        self.assertEqual(uuids.request_id,"},{"line_number":1197,"context_line":"                        logging_mock.call_args[0][1][\u0027placement_req_id\u0027])"},{"line_number":1198,"context_line":"        self.assertIsNone(result)"},{"line_number":1199,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_53e14ed0","side":"PARENT","line":1196,"updated":"2017-10-18 09:52:49.000000000","message":"Why did you remove this? It seems that the request_id is still in the log message.","commit_id":"ddaff6dc5de7a54d83f763d3f6f7c7115bac0369"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"eeb2e7f05476a4744a7dc509e1dc1a0ca45e7f2c","unresolved":false,"context_lines":[{"line_number":1193,"context_line":"        # that includes the placement request id and return None"},{"line_number":1194,"context_line":"        # from _get_resource_provider()"},{"line_number":1195,"context_line":"        self.assertTrue(logging_mock.called)"},{"line_number":1196,"context_line":"        self.assertEqual(uuids.request_id,"},{"line_number":1197,"context_line":"                        logging_mock.call_args[0][1][\u0027placement_req_id\u0027])"},{"line_number":1198,"context_line":"        self.assertIsNone(result)"},{"line_number":1199,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_e9137f0c","side":"PARENT","line":1196,"in_reply_to":"3f4b6375_53e14ed0","updated":"2017-10-19 18:33:16.000000000","message":"Not sure. Probably trying to debug something related and forgot to put it back. Will put it back.","commit_id":"ddaff6dc5de7a54d83f763d3f6f7c7115bac0369"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c6623aa1d60a9a8adcf9e882db7abbcc5695d071","unresolved":false,"context_lines":[{"line_number":1193,"context_line":"        # that includes the placement request id and return None"},{"line_number":1194,"context_line":"        # from _get_resource_provider()"},{"line_number":1195,"context_line":"        self.assertTrue(logging_mock.called)"},{"line_number":1196,"context_line":"        self.assertEqual(uuids.request_id,"},{"line_number":1197,"context_line":"                        logging_mock.call_args[0][1][\u0027placement_req_id\u0027])"},{"line_number":1198,"context_line":"        self.assertIsNone(result)"},{"line_number":1199,"context_line":""}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_c9da03e8","side":"PARENT","line":1196,"in_reply_to":"3f4b6375_e9137f0c","updated":"2017-10-19 18:54:42.000000000","message":"Done","commit_id":"ddaff6dc5de7a54d83f763d3f6f7c7115bac0369"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":2059,"context_line":"        # No cache invalidation"},{"line_number":2060,"context_line":"        self.assertIn(uuid, self.client._resource_providers)"},{"line_number":2061,"context_line":"        # Logged the request id in the log messages"},{"line_number":2062,"context_line":"        self.assertEqual(uuids.request_id,"},{"line_number":2063,"context_line":"                         mock_info.call_args[0][1][\u0027placement_req_id\u0027])"},{"line_number":2064,"context_line":""},{"line_number":2065,"context_line":"    @mock.patch.object(report.LOG, \u0027warning\u0027)"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_3ee699ea","side":"PARENT","line":2062,"updated":"2017-10-18 09:52:49.000000000","message":"In some test you kept in some other test you removed this assert. Why?","commit_id":"ddaff6dc5de7a54d83f763d3f6f7c7115bac0369"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c6623aa1d60a9a8adcf9e882db7abbcc5695d071","unresolved":false,"context_lines":[{"line_number":2059,"context_line":"        # No cache invalidation"},{"line_number":2060,"context_line":"        self.assertIn(uuid, self.client._resource_providers)"},{"line_number":2061,"context_line":"        # Logged the request id in the log messages"},{"line_number":2062,"context_line":"        self.assertEqual(uuids.request_id,"},{"line_number":2063,"context_line":"                         mock_info.call_args[0][1][\u0027placement_req_id\u0027])"},{"line_number":2064,"context_line":""},{"line_number":2065,"context_line":"    @mock.patch.object(report.LOG, \u0027warning\u0027)"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_296877f3","side":"PARENT","line":2062,"in_reply_to":"3f4b6375_3ee699ea","updated":"2017-10-19 18:54:42.000000000","message":"We don\u0027t need multiple tests testing the same thing. I removed repetitive stuff from unit tests that were not germane to the thing being tested (i.e. the point of the test).","commit_id":"ddaff6dc5de7a54d83f763d3f6f7c7115bac0369"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":1769,"context_line":"    def test_delete_inventory_inventory_in_use(self, mock_get, mock_delete,"},{"line_number":1770,"context_line":"            mock_warn):"},{"line_number":1771,"context_line":"        cn \u003d self.compute_node"},{"line_number":1772,"context_line":"        # Make sure the ResourceProvider exists for preventing to call the API"},{"line_number":1773,"context_line":"        self._init_provider_tree()"},{"line_number":1774,"context_line":""},{"line_number":1775,"context_line":"        mock_get.return_value.json.return_value \u003d {"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_5e2cb598","line":1772,"range":{"start_line":1772,"start_character":24,"end_line":1772,"end_character":40},"updated":"2017-10-18 09:52:49.000000000","message":"Either change it everywhere or nowhere :)","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c6623aa1d60a9a8adcf9e882db7abbcc5695d071","unresolved":false,"context_lines":[{"line_number":1769,"context_line":"    def test_delete_inventory_inventory_in_use(self, mock_get, mock_delete,"},{"line_number":1770,"context_line":"            mock_warn):"},{"line_number":1771,"context_line":"        cn \u003d self.compute_node"},{"line_number":1772,"context_line":"        # Make sure the ResourceProvider exists for preventing to call the API"},{"line_number":1773,"context_line":"        self._init_provider_tree()"},{"line_number":1774,"context_line":""},{"line_number":1775,"context_line":"        mock_get.return_value.json.return_value \u003d {"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_49f05368","line":1772,"range":{"start_line":1772,"start_character":24,"end_line":1772,"end_character":40},"in_reply_to":"3f4b6375_5e2cb598","updated":"2017-10-19 18:54:42.000000000","message":"Honestly, this patch is so old that I don\u0027t really know why this change was made (or even if I made the change). But I\u0027ll reset this to the original.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"d26a32a67899546ad77b24ce06ed29c558bca394","unresolved":false,"context_lines":[{"line_number":1968,"context_line":"        self._init_provider_tree()"},{"line_number":1969,"context_line":"        new_vcpus_total \u003d 240"},{"line_number":1970,"context_line":""},{"line_number":1971,"context_line":"        mock_get.return_value.json.return_value \u003d {"},{"line_number":1972,"context_line":"            \u0027resource_provider_generation\u0027: 43,"},{"line_number":1973,"context_line":"            \u0027inventories\u0027: {"},{"line_number":1974,"context_line":"                \u0027VCPU\u0027: {\u0027total\u0027: 16},"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_ded8a580","line":1971,"range":{"start_line":1971,"start_character":0,"end_line":1971,"end_character":51},"updated":"2017-10-18 09:52:49.000000000","message":"I think another test should be created where get() returns only {\u0027inventories\u0027: {}} as placement is unavailable to see if the update does not blow up.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"c6623aa1d60a9a8adcf9e882db7abbcc5695d071","unresolved":false,"context_lines":[{"line_number":1968,"context_line":"        self._init_provider_tree()"},{"line_number":1969,"context_line":"        new_vcpus_total \u003d 240"},{"line_number":1970,"context_line":""},{"line_number":1971,"context_line":"        mock_get.return_value.json.return_value \u003d {"},{"line_number":1972,"context_line":"            \u0027resource_provider_generation\u0027: 43,"},{"line_number":1973,"context_line":"            \u0027inventories\u0027: {"},{"line_number":1974,"context_line":"                \u0027VCPU\u0027: {\u0027total\u0027: 16},"}],"source_content_type":"text/x-python","patch_set":23,"id":"3f4b6375_099ffb03","line":1971,"range":{"start_line":1971,"start_character":0,"end_line":1971,"end_character":51},"in_reply_to":"3f4b6375_ded8a580","updated":"2017-10-19 18:54:42.000000000","message":"I\u0027ve updated the tests above to return an empty inventories dict.","commit_id":"9e12f1991aa0d95a965f5b07892dcddb4f3ab2e3"}]}
