)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1bc3755a45cb3744f4746c91f474d09976a197e","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add remove_resources_from_instance_allocation to report client"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The subsequent patch will need to modify the existing instance"},{"line_number":10,"context_line":"allocation by removing a set of resources. This patch adds the necessary"},{"line_number":11,"context_line":"report client code to be able to do that."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9fdfeff1_8f149a4e","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":20},"updated":"2019-02-27 14:13:00.000000000","message":"nit: this is fine while reviewing a gerrit series, but in a month this won\u0027t mean anything without context if someone is doing git blame.","commit_id":"6c239c2390799fef03ba4f7d00762a4a96f62819"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ff87be7f5d042c5bb812d7fe4e8f78ad8365797b","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Add remove_resources_from_instance_allocation to report client"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"The subsequent patch will need to modify the existing instance"},{"line_number":10,"context_line":"allocation by removing a set of resources. This patch adds the necessary"},{"line_number":11,"context_line":"report client code to be able to do that."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"9fdfeff1_3a2fe5f6","line":9,"range":{"start_line":9,"start_character":0,"end_line":9,"end_character":20},"in_reply_to":"9fdfeff1_8f149a4e","updated":"2019-02-27 17:08:55.000000000","message":"Done","commit_id":"6c239c2390799fef03ba4f7d00762a4a96f62819"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1bc3755a45cb3744f4746c91f474d09976a197e","unresolved":false,"context_lines":[{"line_number":1697,"context_line":"                            error\u003derror_reason % ("},{"line_number":1698,"context_line":"                                resources,"},{"line_number":1699,"context_line":"                                current_allocs,"},{"line_number":1700,"context_line":"                                \u0027There is not enough inventory left on %s RP \u0027"},{"line_number":1701,"context_line":"                                \u0027to remove %d amount of %s resources.\u0027 % ("},{"line_number":1702,"context_line":"                                    rp_uuid, value, rc)))"},{"line_number":1703,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_8a7008a6","line":1700,"range":{"start_line":1700,"start_character":74,"end_line":1700,"end_character":76},"updated":"2019-02-27 14:13:00.000000000","message":"In things that get logged you should spell this out \"resource provider\" so it\u0027s clear to the operator.","commit_id":"6c239c2390799fef03ba4f7d00762a4a96f62819"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ff87be7f5d042c5bb812d7fe4e8f78ad8365797b","unresolved":false,"context_lines":[{"line_number":1697,"context_line":"                            error\u003derror_reason % ("},{"line_number":1698,"context_line":"                                resources,"},{"line_number":1699,"context_line":"                                current_allocs,"},{"line_number":1700,"context_line":"                                \u0027There is not enough inventory left on %s RP \u0027"},{"line_number":1701,"context_line":"                                \u0027to remove %d amount of %s resources.\u0027 % ("},{"line_number":1702,"context_line":"                                    rp_uuid, value, rc)))"},{"line_number":1703,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_5a4509b3","line":1700,"range":{"start_line":1700,"start_character":74,"end_line":1700,"end_character":76},"in_reply_to":"9fdfeff1_8a7008a6","updated":"2019-02-27 17:08:55.000000000","message":"Done","commit_id":"6c239c2390799fef03ba4f7d00762a4a96f62819"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1bc3755a45cb3744f4746c91f474d09976a197e","unresolved":false,"context_lines":[{"line_number":1735,"context_line":"                          (consumer_uuid, resources, current_allocs))"},{"line_number":1736,"context_line":"                # NOTE(gibi): automatic retry is meaningful if we can still"},{"line_number":1737,"context_line":"                # remove the resources from the updated allocations. Retry"},{"line_number":1738,"context_line":"                # works here as this function (re)query the allocations."},{"line_number":1739,"context_line":"                raise Retry("},{"line_number":1740,"context_line":"                    \u0027remove_resources_from_instance_allocation\u0027, reason)"},{"line_number":1741,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_8a7ec867","line":1738,"range":{"start_line":1738,"start_character":46,"end_line":1738,"end_character":55},"updated":"2019-02-27 14:13:00.000000000","message":"nit: either \"will (re)query\" or \"(re)queries\"","commit_id":"6c239c2390799fef03ba4f7d00762a4a96f62819"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ff87be7f5d042c5bb812d7fe4e8f78ad8365797b","unresolved":false,"context_lines":[{"line_number":1735,"context_line":"                          (consumer_uuid, resources, current_allocs))"},{"line_number":1736,"context_line":"                # NOTE(gibi): automatic retry is meaningful if we can still"},{"line_number":1737,"context_line":"                # remove the resources from the updated allocations. Retry"},{"line_number":1738,"context_line":"                # works here as this function (re)query the allocations."},{"line_number":1739,"context_line":"                raise Retry("},{"line_number":1740,"context_line":"                    \u0027remove_resources_from_instance_allocation\u0027, reason)"},{"line_number":1741,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_3a1845d1","line":1738,"range":{"start_line":1738,"start_character":46,"end_line":1738,"end_character":55},"in_reply_to":"9fdfeff1_8a7ec867","updated":"2019-02-27 17:08:55.000000000","message":"Done","commit_id":"6c239c2390799fef03ba4f7d00762a4a96f62819"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8fc759b9387b1509fb8f84366d2a4268ccce4941","unresolved":false,"context_lines":[{"line_number":1651,"context_line":"                 communicate with the placement API"},{"line_number":1652,"context_line":"        \"\"\""},{"line_number":1653,"context_line":""},{"line_number":1654,"context_line":"        # NOTE(gibi): It is just a small wrapper to raise instead of return"},{"line_number":1655,"context_line":"        # if we run out of retries."},{"line_number":1656,"context_line":"        if not self._remove_resources_from_instance_allocation("},{"line_number":1657,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1658,"context_line":"            error_reason \u003d (\"Cannot remove resources %s from the allocation \""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_067e4c69","line":1655,"range":{"start_line":1654,"start_character":0,"end_line":1655,"end_character":35},"updated":"2019-02-27 20:08:25.000000000","message":"If you\u0027re having to do this, I\u0027m inclined to say you should ditch @retries and use @retrying.retry instead - see aggregate_add_host and aggregate_remove_host.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9d01a568601d62918e4ebb11bb8b0a005a81c437","unresolved":false,"context_lines":[{"line_number":1651,"context_line":"                 communicate with the placement API"},{"line_number":1652,"context_line":"        \"\"\""},{"line_number":1653,"context_line":""},{"line_number":1654,"context_line":"        # NOTE(gibi): It is just a small wrapper to raise instead of return"},{"line_number":1655,"context_line":"        # if we run out of retries."},{"line_number":1656,"context_line":"        if not self._remove_resources_from_instance_allocation("},{"line_number":1657,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1658,"context_line":"            error_reason \u003d (\"Cannot remove resources %s from the allocation \""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_323b779c","line":1655,"range":{"start_line":1654,"start_character":0,"end_line":1655,"end_character":35},"in_reply_to":"9fdfeff1_067e4c69","updated":"2019-02-28 12:35:51.000000000","message":"I don\u0027t fully get it. @retrying.retry can retry on exception but this _remove_resources_from_instance_allocation retries if the returned error code suggests a conflict. So by moving this to @retrying.retry I cannot get rid of error code handling. In the other hand moving to @retrying.retry would made it lot more harder to use AllocationUpdateFailed as the exception type for multiple possible problems below. It would lead to an ugly lambda in the decorator to distinguish between AllocationUpdateFailed that needs a retry and a AllocationUpdateFailed that does not need it. Sure I could add another exception type for the retry case but then the solution become very similar to the current one that raises Retry().\n\nAnyhow I can give a it a try in a FUP. But I\u0027d like not to spend time on this right now a week before the FF.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0d5137dd4aa2c3967673deb87fd1a60c478e7ee","unresolved":false,"context_lines":[{"line_number":1651,"context_line":"                 communicate with the placement API"},{"line_number":1652,"context_line":"        \"\"\""},{"line_number":1653,"context_line":""},{"line_number":1654,"context_line":"        # NOTE(gibi): It is just a small wrapper to raise instead of return"},{"line_number":1655,"context_line":"        # if we run out of retries."},{"line_number":1656,"context_line":"        if not self._remove_resources_from_instance_allocation("},{"line_number":1657,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1658,"context_line":"            error_reason \u003d (\"Cannot remove resources %s from the allocation \""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_b3ff64ff","line":1655,"range":{"start_line":1654,"start_character":0,"end_line":1655,"end_character":35},"in_reply_to":"9fdfeff1_323b779c","updated":"2019-02-28 16:15:46.000000000","message":"\u003e Anyhow I can give a it a try in a FUP. But I\u0027d like not to spend time on this right now a week before the FF.\n\nAgree that I\u0027d like to stick what we know is working here (and is used in a very similar capacity in claim_resources) and deal with refactoring later in Train if we want to.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8fc759b9387b1509fb8f84366d2a4268ccce4941","unresolved":false,"context_lines":[{"line_number":1656,"context_line":"        if not self._remove_resources_from_instance_allocation("},{"line_number":1657,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1658,"context_line":"            error_reason \u003d (\"Cannot remove resources %s from the allocation \""},{"line_number":1659,"context_line":"                            \"due to multiple subsequent generation conflict \""},{"line_number":1660,"context_line":"                            \"in placement.\")"},{"line_number":1661,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1662,"context_line":"                consumer_uuid\u003dconsumer_uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_a698a0bf","line":1659,"range":{"start_line":1659,"start_character":67,"end_line":1659,"end_character":75},"updated":"2019-02-27 20:08:25.000000000","message":"conflicts","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8fc759b9387b1509fb8f84366d2a4268ccce4941","unresolved":false,"context_lines":[{"line_number":1656,"context_line":"        if not self._remove_resources_from_instance_allocation("},{"line_number":1657,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1658,"context_line":"            error_reason \u003d (\"Cannot remove resources %s from the allocation \""},{"line_number":1659,"context_line":"                            \"due to multiple subsequent generation conflict \""},{"line_number":1660,"context_line":"                            \"in placement.\")"},{"line_number":1661,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1662,"context_line":"                consumer_uuid\u003dconsumer_uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_06288c30","line":1659,"range":{"start_line":1659,"start_character":45,"end_line":1659,"end_character":55},"updated":"2019-02-27 20:08:25.000000000","message":"successive?","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9d01a568601d62918e4ebb11bb8b0a005a81c437","unresolved":false,"context_lines":[{"line_number":1656,"context_line":"        if not self._remove_resources_from_instance_allocation("},{"line_number":1657,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1658,"context_line":"            error_reason \u003d (\"Cannot remove resources %s from the allocation \""},{"line_number":1659,"context_line":"                            \"due to multiple subsequent generation conflict \""},{"line_number":1660,"context_line":"                            \"in placement.\")"},{"line_number":1661,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1662,"context_line":"                consumer_uuid\u003dconsumer_uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_3503610f","line":1659,"range":{"start_line":1659,"start_character":45,"end_line":1659,"end_character":55},"in_reply_to":"9fdfeff1_06288c30","updated":"2019-02-28 12:35:51.000000000","message":"Done","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9d01a568601d62918e4ebb11bb8b0a005a81c437","unresolved":false,"context_lines":[{"line_number":1656,"context_line":"        if not self._remove_resources_from_instance_allocation("},{"line_number":1657,"context_line":"                context, consumer_uuid, resources):"},{"line_number":1658,"context_line":"            error_reason \u003d (\"Cannot remove resources %s from the allocation \""},{"line_number":1659,"context_line":"                            \"due to multiple subsequent generation conflict \""},{"line_number":1660,"context_line":"                            \"in placement.\")"},{"line_number":1661,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1662,"context_line":"                consumer_uuid\u003dconsumer_uuid,"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_d5053511","line":1659,"range":{"start_line":1659,"start_character":67,"end_line":1659,"end_character":75},"in_reply_to":"9fdfeff1_a698a0bf","updated":"2019-02-28 12:35:51.000000000","message":"Done","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8fc759b9387b1509fb8f84366d2a4268ccce4941","unresolved":false,"context_lines":[{"line_number":1668,"context_line":"        if not resources:"},{"line_number":1669,"context_line":"            # Nothing to remove so do not query or update allocation in"},{"line_number":1670,"context_line":"            # placement."},{"line_number":1671,"context_line":"            # The True value is only here because the retry decorator returns"},{"line_number":1672,"context_line":"            # False when runs out of retries. It would be nicer to raise in"},{"line_number":1673,"context_line":"            # that case too."},{"line_number":1674,"context_line":"            return True"},{"line_number":1675,"context_line":""},{"line_number":1676,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1677,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_7174b036","line":1674,"range":{"start_line":1671,"start_character":0,"end_line":1674,"end_character":23},"updated":"2019-02-27 20:08:25.000000000","message":"ick, as above.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9d01a568601d62918e4ebb11bb8b0a005a81c437","unresolved":false,"context_lines":[{"line_number":1668,"context_line":"        if not resources:"},{"line_number":1669,"context_line":"            # Nothing to remove so do not query or update allocation in"},{"line_number":1670,"context_line":"            # placement."},{"line_number":1671,"context_line":"            # The True value is only here because the retry decorator returns"},{"line_number":1672,"context_line":"            # False when runs out of retries. It would be nicer to raise in"},{"line_number":1673,"context_line":"            # that case too."},{"line_number":1674,"context_line":"            return True"},{"line_number":1675,"context_line":""},{"line_number":1676,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1677,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_529b9b71","line":1674,"range":{"start_line":1671,"start_character":0,"end_line":1674,"end_character":23},"in_reply_to":"9fdfeff1_7174b036","updated":"2019-02-28 12:35:51.000000000","message":"I agree that it is ugly. I think retring.retry would make the solution ugly in a different way.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8fc759b9387b1509fb8f84366d2a4268ccce4941","unresolved":false,"context_lines":[{"line_number":1675,"context_line":""},{"line_number":1676,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1677,"context_line":""},{"line_number":1678,"context_line":"        error_reason \u003d \"Cannot remove resources %s from allocation %s. %s\""},{"line_number":1679,"context_line":""},{"line_number":1680,"context_line":"        if not current_allocs[\u0027allocations\u0027]:"},{"line_number":1681,"context_line":"            raise exception.AllocationUpdateFailed("}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_d1cb1c6f","line":1678,"range":{"start_line":1678,"start_character":0,"end_line":1678,"end_character":74},"updated":"2019-02-27 20:08:25.000000000","message":"This...","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8fc759b9387b1509fb8f84366d2a4268ccce4941","unresolved":false,"context_lines":[{"line_number":1683,"context_line":"                error\u003derror_reason % ("},{"line_number":1684,"context_line":"                    resources,"},{"line_number":1685,"context_line":"                    current_allocs,"},{"line_number":1686,"context_line":"                    \u0027The allocation is empty.\u0027))"},{"line_number":1687,"context_line":""},{"line_number":1688,"context_line":"        try:"},{"line_number":1689,"context_line":"            for rp_uuid, resources_to_remove in resources.items():"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_719b5072","line":1686,"range":{"start_line":1686,"start_character":0,"end_line":1686,"end_character":48},"updated":"2019-02-27 20:08:25.000000000","message":"...and this make for an exception of mixed languages when translated.\n\nMarking these with _() would improve the situation. That\u0027s \"message composition\" which is generally also a no-no. But the alternative is making separate explicit full messages for every path, and I don\u0027t think we need to go that far.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0d5137dd4aa2c3967673deb87fd1a60c478e7ee","unresolved":false,"context_lines":[{"line_number":1683,"context_line":"                error\u003derror_reason % ("},{"line_number":1684,"context_line":"                    resources,"},{"line_number":1685,"context_line":"                    current_allocs,"},{"line_number":1686,"context_line":"                    \u0027The allocation is empty.\u0027))"},{"line_number":1687,"context_line":""},{"line_number":1688,"context_line":"        try:"},{"line_number":1689,"context_line":"            for rp_uuid, resources_to_remove in resources.items():"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_b37684a3","line":1686,"range":{"start_line":1686,"start_character":0,"end_line":1686,"end_character":48},"in_reply_to":"9fdfeff1_32937751","updated":"2019-02-28 16:15:46.000000000","message":"Neither of these are marked for translation so I don\u0027t see what the issue is. Also, these aren\u0027t going to be user-facing as far as I know so translation of stuff that\u0027s just going to go into the logs isn\u0027t a priority since log messages aren\u0027t getting translated (haven\u0027t been for many years now).","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9d01a568601d62918e4ebb11bb8b0a005a81c437","unresolved":false,"context_lines":[{"line_number":1683,"context_line":"                error\u003derror_reason % ("},{"line_number":1684,"context_line":"                    resources,"},{"line_number":1685,"context_line":"                    current_allocs,"},{"line_number":1686,"context_line":"                    \u0027The allocation is empty.\u0027))"},{"line_number":1687,"context_line":""},{"line_number":1688,"context_line":"        try:"},{"line_number":1689,"context_line":"            for rp_uuid, resources_to_remove in resources.items():"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_32937751","line":1686,"range":{"start_line":1686,"start_character":0,"end_line":1686,"end_character":48},"in_reply_to":"9fdfeff1_719b5072","updated":"2019-02-28 12:35:51.000000000","message":"I\u0027ve tried to add _() calls but a hacking rule is forbids it:\n\nH701  Empty localization string\n\nSo I inlined all the error messages to keep the translation possible.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8fc759b9387b1509fb8f84366d2a4268ccce4941","unresolved":false,"context_lines":[{"line_number":1714,"context_line":"                error\u003derror_reason % ("},{"line_number":1715,"context_line":"                    resources,"},{"line_number":1716,"context_line":"                    current_allocs,"},{"line_number":1717,"context_line":"                    \u0027Key %s is missing from the allocation.\u0027 % e))"},{"line_number":1718,"context_line":""},{"line_number":1719,"context_line":"        # we have to remove the rps from the allocation that has no resources"},{"line_number":1720,"context_line":"        # any more"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_91d274fc","line":1717,"range":{"start_line":1717,"start_character":21,"end_line":1717,"end_character":24},"updated":"2019-02-27 20:08:25.000000000","message":"It would be nice if we could say \"resource provider\" or \"resource class\" here. But meh.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"b0d5137dd4aa2c3967673deb87fd1a60c478e7ee","unresolved":false,"context_lines":[{"line_number":1714,"context_line":"                error\u003derror_reason % ("},{"line_number":1715,"context_line":"                    resources,"},{"line_number":1716,"context_line":"                    current_allocs,"},{"line_number":1717,"context_line":"                    \u0027Key %s is missing from the allocation.\u0027 % e))"},{"line_number":1718,"context_line":""},{"line_number":1719,"context_line":"        # we have to remove the rps from the allocation that has no resources"},{"line_number":1720,"context_line":"        # any more"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_336a94b2","line":1717,"range":{"start_line":1717,"start_character":21,"end_line":1717,"end_character":24},"in_reply_to":"9fdfeff1_32c05750","updated":"2019-02-28 16:15:46.000000000","message":"\"average human\" heh :)","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9d01a568601d62918e4ebb11bb8b0a005a81c437","unresolved":false,"context_lines":[{"line_number":1714,"context_line":"                error\u003derror_reason % ("},{"line_number":1715,"context_line":"                    resources,"},{"line_number":1716,"context_line":"                    current_allocs,"},{"line_number":1717,"context_line":"                    \u0027Key %s is missing from the allocation.\u0027 % e))"},{"line_number":1718,"context_line":""},{"line_number":1719,"context_line":"        # we have to remove the rps from the allocation that has no resources"},{"line_number":1720,"context_line":"        # any more"}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_32c05750","line":1717,"range":{"start_line":1717,"start_character":21,"end_line":1717,"end_character":24},"in_reply_to":"9fdfeff1_91d274fc","updated":"2019-02-28 12:35:51.000000000","message":"The generated error message can be decoded by an average human so I\u0027m not to inclined to add another except KeyError block above to differentiate between the two error.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8fc759b9387b1509fb8f84366d2a4268ccce4941","unresolved":false,"context_lines":[{"line_number":1734,"context_line":"                          \u0027allocations for consumer %s so we cannot remove \u0027"},{"line_number":1735,"context_line":"                          \u0027resources %s from the current allocation %s\u0027 %"},{"line_number":1736,"context_line":"                          (consumer_uuid, resources, current_allocs))"},{"line_number":1737,"context_line":"                # NOTE(gibi): automatic retry is meaningful if we can still"},{"line_number":1738,"context_line":"                # remove the resources from the updated allocations. Retry"},{"line_number":1739,"context_line":"                # works here as this function (re)queries the allocations."},{"line_number":1740,"context_line":"                raise Retry("},{"line_number":1741,"context_line":"                    \u0027remove_resources_from_instance_allocation\u0027, reason)"},{"line_number":1742,"context_line":""},{"line_number":1743,"context_line":"        # It is only here because the retry decorator returns False when runs"},{"line_number":1744,"context_line":"        # out of retries. It would be nicer to raise in that case too."}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_916fd45e","line":1741,"range":{"start_line":1737,"start_character":0,"end_line":1741,"end_character":72},"updated":"2019-02-27 20:08:25.000000000","message":"ick","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9d01a568601d62918e4ebb11bb8b0a005a81c437","unresolved":false,"context_lines":[{"line_number":1734,"context_line":"                          \u0027allocations for consumer %s so we cannot remove \u0027"},{"line_number":1735,"context_line":"                          \u0027resources %s from the current allocation %s\u0027 %"},{"line_number":1736,"context_line":"                          (consumer_uuid, resources, current_allocs))"},{"line_number":1737,"context_line":"                # NOTE(gibi): automatic retry is meaningful if we can still"},{"line_number":1738,"context_line":"                # remove the resources from the updated allocations. Retry"},{"line_number":1739,"context_line":"                # works here as this function (re)queries the allocations."},{"line_number":1740,"context_line":"                raise Retry("},{"line_number":1741,"context_line":"                    \u0027remove_resources_from_instance_allocation\u0027, reason)"},{"line_number":1742,"context_line":""},{"line_number":1743,"context_line":"        # It is only here because the retry decorator returns False when runs"},{"line_number":1744,"context_line":"        # out of retries. It would be nicer to raise in that case too."}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_32d7f725","line":1741,"range":{"start_line":1737,"start_character":0,"end_line":1741,"end_character":72},"in_reply_to":"9fdfeff1_916fd45e","updated":"2019-02-28 12:35:51.000000000","message":"I think here it is better to write out the explicit trigger of the retry instead of trying to figure out in the decorator when to retry.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e75119124e24549af6dd3884419c53f3e6f04abe","unresolved":false,"context_lines":[{"line_number":1637,"context_line":"                                      \u003cresource class\u003e: amount"},{"line_number":1638,"context_line":"                                      \u003cother resource class\u003e: amount"},{"line_number":1639,"context_line":"                                  }"},{"line_number":1640,"context_line":"                                  \u003cother_ rp_uuid_1\u003e: {"},{"line_number":1641,"context_line":"                                      \u003cother resource class\u003e: amount"},{"line_number":1642,"context_line":"                                  }"},{"line_number":1643,"context_line":"                              }"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_5c6f2a5f","line":1640,"range":{"start_line":1640,"start_character":49,"end_line":1640,"end_character":51},"updated":"2019-02-28 15:44:44.000000000","message":"nix :)","commit_id":"d78c1dde589b30d8439bb1074720b0033ae74c1a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"80912e6287de06160a4990f3d3c1f7a8a1ab21f3","unresolved":false,"context_lines":[{"line_number":1637,"context_line":"                                      \u003cresource class\u003e: amount"},{"line_number":1638,"context_line":"                                      \u003cother resource class\u003e: amount"},{"line_number":1639,"context_line":"                                  }"},{"line_number":1640,"context_line":"                                  \u003cother_ rp_uuid_1\u003e: {"},{"line_number":1641,"context_line":"                                      \u003cother resource class\u003e: amount"},{"line_number":1642,"context_line":"                                  }"},{"line_number":1643,"context_line":"                              }"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_b7a191f9","line":1640,"range":{"start_line":1640,"start_character":49,"end_line":1640,"end_character":51},"in_reply_to":"9fdfeff1_5c6f2a5f","updated":"2019-02-28 15:54:29.000000000","message":"Done","commit_id":"d78c1dde589b30d8439bb1074720b0033ae74c1a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e75119124e24549af6dd3884419c53f3e6f04abe","unresolved":false,"context_lines":[{"line_number":1677,"context_line":""},{"line_number":1678,"context_line":"        if not current_allocs[\u0027allocations\u0027]:"},{"line_number":1679,"context_line":"            error_reason \u003d _(\"Cannot remove resources %(resources)s from \""},{"line_number":1680,"context_line":"                             \"allocation %(allocations)s. The allocation is \""},{"line_number":1681,"context_line":"                             \"empty.\")"},{"line_number":1682,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1683,"context_line":"                consumer_uuid\u003dconsumer_uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_bcb2d604","line":1680,"range":{"start_line":1680,"start_character":41,"end_line":1680,"end_character":56},"updated":"2019-02-28 15:44:44.000000000","message":"this is always going to be just \"{\u0027allocations\u0027: {}}\" right? :)","commit_id":"d78c1dde589b30d8439bb1074720b0033ae74c1a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"80912e6287de06160a4990f3d3c1f7a8a1ab21f3","unresolved":false,"context_lines":[{"line_number":1677,"context_line":""},{"line_number":1678,"context_line":"        if not current_allocs[\u0027allocations\u0027]:"},{"line_number":1679,"context_line":"            error_reason \u003d _(\"Cannot remove resources %(resources)s from \""},{"line_number":1680,"context_line":"                             \"allocation %(allocations)s. The allocation is \""},{"line_number":1681,"context_line":"                             \"empty.\")"},{"line_number":1682,"context_line":"            raise exception.AllocationUpdateFailed("},{"line_number":1683,"context_line":"                consumer_uuid\u003dconsumer_uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_77afa9e2","line":1680,"range":{"start_line":1680,"start_character":41,"end_line":1680,"end_character":56},"in_reply_to":"9fdfeff1_bcb2d604","updated":"2019-02-28 15:54:29.000000000","message":"right.","commit_id":"d78c1dde589b30d8439bb1074720b0033ae74c1a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e75119124e24549af6dd3884419c53f3e6f04abe","unresolved":false,"context_lines":[{"line_number":1690,"context_line":"                for rc, value in resources_to_remove.items():"},{"line_number":1691,"context_line":"                    allocation_on_rp[\u0027resources\u0027][rc] -\u003d value"},{"line_number":1692,"context_line":""},{"line_number":1693,"context_line":"                    if allocation_on_rp[\u0027resources\u0027][rc] \u003c 0:"},{"line_number":1694,"context_line":"                        error_reason \u003d _("},{"line_number":1695,"context_line":"                            \"Cannot remove resources %(resources)s from \""},{"line_number":1696,"context_line":"                            \"allocation %(allocations)s. There is not enough \""},{"line_number":1697,"context_line":"                            \"inventory left on %(rp_uuid)s resource provider \""},{"line_number":1698,"context_line":"                            \"to remove %(amount)d amount of \""},{"line_number":1699,"context_line":"                            \"%(resource_class)s resources.\")"},{"line_number":1700,"context_line":"                        raise exception.AllocationUpdateFailed("},{"line_number":1701,"context_line":"                            consumer_uuid\u003dconsumer_uuid,"},{"line_number":1702,"context_line":"                            error\u003derror_reason %"},{"line_number":1703,"context_line":"                                  {\u0027resources\u0027: resources,"},{"line_number":1704,"context_line":"                                   \u0027allocations\u0027: current_allocs,"},{"line_number":1705,"context_line":"                                   \u0027rp_uuid\u0027: rp_uuid,"},{"line_number":1706,"context_line":"                                   \u0027amount\u0027: value,"},{"line_number":1707,"context_line":"                                   \u0027resource_class\u0027: rc})"},{"line_number":1708,"context_line":""},{"line_number":1709,"context_line":"                    if allocation_on_rp[\u0027resources\u0027][rc] \u003d\u003d 0:"},{"line_number":1710,"context_line":"                        # if no allocation left for this rc then remove it"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_3c734618","line":1707,"range":{"start_line":1693,"start_character":1,"end_line":1707,"end_character":57},"updated":"2019-02-28 15:44:44.000000000","message":"hmm, the allocations for the consumer (which is what allocation_on_rp contains) is *not* the inventory on the provider. Rather, it\u0027s simply the amount of that resource class that has been allocated to this consumer.\n\nSo, I think the error message here should instead be something to the effect of \"attempted to remove more resources from allocation of resource X against provider Y than were allocated to consumer Z\". Does that make sense?","commit_id":"d78c1dde589b30d8439bb1074720b0033ae74c1a"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"80912e6287de06160a4990f3d3c1f7a8a1ab21f3","unresolved":false,"context_lines":[{"line_number":1690,"context_line":"                for rc, value in resources_to_remove.items():"},{"line_number":1691,"context_line":"                    allocation_on_rp[\u0027resources\u0027][rc] -\u003d value"},{"line_number":1692,"context_line":""},{"line_number":1693,"context_line":"                    if allocation_on_rp[\u0027resources\u0027][rc] \u003c 0:"},{"line_number":1694,"context_line":"                        error_reason \u003d _("},{"line_number":1695,"context_line":"                            \"Cannot remove resources %(resources)s from \""},{"line_number":1696,"context_line":"                            \"allocation %(allocations)s. There is not enough \""},{"line_number":1697,"context_line":"                            \"inventory left on %(rp_uuid)s resource provider \""},{"line_number":1698,"context_line":"                            \"to remove %(amount)d amount of \""},{"line_number":1699,"context_line":"                            \"%(resource_class)s resources.\")"},{"line_number":1700,"context_line":"                        raise exception.AllocationUpdateFailed("},{"line_number":1701,"context_line":"                            consumer_uuid\u003dconsumer_uuid,"},{"line_number":1702,"context_line":"                            error\u003derror_reason %"},{"line_number":1703,"context_line":"                                  {\u0027resources\u0027: resources,"},{"line_number":1704,"context_line":"                                   \u0027allocations\u0027: current_allocs,"},{"line_number":1705,"context_line":"                                   \u0027rp_uuid\u0027: rp_uuid,"},{"line_number":1706,"context_line":"                                   \u0027amount\u0027: value,"},{"line_number":1707,"context_line":"                                   \u0027resource_class\u0027: rc})"},{"line_number":1708,"context_line":""},{"line_number":1709,"context_line":"                    if allocation_on_rp[\u0027resources\u0027][rc] \u003d\u003d 0:"},{"line_number":1710,"context_line":"                        # if no allocation left for this rc then remove it"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_97c1ed82","line":1707,"range":{"start_line":1693,"start_character":1,"end_line":1707,"end_character":57},"in_reply_to":"9fdfeff1_3c734618","updated":"2019-02-28 15:54:29.000000000","message":"Your are correct. It is not inventory we are removing from but allocated resources. Done.","commit_id":"d78c1dde589b30d8439bb1074720b0033ae74c1a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e75119124e24549af6dd3884419c53f3e6f04abe","unresolved":false,"context_lines":[{"line_number":1709,"context_line":"                    if allocation_on_rp[\u0027resources\u0027][rc] \u003d\u003d 0:"},{"line_number":1710,"context_line":"                        # if no allocation left for this rc then remove it"},{"line_number":1711,"context_line":"                        # from the allocation"},{"line_number":1712,"context_line":"                        del allocation_on_rp[\u0027resources\u0027][rc]"},{"line_number":1713,"context_line":"        except KeyError as e:"},{"line_number":1714,"context_line":"            error_reason \u003d _(\"Cannot remove resources %(resources)s from \""},{"line_number":1715,"context_line":"                             \"allocation %(allocations)s. Key %(missing_key)s \""}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_1c668252","line":1712,"updated":"2019-02-28 15:44:44.000000000","message":"++","commit_id":"d78c1dde589b30d8439bb1074720b0033ae74c1a"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e75119124e24549af6dd3884419c53f3e6f04abe","unresolved":false,"context_lines":[{"line_number":1728,"context_line":"        current_allocs[\u0027allocations\u0027] \u003d {"},{"line_number":1729,"context_line":"            rp_uuid: alloc"},{"line_number":1730,"context_line":"            for rp_uuid, alloc in current_allocs[\u0027allocations\u0027].items()"},{"line_number":1731,"context_line":"            if alloc[\u0027resources\u0027]}"},{"line_number":1732,"context_line":""},{"line_number":1733,"context_line":"        r \u003d self._put_allocations("},{"line_number":1734,"context_line":"            context, consumer_uuid, current_allocs)"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_3c4ca6c6","line":1731,"updated":"2019-02-28 15:44:44.000000000","message":"ack, good catch.","commit_id":"d78c1dde589b30d8439bb1074720b0033ae74c1a"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"350cef3a2a0e645da343eaebb0039703184b15c4","unresolved":false,"context_lines":[{"line_number":1637,"context_line":"                                      \u003cresource class\u003e: amount"},{"line_number":1638,"context_line":"                                      \u003cother resource class\u003e: amount"},{"line_number":1639,"context_line":"                                  }"},{"line_number":1640,"context_line":"                                  \u003cother_ rp_uuid\u003e: {"},{"line_number":1641,"context_line":"                                      \u003cother resource class\u003e: amount"},{"line_number":1642,"context_line":"                                  }"},{"line_number":1643,"context_line":"                              }"}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_b3e9a41a","line":1640,"range":{"start_line":1640,"start_character":41,"end_line":1640,"end_character":42},"updated":"2019-02-28 16:20:56.000000000","message":"oops","commit_id":"29f9febba714e1e331ecbdbc077606603dfc3ca5"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"350cef3a2a0e645da343eaebb0039703184b15c4","unresolved":false,"context_lines":[{"line_number":1676,"context_line":"        current_allocs \u003d self.get_allocs_for_consumer(context, consumer_uuid)"},{"line_number":1677,"context_line":""},{"line_number":1678,"context_line":"        if not current_allocs[\u0027allocations\u0027]:"},{"line_number":1679,"context_line":"            error_reason \u003d _(\"Cannot remove resources %(resources)s from \""},{"line_number":1680,"context_line":"                             \"allocation %(allocations)s. The allocation is \""},{"line_number":1681,"context_line":"                             \"empty.\")"},{"line_number":1682,"context_line":"            raise exception.AllocationUpdateFailed("}],"source_content_type":"text/x-python","patch_set":5,"id":"9fdfeff1_93cb40a2","line":1679,"range":{"start_line":1679,"start_character":27,"end_line":1679,"end_character":29},"updated":"2019-02-28 16:20:56.000000000","message":"OK so I guess we are now marking these for translation. That\u0027s fine, I just don\u0027t think it\u0027s necessary if these aren\u0027t user-facing. Nova doesn\u0027t really get translated anymore.","commit_id":"29f9febba714e1e331ecbdbc077606603dfc3ca5"}],"nova/tests/unit/scheduler/client/test_report.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1bc3755a45cb3744f4746c91f474d09976a197e","unresolved":false,"context_lines":[{"line_number":3453,"context_line":"            exception.AllocationUpdateFailed, self._test_remove_res_from_alloc,"},{"line_number":3454,"context_line":"            current_allocations, resources_to_remove, None)"},{"line_number":3455,"context_line":"        self.assertIn("},{"line_number":3456,"context_line":"            \"Key \u0027VCPU\u0027 is missing from the allocation\","},{"line_number":3457,"context_line":"            six.text_type(ex))"},{"line_number":3458,"context_line":""},{"line_number":3459,"context_line":"    def test_remove_res_from_alloc_missing_rp(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_ca3b7099","line":3456,"updated":"2019-02-27 14:13:00.000000000","message":"This is definitely nicer to assert and clarifies the test. Thanks for adding these.","commit_id":"6c239c2390799fef03ba4f7d00762a4a96f62819"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1bc3755a45cb3744f4746c91f474d09976a197e","unresolved":false,"context_lines":[{"line_number":3629,"context_line":""},{"line_number":3630,"context_line":"        mock_put.side_effect \u003d [put_rsp] * 4"},{"line_number":3631,"context_line":""},{"line_number":3632,"context_line":"        self.assertRaises("},{"line_number":3633,"context_line":"            exception.AllocationUpdateFailed,"},{"line_number":3634,"context_line":"            self.client.remove_resources_from_instance_allocation,"},{"line_number":3635,"context_line":"            self.context, uuids.consumer_uuid, resources_to_remove)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_4af540ca","line":3632,"updated":"2019-02-27 14:13:00.000000000","message":"In this case we can assert \"due to multiple subsequent generation conflict\" is in the exception that is raised.","commit_id":"6c239c2390799fef03ba4f7d00762a4a96f62819"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"ff87be7f5d042c5bb812d7fe4e8f78ad8365797b","unresolved":false,"context_lines":[{"line_number":3629,"context_line":""},{"line_number":3630,"context_line":"        mock_put.side_effect \u003d [put_rsp] * 4"},{"line_number":3631,"context_line":""},{"line_number":3632,"context_line":"        self.assertRaises("},{"line_number":3633,"context_line":"            exception.AllocationUpdateFailed,"},{"line_number":3634,"context_line":"            self.client.remove_resources_from_instance_allocation,"},{"line_number":3635,"context_line":"            self.context, uuids.consumer_uuid, resources_to_remove)"}],"source_content_type":"text/x-python","patch_set":2,"id":"9fdfeff1_fa5b9d82","line":3632,"in_reply_to":"9fdfeff1_4af540ca","updated":"2019-02-27 17:08:55.000000000","message":"Done","commit_id":"6c239c2390799fef03ba4f7d00762a4a96f62819"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8fc759b9387b1509fb8f84366d2a4268ccce4941","unresolved":false,"context_lines":[{"line_number":3238,"context_line":"            self, current_allocations, resources_to_remove,"},{"line_number":3239,"context_line":"            updated_allocations):"},{"line_number":3240,"context_line":""},{"line_number":3241,"context_line":"        with test.nested("},{"line_number":3242,"context_line":"                mock.patch("},{"line_number":3243,"context_line":"                    \"nova.scheduler.client.report.SchedulerReportClient.get\"),"},{"line_number":3244,"context_line":"                mock.patch("},{"line_number":3245,"context_line":"                    \"nova.scheduler.client.report.SchedulerReportClient.put\")"},{"line_number":3246,"context_line":"        ) as (mock_get, mock_put):"},{"line_number":3247,"context_line":"            mock_get.return_value \u003d fake_requests.FakeResponse("},{"line_number":3248,"context_line":"                200, content\u003djsonutils.dumps(current_allocations))"},{"line_number":3249,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_b1a3f89d","line":3246,"range":{"start_line":3241,"start_character":0,"end_line":3246,"end_character":34},"updated":"2019-02-27 20:08:25.000000000","message":"why not @mock.patch decorators?","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"9d01a568601d62918e4ebb11bb8b0a005a81c437","unresolved":false,"context_lines":[{"line_number":3238,"context_line":"            self, current_allocations, resources_to_remove,"},{"line_number":3239,"context_line":"            updated_allocations):"},{"line_number":3240,"context_line":""},{"line_number":3241,"context_line":"        with test.nested("},{"line_number":3242,"context_line":"                mock.patch("},{"line_number":3243,"context_line":"                    \"nova.scheduler.client.report.SchedulerReportClient.get\"),"},{"line_number":3244,"context_line":"                mock.patch("},{"line_number":3245,"context_line":"                    \"nova.scheduler.client.report.SchedulerReportClient.put\")"},{"line_number":3246,"context_line":"        ) as (mock_get, mock_put):"},{"line_number":3247,"context_line":"            mock_get.return_value \u003d fake_requests.FakeResponse("},{"line_number":3248,"context_line":"                200, content\u003djsonutils.dumps(current_allocations))"},{"line_number":3249,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"9fdfeff1_122c3300","line":3246,"range":{"start_line":3241,"start_character":0,"end_line":3246,"end_character":34},"in_reply_to":"9fdfeff1_b1a3f89d","updated":"2019-02-28 12:35:51.000000000","message":"this is a helper function with a bunch of formal parameters and adding mock.patch decorators would result in a mixed list of formal parameter, some would need to be passed by the caller some would be filled by the decorator. I had hard time decode such helpers in the past. In the other hand this add an extra level of nesting. But still this function is small and not too nested to I went with the nesting.","commit_id":"44230773a53a10867d1485d2e8937b7a3510fae8"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e75119124e24549af6dd3884419c53f3e6f04abe","unresolved":false,"context_lines":[{"line_number":3648,"context_line":"            \u0027/allocations/%s\u0027 % uuids.consumer_uuid, updated_allocations,"},{"line_number":3649,"context_line":"            version\u003d\u00271.28\u0027, global_request_id\u003dself.context.global_id)"},{"line_number":3650,"context_line":""},{"line_number":3651,"context_line":"        mock_put.assert_has_calls([put_call] * 4)"},{"line_number":3652,"context_line":""},{"line_number":3653,"context_line":""},{"line_number":3654,"context_line":"class TestResourceClass(SchedulerReportClientTestCase):"}],"source_content_type":"text/x-python","patch_set":4,"id":"9fdfeff1_5c264acd","line":3651,"updated":"2019-02-28 15:44:44.000000000","message":"excellent unit tests, thank you Gibi.","commit_id":"d78c1dde589b30d8439bb1074720b0033ae74c1a"}]}
