)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5df0cc4a1be45003f7eda33f86f5cb6ea35d38c9","unresolved":true,"context_lines":[{"line_number":7,"context_line":"Allow extending an existing instance allocation"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"This patch add a new function to the SchedulerReportClient that allows"},{"line_number":10,"context_line":"extending an existing instance allocation with extra resources."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Change-Id: I1bdc5e4971204fbfbf0dfcd232cabf2cfe02a966"},{"line_number":13,"context_line":"Blueprint: support-interface-attach-with-qos-ports"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"40bbeb19_93b6e108","line":10,"updated":"2021-01-26 16:46:44.000000000","message":"you\u0027ll bump the generation bit, but since you verify it (by looking at the placement API return), that looks good to me.","commit_id":"54865a17cddd4a358983e9a897f242dc413c7ec1"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"44a741e916b57c47b9484e856a0b3bf560ed23cd","unresolved":false,"context_lines":[{"line_number":1643,"context_line":"                raise Retry(\u0027claim_resources\u0027, reason)"},{"line_number":1644,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":1645,"context_line":""},{"line_number":1646,"context_line":"    def add_resources_to_instance_allocation("},{"line_number":1647,"context_line":"            self, context, consumer_uuid, resources):"},{"line_number":1648,"context_line":"        \"\"\"Adds certain resources to the current allocation of the"},{"line_number":1649,"context_line":"        consumer."},{"line_number":1650,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7f6b1bfe_09bdf964","line":1647,"range":{"start_line":1646,"start_character":4,"end_line":1647,"end_character":53},"updated":"2020-10-15 09:32:46.000000000","message":"nit:\n\n  def add_resources_to_instance_allocation(\n      self, context, consumer_uuid, resources,\n  ):\n\n?\n\nHere and below. Type hints would be lovely too :)","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3a59759955e9fe5903735ea194abf98d69a604ce","unresolved":false,"context_lines":[{"line_number":1643,"context_line":"                raise Retry(\u0027claim_resources\u0027, reason)"},{"line_number":1644,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":1645,"context_line":""},{"line_number":1646,"context_line":"    def add_resources_to_instance_allocation("},{"line_number":1647,"context_line":"            self, context, consumer_uuid, resources):"},{"line_number":1648,"context_line":"        \"\"\"Adds certain resources to the current allocation of the"},{"line_number":1649,"context_line":"        consumer."},{"line_number":1650,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"544d44e2_ca1f9e70","line":1647,"range":{"start_line":1646,"start_character":4,"end_line":1647,"end_character":53},"in_reply_to":"7f6b1bfe_09bdf964","updated":"2020-11-30 15:06:54.000000000","message":"Done","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"44a741e916b57c47b9484e856a0b3bf560ed23cd","unresolved":false,"context_lines":[{"line_number":1682,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1683,"context_line":"            error_reason \u003d _(\"Cannot add resources %s to the allocation \""},{"line_number":1684,"context_line":"                             \"due to multiple successive generation conflicts \""},{"line_number":1685,"context_line":"                             \"in placement.\")"},{"line_number":1686,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1687,"context_line":"                consumer_uuid\u003dconsumer_uuid,"},{"line_number":1688,"context_line":"                error\u003derror_reason % resources)"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f6b1bfe_69762ddb","line":1685,"updated":"2020-10-15 09:32:46.000000000","message":"It could be other issues, right? You\u0027re only checking and retrying for \u0027placement.concurrent_update\u0027. Could we get a 404 or some other error?","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3a59759955e9fe5903735ea194abf98d69a604ce","unresolved":false,"context_lines":[{"line_number":1682,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1683,"context_line":"            error_reason \u003d _(\"Cannot add resources %s to the allocation \""},{"line_number":1684,"context_line":"                             \"due to multiple successive generation conflicts \""},{"line_number":1685,"context_line":"                             \"in placement.\")"},{"line_number":1686,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1687,"context_line":"                consumer_uuid\u003dconsumer_uuid,"},{"line_number":1688,"context_line":"                error\u003derror_reason % resources)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1062266c_ea7b9005","line":1685,"in_reply_to":"7f6b1bfe_69762ddb","updated":"2020-11-30 15:06:54.000000000","message":"You are correct. I had a bug in the helper. See L1721. I fixed it in a way that now False only returned by the @retries decorator, making the error message here correct.","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"44a741e916b57c47b9484e856a0b3bf560ed23cd","unresolved":false,"context_lines":[{"line_number":1691,"context_line":"    def _add_resources_to_instance_allocation("},{"line_number":1692,"context_line":"            self, context, consumer_uuid, resources):"},{"line_number":1693,"context_line":""},{"line_number":1694,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer("},{"line_number":1695,"context_line":"            context, consumer_uuid)"},{"line_number":1696,"context_line":"        for rp_uuid in resources:"},{"line_number":1697,"context_line":"            if rp_uuid not in current_allocs[\u0027allocations\u0027]:"},{"line_number":1698,"context_line":"                current_allocs[\u0027allocations\u0027][rp_uuid] \u003d {\u0027resources\u0027: {}}"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f6b1bfe_497371e8","line":1695,"range":{"start_line":1694,"start_character":0,"end_line":1695,"end_character":35},"updated":"2020-10-15 09:32:46.000000000","message":"would fit on one line?","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3a59759955e9fe5903735ea194abf98d69a604ce","unresolved":false,"context_lines":[{"line_number":1691,"context_line":"    def _add_resources_to_instance_allocation("},{"line_number":1692,"context_line":"            self, context, consumer_uuid, resources):"},{"line_number":1693,"context_line":""},{"line_number":1694,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer("},{"line_number":1695,"context_line":"            context, consumer_uuid)"},{"line_number":1696,"context_line":"        for rp_uuid in resources:"},{"line_number":1697,"context_line":"            if rp_uuid not in current_allocs[\u0027allocations\u0027]:"},{"line_number":1698,"context_line":"                current_allocs[\u0027allocations\u0027][rp_uuid] \u003d {\u0027resources\u0027: {}}"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f1c13f0_328a22d3","line":1695,"range":{"start_line":1694,"start_character":0,"end_line":1695,"end_character":35},"in_reply_to":"7f6b1bfe_497371e8","updated":"2020-11-30 15:06:54.000000000","message":"Done","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"44a741e916b57c47b9484e856a0b3bf560ed23cd","unresolved":false,"context_lines":[{"line_number":1704,"context_line":"                else:"},{"line_number":1705,"context_line":"                    alloc_on_rp[rc] \u003d amount"},{"line_number":1706,"context_line":""},{"line_number":1707,"context_line":"        r \u003d self._put_allocations("},{"line_number":1708,"context_line":"            context, consumer_uuid, current_allocs)"},{"line_number":1709,"context_line":""},{"line_number":1710,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":1711,"context_line":"            err \u003d r.json()[\u0027errors\u0027][0]"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f6b1bfe_897d89b3","line":1708,"range":{"start_line":1707,"start_character":0,"end_line":1708,"end_character":51},"updated":"2020-10-15 09:32:46.000000000","message":"one line?","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3a59759955e9fe5903735ea194abf98d69a604ce","unresolved":false,"context_lines":[{"line_number":1704,"context_line":"                else:"},{"line_number":1705,"context_line":"                    alloc_on_rp[rc] \u003d amount"},{"line_number":1706,"context_line":""},{"line_number":1707,"context_line":"        r \u003d self._put_allocations("},{"line_number":1708,"context_line":"            context, consumer_uuid, current_allocs)"},{"line_number":1709,"context_line":""},{"line_number":1710,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":1711,"context_line":"            err \u003d r.json()[\u0027errors\u0027][0]"}],"source_content_type":"text/x-python","patch_set":3,"id":"a8022930_86336b9f","line":1708,"range":{"start_line":1707,"start_character":0,"end_line":1708,"end_character":51},"in_reply_to":"7f6b1bfe_897d89b3","updated":"2020-11-30 15:06:54.000000000","message":"Done","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"44a741e916b57c47b9484e856a0b3bf560ed23cd","unresolved":false,"context_lines":[{"line_number":1710,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":1711,"context_line":"            err \u003d r.json()[\u0027errors\u0027][0]"},{"line_number":1712,"context_line":"            if err[\u0027code\u0027] \u003d\u003d \u0027placement.concurrent_update\u0027:"},{"line_number":1713,"context_line":"                reason \u003d (\u0027another process changed the resource providers or \u0027"},{"line_number":1714,"context_line":"                          \u0027the consumer involved in our attempt to update \u0027"},{"line_number":1715,"context_line":"                          \u0027allocations for consumer %s so we cannot add \u0027"},{"line_number":1716,"context_line":"                          \u0027resources %s to the current allocation %s\u0027 %"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f6b1bfe_e94b5d84","line":1713,"range":{"start_line":1713,"start_character":26,"end_line":1713,"end_character":27},"updated":"2020-10-15 09:32:46.000000000","message":"style nit: hanging indent instead, like below?","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3a59759955e9fe5903735ea194abf98d69a604ce","unresolved":false,"context_lines":[{"line_number":1710,"context_line":"        if r.status_code !\u003d 204:"},{"line_number":1711,"context_line":"            err \u003d r.json()[\u0027errors\u0027][0]"},{"line_number":1712,"context_line":"            if err[\u0027code\u0027] \u003d\u003d \u0027placement.concurrent_update\u0027:"},{"line_number":1713,"context_line":"                reason \u003d (\u0027another process changed the resource providers or \u0027"},{"line_number":1714,"context_line":"                          \u0027the consumer involved in our attempt to update \u0027"},{"line_number":1715,"context_line":"                          \u0027allocations for consumer %s so we cannot add \u0027"},{"line_number":1716,"context_line":"                          \u0027resources %s to the current allocation %s\u0027 %"}],"source_content_type":"text/x-python","patch_set":3,"id":"0310e6b5_60360715","line":1713,"range":{"start_line":1713,"start_character":26,"end_line":1713,"end_character":27},"in_reply_to":"7f6b1bfe_e94b5d84","updated":"2020-11-30 15:06:54.000000000","message":"Done.","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"44a741e916b57c47b9484e856a0b3bf560ed23cd","unresolved":false,"context_lines":[{"line_number":1718,"context_line":""},{"line_number":1719,"context_line":"                raise Retry("},{"line_number":1720,"context_line":"                    \u0027_add_resources_to_instance_allocation\u0027, reason)"},{"line_number":1721,"context_line":""},{"line_number":1722,"context_line":"        return True"},{"line_number":1723,"context_line":""},{"line_number":1724,"context_line":"    def remove_resources_from_instance_allocation("}],"source_content_type":"text/x-python","patch_set":3,"id":"7f6b1bfe_c9c2e1e9","line":1721,"updated":"2020-10-15 09:32:46.000000000","message":"An explicit \u0027return False\u0027 here would be nice","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3a59759955e9fe5903735ea194abf98d69a604ce","unresolved":false,"context_lines":[{"line_number":1718,"context_line":""},{"line_number":1719,"context_line":"                raise Retry("},{"line_number":1720,"context_line":"                    \u0027_add_resources_to_instance_allocation\u0027, reason)"},{"line_number":1721,"context_line":""},{"line_number":1722,"context_line":"        return True"},{"line_number":1723,"context_line":""},{"line_number":1724,"context_line":"    def remove_resources_from_instance_allocation("}],"source_content_type":"text/x-python","patch_set":3,"id":"fb48933f_168f3ff1","line":1721,"in_reply_to":"7f6b1bfe_c9c2e1e9","updated":"2020-11-30 15:06:54.000000000","message":"This is actually a bug. Other than concurrent_update this function returns True. Now I changed this to raise instead. This also makes the add_resources_to_instance_allocation() simpler.","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"c5b2df4874e489359c6075f7924abb2a28ee0bfb","unresolved":true,"context_lines":[{"line_number":1644,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":1645,"context_line":""},{"line_number":1646,"context_line":"    def add_resources_to_instance_allocation("},{"line_number":1647,"context_line":"            self,"},{"line_number":1648,"context_line":"            context: nova_context.RequestContext,"},{"line_number":1649,"context_line":"            consumer_uuid: str,"},{"line_number":1650,"context_line":"            resources: ty.Dict[str, ty.Dict[str, ty.Dict[str, int]]],"}],"source_content_type":"text/x-python","patch_set":5,"id":"1078f52e_f6ad8774","line":1647,"range":{"start_line":1647,"start_character":8,"end_line":1647,"end_character":12},"updated":"2020-12-15 15:07:42.000000000","message":"nit","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"31c3ba909b07fa839ee4c7cb1c39a725b3bf31e2","unresolved":false,"context_lines":[{"line_number":1644,"context_line":"        return r.status_code \u003d\u003d 204"},{"line_number":1645,"context_line":""},{"line_number":1646,"context_line":"    def add_resources_to_instance_allocation("},{"line_number":1647,"context_line":"            self,"},{"line_number":1648,"context_line":"            context: nova_context.RequestContext,"},{"line_number":1649,"context_line":"            consumer_uuid: str,"},{"line_number":1650,"context_line":"            resources: ty.Dict[str, ty.Dict[str, ty.Dict[str, int]]],"}],"source_content_type":"text/x-python","patch_set":5,"id":"00682f36_6a82d8fe","line":1647,"range":{"start_line":1647,"start_character":8,"end_line":1647,"end_character":12},"in_reply_to":"1078f52e_f6ad8774","updated":"2020-12-16 15:33:23.000000000","message":"Done","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"c5b2df4874e489359c6075f7924abb2a28ee0bfb","unresolved":true,"context_lines":[{"line_number":1672,"context_line":"        :raises AllocationUpdateFailed: if there was multiple generation"},{"line_number":1673,"context_line":"            conflict and we run out of retires."},{"line_number":1674,"context_line":"        :raises ConsumerAllocationRetrievalFailed: If the current allocation"},{"line_number":1675,"context_line":"                cannot be read from placement."},{"line_number":1676,"context_line":"        :raises: keystoneauth1.exceptions.base.ClientException on failure to"},{"line_number":1677,"context_line":"                 communicate with the placement API"},{"line_number":1678,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"d536a8e8_3a0b4ba6","line":1675,"range":{"start_line":1675,"start_character":12,"end_line":1675,"end_character":16},"updated":"2020-12-15 15:07:42.000000000","message":"nit","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"31c3ba909b07fa839ee4c7cb1c39a725b3bf31e2","unresolved":false,"context_lines":[{"line_number":1672,"context_line":"        :raises AllocationUpdateFailed: if there was multiple generation"},{"line_number":1673,"context_line":"            conflict and we run out of retires."},{"line_number":1674,"context_line":"        :raises ConsumerAllocationRetrievalFailed: If the current allocation"},{"line_number":1675,"context_line":"                cannot be read from placement."},{"line_number":1676,"context_line":"        :raises: keystoneauth1.exceptions.base.ClientException on failure to"},{"line_number":1677,"context_line":"                 communicate with the placement API"},{"line_number":1678,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"f5b2e239_307783b5","line":1675,"range":{"start_line":1675,"start_character":12,"end_line":1675,"end_character":16},"in_reply_to":"d536a8e8_3a0b4ba6","updated":"2020-12-16 15:33:23.000000000","message":"Done","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"c5b2df4874e489359c6075f7924abb2a28ee0bfb","unresolved":true,"context_lines":[{"line_number":1686,"context_line":"        # retries due to conflict. Convert that return value to an exception"},{"line_number":1687,"context_line":"        # too."},{"line_number":1688,"context_line":"        if not self._add_resources_to_instance_allocation("},{"line_number":1689,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1690,"context_line":"            error_reason \u003d _("},{"line_number":1691,"context_line":"                \"Cannot add resources %s to the allocation due to multiple \""},{"line_number":1692,"context_line":"                \"successive generation conflicts in placement.\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"bd69517c_f1406030","line":1689,"range":{"start_line":1689,"start_character":12,"end_line":1689,"end_character":51},"updated":"2020-12-15 15:07:42.000000000","message":"nit:\n\n  if not self._add_resources_to_instance_allocation(\n      context, consumer_uuid, resources,\n  ):","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"31c3ba909b07fa839ee4c7cb1c39a725b3bf31e2","unresolved":false,"context_lines":[{"line_number":1686,"context_line":"        # retries due to conflict. Convert that return value to an exception"},{"line_number":1687,"context_line":"        # too."},{"line_number":1688,"context_line":"        if not self._add_resources_to_instance_allocation("},{"line_number":1689,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1690,"context_line":"            error_reason \u003d _("},{"line_number":1691,"context_line":"                \"Cannot add resources %s to the allocation due to multiple \""},{"line_number":1692,"context_line":"                \"successive generation conflicts in placement.\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"86ee0b2b_cf583ba6","line":1689,"range":{"start_line":1689,"start_character":12,"end_line":1689,"end_character":51},"in_reply_to":"bd69517c_f1406030","updated":"2020-12-16 15:33:23.000000000","message":"Done","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"c5b2df4874e489359c6075f7924abb2a28ee0bfb","unresolved":true,"context_lines":[{"line_number":1696,"context_line":""},{"line_number":1697,"context_line":"    @retries"},{"line_number":1698,"context_line":"    def _add_resources_to_instance_allocation("},{"line_number":1699,"context_line":"            self, context, consumer_uuid, resources):"},{"line_number":1700,"context_line":""},{"line_number":1701,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1702,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"1b42ca52_58b34a84","line":1699,"updated":"2020-12-15 15:07:42.000000000","message":"nit: you have the type hints above so it would be easy copy them here, if you wanted","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"31c3ba909b07fa839ee4c7cb1c39a725b3bf31e2","unresolved":false,"context_lines":[{"line_number":1696,"context_line":""},{"line_number":1697,"context_line":"    @retries"},{"line_number":1698,"context_line":"    def _add_resources_to_instance_allocation("},{"line_number":1699,"context_line":"            self, context, consumer_uuid, resources):"},{"line_number":1700,"context_line":""},{"line_number":1701,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1702,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"692649de_cf0460b6","line":1699,"in_reply_to":"1b42ca52_58b34a84","updated":"2020-12-16 15:33:23.000000000","message":"Done","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"5b133b45be6f8d632fd61eb18d31c3a51bd7a52c","unresolved":true,"context_lines":[{"line_number":1661,"context_line":"            # nothing to do"},{"line_number":1662,"context_line":"            return"},{"line_number":1663,"context_line":""},{"line_number":1664,"context_line":"        # This either raises on error, or returns fails if we run out of"},{"line_number":1665,"context_line":"        # retries due to conflict. Convert that return value to an exception"},{"line_number":1666,"context_line":"        # too."},{"line_number":1667,"context_line":"        if not self._add_resources_to_instance_allocation("}],"source_content_type":"text/x-python","patch_set":9,"id":"94b49e7a_a713c70c","line":1664,"range":{"start_line":1664,"start_character":8,"end_line":1664,"end_character":1},"updated":"2021-01-22 13:15:28.000000000","message":"actull looking a tthe function it raise or returns True\n\nso this is not right","commit_id":"54865a17cddd4a358983e9a897f242dc413c7ec1"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"680eab79371f587f53c9552f68ddad2a7b4fa252","unresolved":true,"context_lines":[{"line_number":1661,"context_line":"            # nothing to do"},{"line_number":1662,"context_line":"            return"},{"line_number":1663,"context_line":""},{"line_number":1664,"context_line":"        # This either raises on error, or returns fails if we run out of"},{"line_number":1665,"context_line":"        # retries due to conflict. Convert that return value to an exception"},{"line_number":1666,"context_line":"        # too."},{"line_number":1667,"context_line":"        if not self._add_resources_to_instance_allocation("}],"source_content_type":"text/x-python","patch_set":9,"id":"38120ece_32a67003","line":1664,"range":{"start_line":1664,"start_character":8,"end_line":1664,"end_character":1},"in_reply_to":"7bb5d521_16281462","updated":"2021-01-26 13:10:43.000000000","message":"yes you are right changeing to +1 thanks for pointing that out","commit_id":"54865a17cddd4a358983e9a897f242dc413c7ec1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8cb79068d86478f7105725e5959a3ce9b45e4876","unresolved":true,"context_lines":[{"line_number":1661,"context_line":"            # nothing to do"},{"line_number":1662,"context_line":"            return"},{"line_number":1663,"context_line":""},{"line_number":1664,"context_line":"        # This either raises on error, or returns fails if we run out of"},{"line_number":1665,"context_line":"        # retries due to conflict. Convert that return value to an exception"},{"line_number":1666,"context_line":"        # too."},{"line_number":1667,"context_line":"        if not self._add_resources_to_instance_allocation("}],"source_content_type":"text/x-python","patch_set":9,"id":"7bb5d521_16281462","line":1664,"range":{"start_line":1664,"start_character":8,"end_line":1664,"end_character":1},"in_reply_to":"94b49e7a_a713c70c","updated":"2021-01-26 11:59:08.000000000","message":"Look at the logic in the @retry decorator[1]. It returns False if we run out of retry. So the comment is correct regarding the error conditions\n\n\n[1]https://review.opendev.org/c/openstack/nova/+/757109/9/nova/scheduler/client/report.py#122","commit_id":"54865a17cddd4a358983e9a897f242dc413c7ec1"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"5b133b45be6f8d632fd61eb18d31c3a51bd7a52c","unresolved":true,"context_lines":[{"line_number":1680,"context_line":"        context: nova_context.RequestContext,"},{"line_number":1681,"context_line":"        consumer_uuid: str,"},{"line_number":1682,"context_line":"        resources: ty.Dict[str, ty.Dict[str, ty.Dict[str, int]]],"},{"line_number":1683,"context_line":"    ) -\u003e bool:"},{"line_number":1684,"context_line":""},{"line_number":1685,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1686,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"e627f8c5_56c3d611","line":1683,"range":{"start_line":1683,"start_character":0,"end_line":1683,"end_character":1},"updated":"2021-01-22 13:15:28.000000000","message":"this should just return nothing and signal error via raising.","commit_id":"54865a17cddd4a358983e9a897f242dc413c7ec1"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"680eab79371f587f53c9552f68ddad2a7b4fa252","unresolved":false,"context_lines":[{"line_number":1680,"context_line":"        context: nova_context.RequestContext,"},{"line_number":1681,"context_line":"        consumer_uuid: str,"},{"line_number":1682,"context_line":"        resources: ty.Dict[str, ty.Dict[str, ty.Dict[str, int]]],"},{"line_number":1683,"context_line":"    ) -\u003e bool:"},{"line_number":1684,"context_line":""},{"line_number":1685,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1686,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"1662ec42_e52e3bd7","line":1683,"range":{"start_line":1683,"start_character":0,"end_line":1683,"end_character":1},"in_reply_to":"630faf64_aaa5d37b","updated":"2021-01-26 13:10:43.000000000","message":"Ack","commit_id":"54865a17cddd4a358983e9a897f242dc413c7ec1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"8cb79068d86478f7105725e5959a3ce9b45e4876","unresolved":true,"context_lines":[{"line_number":1680,"context_line":"        context: nova_context.RequestContext,"},{"line_number":1681,"context_line":"        consumer_uuid: str,"},{"line_number":1682,"context_line":"        resources: ty.Dict[str, ty.Dict[str, ty.Dict[str, int]]],"},{"line_number":1683,"context_line":"    ) -\u003e bool:"},{"line_number":1684,"context_line":""},{"line_number":1685,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1686,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"630faf64_aaa5d37b","line":1683,"range":{"start_line":1683,"start_character":0,"end_line":1683,"end_character":1},"in_reply_to":"780d00b7_413f11bf","updated":"2021-01-26 11:59:08.000000000","message":"This is made symmertic to _remove_resources_from_instance_allocation(). Also please observer the @retries decorator that already forces this function to return a bool as it returns False when we run out of retry","commit_id":"54865a17cddd4a358983e9a897f242dc413c7ec1"},{"author":{"_account_id":11604,"name":"sean mooney","email":"smooney@redhat.com","username":"sean-k-mooney"},"change_message_id":"1310778fc0d637a9ff54a22e94282fe21671b3b3","unresolved":true,"context_lines":[{"line_number":1680,"context_line":"        context: nova_context.RequestContext,"},{"line_number":1681,"context_line":"        consumer_uuid: str,"},{"line_number":1682,"context_line":"        resources: ty.Dict[str, ty.Dict[str, ty.Dict[str, int]]],"},{"line_number":1683,"context_line":"    ) -\u003e bool:"},{"line_number":1684,"context_line":""},{"line_number":1685,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1686,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"780d00b7_413f11bf","line":1683,"range":{"start_line":1683,"start_character":0,"end_line":1683,"end_character":1},"in_reply_to":"e627f8c5_56c3d611","updated":"2021-01-22 13:21:30.000000000","message":"these comments can be addressed in a followup by the way the -1 is just to make sure you see this.\nim ok to convert that to a +1 since the code works but as written this will only raise or return true so it should return nothing and signal errors\nonly via excpetion and the if above on lines1667-1675 is then not need.","commit_id":"54865a17cddd4a358983e9a897f242dc413c7ec1"}],"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":"44a741e916b57c47b9484e856a0b3bf560ed23cd","unresolved":false,"context_lines":[{"line_number":3829,"context_line":"            updated_allocations):"},{"line_number":3830,"context_line":""},{"line_number":3831,"context_line":"        with test.nested("},{"line_number":3832,"context_line":"                mock.patch("},{"line_number":3833,"context_line":"                    \"nova.scheduler.client.report.SchedulerReportClient.get\"),"},{"line_number":3834,"context_line":"                mock.patch("},{"line_number":3835,"context_line":"                    \"nova.scheduler.client.report.SchedulerReportClient.put\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"7f6b1bfe_094b3984","line":3832,"range":{"start_line":3832,"start_character":12,"end_line":3832,"end_character":16},"updated":"2020-10-15 09:32:46.000000000","message":"style nit: unnecessary?","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"3a59759955e9fe5903735ea194abf98d69a604ce","unresolved":false,"context_lines":[{"line_number":3829,"context_line":"            updated_allocations):"},{"line_number":3830,"context_line":""},{"line_number":3831,"context_line":"        with test.nested("},{"line_number":3832,"context_line":"                mock.patch("},{"line_number":3833,"context_line":"                    \"nova.scheduler.client.report.SchedulerReportClient.get\"),"},{"line_number":3834,"context_line":"                mock.patch("},{"line_number":3835,"context_line":"                    \"nova.scheduler.client.report.SchedulerReportClient.put\")"}],"source_content_type":"text/x-python","patch_set":3,"id":"7ae4e05b_e34ba243","line":3832,"range":{"start_line":3832,"start_character":12,"end_line":3832,"end_character":16},"in_reply_to":"7f6b1bfe_094b3984","updated":"2020-11-30 15:06:54.000000000","message":"Done","commit_id":"9fea0f24b6170c32ddc6d59a9a7832d88c424ca1"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"c5b2df4874e489359c6075f7924abb2a28ee0bfb","unresolved":true,"context_lines":[{"line_number":3829,"context_line":"            updated_allocations):"},{"line_number":3830,"context_line":""},{"line_number":3831,"context_line":"        with test.nested("},{"line_number":3832,"context_line":"            mock.patch("},{"line_number":3833,"context_line":"                \"nova.scheduler.client.report.SchedulerReportClient.get\"),"},{"line_number":3834,"context_line":"            mock.patch("},{"line_number":3835,"context_line":"                \"nova.scheduler.client.report.SchedulerReportClient.put\")"},{"line_number":3836,"context_line":"        ) as (mock_get, mock_put):"}],"source_content_type":"text/x-python","patch_set":5,"id":"67a7b3b9_307b4be0","line":3833,"range":{"start_line":3832,"start_character":12,"end_line":3833,"end_character":74},"updated":"2020-12-15 15:07:42.000000000","message":"nit:\n\n  mock.patch.object(report.SchedulerReportClient, \u0027get\u0027)\n\n?","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"31c3ba909b07fa839ee4c7cb1c39a725b3bf31e2","unresolved":false,"context_lines":[{"line_number":3829,"context_line":"            updated_allocations):"},{"line_number":3830,"context_line":""},{"line_number":3831,"context_line":"        with test.nested("},{"line_number":3832,"context_line":"            mock.patch("},{"line_number":3833,"context_line":"                \"nova.scheduler.client.report.SchedulerReportClient.get\"),"},{"line_number":3834,"context_line":"            mock.patch("},{"line_number":3835,"context_line":"                \"nova.scheduler.client.report.SchedulerReportClient.put\")"},{"line_number":3836,"context_line":"        ) as (mock_get, mock_put):"}],"source_content_type":"text/x-python","patch_set":5,"id":"d76cd7b8_bb224ba0","line":3833,"range":{"start_line":3832,"start_character":12,"end_line":3833,"end_character":74},"in_reply_to":"67a7b3b9_307b4be0","updated":"2020-12-16 15:33:23.000000000","message":"Done","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":15334,"name":"Stephen Finucane","display_name":"stephenfin","email":"stephenfin@redhat.com","username":"sfinucan"},"change_message_id":"c5b2df4874e489359c6075f7924abb2a28ee0bfb","unresolved":true,"context_lines":[{"line_number":4110,"context_line":"            self.context, uuids.consumer_uuid, addition)"},{"line_number":4111,"context_line":"        self.assertIn("},{"line_number":4112,"context_line":"            \u0027due to multiple successive generation conflicts\u0027,"},{"line_number":4113,"context_line":"            six.text_type(ex))"},{"line_number":4114,"context_line":""},{"line_number":4115,"context_line":"        get_call \u003d mock.call("},{"line_number":4116,"context_line":"            \u0027/allocations/%s\u0027 % uuids.consumer_uuid, version\u003d\u00271.28\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"3147bb4a_788492e3","line":4113,"updated":"2020-12-15 15:07:42.000000000","message":"Can you drop \u0027six\u0027 here. We\u0027re trying to remove it so shouldn\u0027t add more instances","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"31c3ba909b07fa839ee4c7cb1c39a725b3bf31e2","unresolved":false,"context_lines":[{"line_number":4110,"context_line":"            self.context, uuids.consumer_uuid, addition)"},{"line_number":4111,"context_line":"        self.assertIn("},{"line_number":4112,"context_line":"            \u0027due to multiple successive generation conflicts\u0027,"},{"line_number":4113,"context_line":"            six.text_type(ex))"},{"line_number":4114,"context_line":""},{"line_number":4115,"context_line":"        get_call \u003d mock.call("},{"line_number":4116,"context_line":"            \u0027/allocations/%s\u0027 % uuids.consumer_uuid, version\u003d\u00271.28\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"4b846e44_dabdcd17","line":4113,"in_reply_to":"3147bb4a_788492e3","updated":"2020-12-16 15:33:23.000000000","message":"Done","commit_id":"3d5dc39ce76ddbfca0503504a65d11c2244a9e33"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"5df0cc4a1be45003f7eda33f86f5cb6ea35d38c9","unresolved":true,"context_lines":[{"line_number":3899,"context_line":"        }"},{"line_number":3900,"context_line":""},{"line_number":3901,"context_line":"        self._test_add_res_to_alloc("},{"line_number":3902,"context_line":"            current_allocation, addition, expected_allocation)"},{"line_number":3903,"context_line":""},{"line_number":3904,"context_line":"    @mock.patch(\"nova.scheduler.client.report.SchedulerReportClient.get\")"},{"line_number":3905,"context_line":"    def test_add_res_to_alloc_failed_to_get_alloc(self, mock_get):"}],"source_content_type":"text/x-python","patch_set":9,"id":"e01c8725_ae7ba2cd","line":3902,"updated":"2021-01-26 16:46:44.000000000","message":"/me nods","commit_id":"54865a17cddd4a358983e9a897f242dc413c7ec1"}]}
