)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cd93806898d3a3a06386de5a1f3c4653f241c7b","unresolved":false,"context_lines":[{"line_number":19,"context_line":"allocation with that generation. If this fails due to a consumer"},{"line_number":20,"context_line":"generation conflict, meaning something modified the allocation of the"},{"line_number":21,"context_line":"instance in between GET and PUT then the report client will raise"},{"line_number":22,"context_line":"AllocationDeleteFailed exception. This will cause that the instance"},{"line_number":23,"context_line":"goes to ERROR state."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"To be able to put the instance state to ERROR the instance.destroy()"},{"line_number":26,"context_line":"call is moved to the end to of the deletion call path. To keep the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_4ccf4e27","line":23,"range":{"start_line":22,"start_character":0,"end_line":23,"end_character":20},"updated":"2018-09-21 15:27:44.000000000","message":"Hmm, so we\u0027ll fail to delete the instance if we can\u0027t cleanup the allocations. I guess that\u0027s fair if something else is concurrently mucking with the allocations.\n\nNote that the API when doing a local delete also calls delete_allocation_for_instance so if that raises we\u0027d fail to delete the instance and get a 500 error...the former is OK (the failure), the latter is probably not - but maybe 500 is \"correct\" in that case? 409 might be better though.","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"aa137f17afe9c4f0dd213bdc6ba8326078234f95","unresolved":false,"context_lines":[{"line_number":19,"context_line":"allocation with that generation. If this fails due to a consumer"},{"line_number":20,"context_line":"generation conflict, meaning something modified the allocation of the"},{"line_number":21,"context_line":"instance in between GET and PUT then the report client will raise"},{"line_number":22,"context_line":"AllocationDeleteFailed exception. This will cause that the instance"},{"line_number":23,"context_line":"goes to ERROR state."},{"line_number":24,"context_line":""},{"line_number":25,"context_line":"To be able to put the instance state to ERROR the instance.destroy()"},{"line_number":26,"context_line":"call is moved to the end to of the deletion call path. To keep the"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"3f79a3b5_3a6227db","line":23,"range":{"start_line":22,"start_character":0,"end_line":23,"end_character":20},"in_reply_to":"3f79a3b5_4ccf4e27","updated":"2018-09-24 16:04:13.000000000","message":"Good point. As this delete can be re-tried later 409 error code would be appropriate.\nDone","commit_id":"56153439770e66b4de840914dce5f481cdc42695"}],"nova/api/openstack/compute/servers.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"7c6f4cf3d6dafc529557ead423ee038c9af6c3c0","unresolved":false,"context_lines":[{"line_number":870,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":871,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":872,"context_line":"                    \u0027delete\u0027, id)"},{"line_number":873,"context_line":"        except exception.AllocationDeleteFailed as e:"},{"line_number":874,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":875,"context_line":""},{"line_number":876,"context_line":"    def _image_from_req_data(self, server_dict, create_kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_f28ccb81","line":873,"range":{"start_line":873,"start_character":15,"end_line":873,"end_character":53},"updated":"2018-09-24 19:19:31.000000000","message":"consolidate with L869","commit_id":"65b5dd09ab30b2a034ed7eb55c518eb0111229de"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"871db990461659c444d7bf8eb64ceb1bf7027263","unresolved":false,"context_lines":[{"line_number":870,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":871,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"},{"line_number":872,"context_line":"                    \u0027delete\u0027, id)"},{"line_number":873,"context_line":"        except exception.AllocationDeleteFailed as e:"},{"line_number":874,"context_line":"            raise webob.exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":875,"context_line":""},{"line_number":876,"context_line":"    def _image_from_req_data(self, server_dict, create_kwargs):"}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_75373b4d","line":873,"range":{"start_line":873,"start_character":15,"end_line":873,"end_character":53},"in_reply_to":"3f79a3b5_f28ccb81","updated":"2018-09-25 09:17:21.000000000","message":"good point. as I failed to write python3 compatible test I need to respin the patch anyhow.\nDone.","commit_id":"65b5dd09ab30b2a034ed7eb55c518eb0111229de"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"47f404d7a7281dea750212819b302adea0977f5c","unresolved":false,"context_lines":[{"line_number":866,"context_line":"        except exception.InstanceUnknownCell as e:"},{"line_number":867,"context_line":"            raise exc.HTTPNotFound(explanation\u003de.format_message())"},{"line_number":868,"context_line":"        except (exception.InstanceIsLocked,"},{"line_number":869,"context_line":"                exception.AllocationDeleteFailed) as e:"},{"line_number":870,"context_line":"            raise exc.HTTPConflict(explanation\u003de.format_message())"},{"line_number":871,"context_line":"        except exception.InstanceInvalidState as state_error:"},{"line_number":872,"context_line":"            common.raise_http_conflict_for_instance_invalid_state(state_error,"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_ad4107a9","line":869,"range":{"start_line":869,"start_character":26,"end_line":869,"end_character":48},"updated":"2018-09-25 14:46:44.000000000","message":"✔","commit_id":"6f1a1f5e8ead9ceb145e13927cd9ae7fdca9add4"}],"nova/compute/manager.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ea52457684a52fa7f92feb2b35c9d1fce19aded","unresolved":false,"context_lines":[{"line_number":753,"context_line":"        self._notify_about_instance_usage(context, instance, \"delete.end\")"},{"line_number":754,"context_line":"        compute_utils.notify_about_instance_action(context, instance,"},{"line_number":755,"context_line":"                self.host, action\u003dfields.NotificationAction.DELETE,"},{"line_number":756,"context_line":"                phase\u003dfields.NotificationPhase.END, bdms\u003dbdms)"},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"    def _complete_deletion(self, context, instance):"},{"line_number":759,"context_line":"        self._update_resource_tracker(context, instance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_95ccf361","line":756,"updated":"2018-09-19 14:18:02.000000000","message":"Just for my information, does the _complete_partial_deletion() method only get executed when the instance has been set to an ERROR state due to some previous failure (such as the placement service not being able to set allocations to empty due to a consumer generation conflict)?","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"327f1dadcbbc50819aee2f70b7ae7f6654718630","unresolved":false,"context_lines":[{"line_number":753,"context_line":"        self._notify_about_instance_usage(context, instance, \"delete.end\")"},{"line_number":754,"context_line":"        compute_utils.notify_about_instance_action(context, instance,"},{"line_number":755,"context_line":"                self.host, action\u003dfields.NotificationAction.DELETE,"},{"line_number":756,"context_line":"                phase\u003dfields.NotificationPhase.END, bdms\u003dbdms)"},{"line_number":757,"context_line":""},{"line_number":758,"context_line":"    def _complete_deletion(self, context, instance):"},{"line_number":759,"context_line":"        self._update_resource_tracker(context, instance)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_aba36fb0","line":756,"in_reply_to":"3f79a3b5_95ccf361","updated":"2018-09-21 12:53:38.000000000","message":"The only caller of _complete_partial_deletion is the compute service init_host function that is called at service startup. It walks through all the instances that are associated to the given compute host and if founds one in vm_states.DELETED state but not marked deleted in the DB then it does the deletion. So this is not the ERROR case you are after.","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2256ad9c0e45cc8d602ec1bfd85758b3421f87d9","unresolved":false,"context_lines":[{"line_number":1953,"context_line":"                raise_if_no_more_retry\u003dexception.AllocationDeleteFailed("},{"line_number":1954,"context_line":"                    consumer_uuid\u003duuid, error\u003dreason))"},{"line_number":1955,"context_line":"        # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":1956,"context_line":"        # delete something which doesn\u0027t actually exist."},{"line_number":1957,"context_line":"        elif r.status_code !\u003d 404:"},{"line_number":1958,"context_line":"            LOG.warning(\u0027Unable to delete allocation for instance \u0027"},{"line_number":1959,"context_line":"                        \u0027%(uuid)s: (%(code)i %(text)s)\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_0a52b23b","line":1956,"updated":"2018-08-15 12:50:16.000000000","message":"If the status code _is_ 404 here, the loop will fall through and the method will return None, which is effectively the same as False.\n\nIs that correct?","commit_id":"958b6f70ea3b56eec993c855ea526e2f28959ab5"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"52aa9a946a33228518de922466a6fff3198bbb88","unresolved":false,"context_lines":[{"line_number":1953,"context_line":"                raise_if_no_more_retry\u003dexception.AllocationDeleteFailed("},{"line_number":1954,"context_line":"                    consumer_uuid\u003duuid, error\u003dreason))"},{"line_number":1955,"context_line":"        # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":1956,"context_line":"        # delete something which doesn\u0027t actually exist."},{"line_number":1957,"context_line":"        elif r.status_code !\u003d 404:"},{"line_number":1958,"context_line":"            LOG.warning(\u0027Unable to delete allocation for instance \u0027"},{"line_number":1959,"context_line":"                        \u0027%(uuid)s: (%(code)i %(text)s)\u0027,"}],"source_content_type":"text/x-python","patch_set":1,"id":"3f79a3b5_5784b8d2","line":1956,"in_reply_to":"3f79a3b5_0a52b23b","updated":"2018-08-16 08:50:38.000000000","message":"Good point. I think it would be better to return False explicitly.","commit_id":"958b6f70ea3b56eec993c855ea526e2f28959ab5"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"69cb335cb05c1bf949199162f4929fc20276d6dc","unresolved":false,"context_lines":[{"line_number":1912,"context_line":"        :param uuid: the instance UUID which will be used as the consumer UUID"},{"line_number":1913,"context_line":"                     towards placement"},{"line_number":1914,"context_line":"        :return: Returns True if the allocation is successfully deleted by this"},{"line_number":1915,"context_line":"                 call. Returns False if the allocation does not exists."},{"line_number":1916,"context_line":"        :raises AllocationDeleteFailed: If the allocation exists but we cannot"},{"line_number":1917,"context_line":"                read it from placement or it is changed by another process"},{"line_number":1918,"context_line":"                while we tried to delete it."}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_4f6fc027","line":1915,"range":{"start_line":1915,"start_character":64,"end_line":1915,"end_character":70},"updated":"2018-09-15 17:57:24.000000000","message":"exist","commit_id":"5b3fbc05ed66f028afeb22c7741923a0207e0498"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"327f1dadcbbc50819aee2f70b7ae7f6654718630","unresolved":false,"context_lines":[{"line_number":1912,"context_line":"        :param uuid: the instance UUID which will be used as the consumer UUID"},{"line_number":1913,"context_line":"                     towards placement"},{"line_number":1914,"context_line":"        :return: Returns True if the allocation is successfully deleted by this"},{"line_number":1915,"context_line":"                 call. Returns False if the allocation does not exists."},{"line_number":1916,"context_line":"        :raises AllocationDeleteFailed: If the allocation exists but we cannot"},{"line_number":1917,"context_line":"                read it from placement or it is changed by another process"},{"line_number":1918,"context_line":"                while we tried to delete it."}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_1cd0aef6","line":1915,"range":{"start_line":1915,"start_character":64,"end_line":1915,"end_character":70},"in_reply_to":"3f79a3b5_4f6fc027","updated":"2018-09-21 12:53:38.000000000","message":"Done","commit_id":"5b3fbc05ed66f028afeb22c7741923a0207e0498"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"69cb335cb05c1bf949199162f4929fc20276d6dc","unresolved":false,"context_lines":[{"line_number":1941,"context_line":"            # the consumer did not exist in the first place"},{"line_number":1942,"context_line":"            return False"},{"line_number":1943,"context_line":""},{"line_number":1944,"context_line":"        # removing every resources from the allocation will auto delete the"},{"line_number":1945,"context_line":"        # consumer in placement"},{"line_number":1946,"context_line":"        allocations[\u0027allocations\u0027] \u003d {}"},{"line_number":1947,"context_line":"        r \u003d self.put(url, allocations, global_request_id\u003dcontext.global_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_2f4da4c3","line":1944,"range":{"start_line":1944,"start_character":19,"end_line":1944,"end_character":24},"updated":"2018-09-15 17:57:24.000000000","message":"all","commit_id":"5b3fbc05ed66f028afeb22c7741923a0207e0498"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"327f1dadcbbc50819aee2f70b7ae7f6654718630","unresolved":false,"context_lines":[{"line_number":1941,"context_line":"            # the consumer did not exist in the first place"},{"line_number":1942,"context_line":"            return False"},{"line_number":1943,"context_line":""},{"line_number":1944,"context_line":"        # removing every resources from the allocation will auto delete the"},{"line_number":1945,"context_line":"        # consumer in placement"},{"line_number":1946,"context_line":"        allocations[\u0027allocations\u0027] \u003d {}"},{"line_number":1947,"context_line":"        r \u003d self.put(url, allocations, global_request_id\u003dcontext.global_id,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_dcd556e7","line":1944,"range":{"start_line":1944,"start_character":19,"end_line":1944,"end_character":24},"in_reply_to":"3f79a3b5_2f4da4c3","updated":"2018-09-21 12:53:38.000000000","message":"Done","commit_id":"5b3fbc05ed66f028afeb22c7741923a0207e0498"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ea52457684a52fa7f92feb2b35c9d1fce19aded","unresolved":false,"context_lines":[{"line_number":2083,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % uuid"},{"line_number":2084,"context_line":"        # We read the consumer generation then try to put an empty allocation"},{"line_number":2085,"context_line":"        # for that consumer. If between the GET and the PUT the consumer"},{"line_number":2086,"context_line":"        # generation changes then we raise"},{"line_number":2087,"context_line":"        # NOTE(gibi): placement does not return 404 for non-existing consumer"},{"line_number":2088,"context_line":"        # but returns an empty consumer instead. Putting an empty allocation to"},{"line_number":2089,"context_line":"        # that non-existing consumer won\u0027t be 404 or other error either."}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_b5080f80","line":2086,"range":{"start_line":2086,"start_character":29,"end_line":2086,"end_character":42},"updated":"2018-09-19 14:18:02.000000000","message":"then we raise AllocationDeleteFailed","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"327f1dadcbbc50819aee2f70b7ae7f6654718630","unresolved":false,"context_lines":[{"line_number":2083,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % uuid"},{"line_number":2084,"context_line":"        # We read the consumer generation then try to put an empty allocation"},{"line_number":2085,"context_line":"        # for that consumer. If between the GET and the PUT the consumer"},{"line_number":2086,"context_line":"        # generation changes then we raise"},{"line_number":2087,"context_line":"        # NOTE(gibi): placement does not return 404 for non-existing consumer"},{"line_number":2088,"context_line":"        # but returns an empty consumer instead. Putting an empty allocation to"},{"line_number":2089,"context_line":"        # that non-existing consumer won\u0027t be 404 or other error either."}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_f6ce2a81","line":2086,"range":{"start_line":2086,"start_character":29,"end_line":2086,"end_character":42},"in_reply_to":"3f79a3b5_b5080f80","updated":"2018-09-21 12:53:38.000000000","message":"Done","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ea52457684a52fa7f92feb2b35c9d1fce19aded","unresolved":false,"context_lines":[{"line_number":2084,"context_line":"        # We read the consumer generation then try to put an empty allocation"},{"line_number":2085,"context_line":"        # for that consumer. If between the GET and the PUT the consumer"},{"line_number":2086,"context_line":"        # generation changes then we raise"},{"line_number":2087,"context_line":"        # NOTE(gibi): placement does not return 404 for non-existing consumer"},{"line_number":2088,"context_line":"        # but returns an empty consumer instead. Putting an empty allocation to"},{"line_number":2089,"context_line":"        # that non-existing consumer won\u0027t be 404 or other error either."},{"line_number":2090,"context_line":"        r \u003d self.get(url, global_request_id\u003dcontext.global_id,"},{"line_number":2091,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"},{"line_number":2092,"context_line":"        if not r:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_95687321","line":2089,"range":{"start_line":2087,"start_character":8,"end_line":2089,"end_character":72},"updated":"2018-09-19 14:18:02.000000000","message":"We should fix this (not in this patch of course). :( This is just one part of the problem with not having an actual concept of a consumer in the placement API.","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ba11ce365fc9dcdd9b62ec81d14436f1052b8ec","unresolved":false,"context_lines":[{"line_number":2084,"context_line":"        # We read the consumer generation then try to put an empty allocation"},{"line_number":2085,"context_line":"        # for that consumer. If between the GET and the PUT the consumer"},{"line_number":2086,"context_line":"        # generation changes then we raise"},{"line_number":2087,"context_line":"        # NOTE(gibi): placement does not return 404 for non-existing consumer"},{"line_number":2088,"context_line":"        # but returns an empty consumer instead. Putting an empty allocation to"},{"line_number":2089,"context_line":"        # that non-existing consumer won\u0027t be 404 or other error either."},{"line_number":2090,"context_line":"        r \u003d self.get(url, global_request_id\u003dcontext.global_id,"},{"line_number":2091,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"},{"line_number":2092,"context_line":"        if not r:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_31ccac32","line":2089,"range":{"start_line":2087,"start_character":8,"end_line":2089,"end_character":72},"in_reply_to":"3f79a3b5_3cc00a7c","updated":"2018-09-21 13:13:47.000000000","message":"Yes, that\u0027s the fix I\u0027m referring to :) And, no, I\u0027m not suggesting it be done in this patch series!","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"dbcbc28e65a2ba675efcb3c028ecb1eec041cd2a","unresolved":false,"context_lines":[{"line_number":2084,"context_line":"        # We read the consumer generation then try to put an empty allocation"},{"line_number":2085,"context_line":"        # for that consumer. If between the GET and the PUT the consumer"},{"line_number":2086,"context_line":"        # generation changes then we raise"},{"line_number":2087,"context_line":"        # NOTE(gibi): placement does not return 404 for non-existing consumer"},{"line_number":2088,"context_line":"        # but returns an empty consumer instead. Putting an empty allocation to"},{"line_number":2089,"context_line":"        # that non-existing consumer won\u0027t be 404 or other error either."},{"line_number":2090,"context_line":"        r \u003d self.get(url, global_request_id\u003dcontext.global_id,"},{"line_number":2091,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"},{"line_number":2092,"context_line":"        if not r:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_3cc00a7c","line":2089,"range":{"start_line":2087,"start_character":8,"end_line":2089,"end_character":72},"in_reply_to":"3f79a3b5_95687321","updated":"2018-09-21 08:45:08.000000000","message":"I\u0027m not sure I get what fix, other than modelling consumer in Placement can be done.","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ea52457684a52fa7f92feb2b35c9d1fce19aded","unresolved":false,"context_lines":[{"line_number":2101,"context_line":"                                                   error\u003dr.text)"},{"line_number":2102,"context_line":"        allocations \u003d r.json()"},{"line_number":2103,"context_line":"        if allocations[\u0027allocations\u0027] \u003d\u003d {}:"},{"line_number":2104,"context_line":"            # the consumer did not exist in the first place"},{"line_number":2105,"context_line":"            return False"},{"line_number":2106,"context_line":""},{"line_number":2107,"context_line":"        # removing every resources from the allocation will auto delete the"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_e0ee921f","line":2104,"updated":"2018-09-19 14:18:02.000000000","message":"Please add a LOG.debug() message in here to assist folks trying to understand why delete_allocation_for_consumer() returned False (not that we\u0027re checking the return value from the callers of this function, but still...)","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"327f1dadcbbc50819aee2f70b7ae7f6654718630","unresolved":false,"context_lines":[{"line_number":2101,"context_line":"                                                   error\u003dr.text)"},{"line_number":2102,"context_line":"        allocations \u003d r.json()"},{"line_number":2103,"context_line":"        if allocations[\u0027allocations\u0027] \u003d\u003d {}:"},{"line_number":2104,"context_line":"            # the consumer did not exist in the first place"},{"line_number":2105,"context_line":"            return False"},{"line_number":2106,"context_line":""},{"line_number":2107,"context_line":"        # removing every resources from the allocation will auto delete the"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_d6176e9c","line":2104,"in_reply_to":"3f79a3b5_e0ee921f","updated":"2018-09-21 12:53:38.000000000","message":"Done","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ea52457684a52fa7f92feb2b35c9d1fce19aded","unresolved":false,"context_lines":[{"line_number":2106,"context_line":""},{"line_number":2107,"context_line":"        # removing every resources from the allocation will auto delete the"},{"line_number":2108,"context_line":"        # consumer in placement"},{"line_number":2109,"context_line":"        allocations[\u0027allocations\u0027] \u003d {}"},{"line_number":2110,"context_line":"        r \u003d self.put(url, allocations, global_request_id\u003dcontext.global_id,"},{"line_number":2111,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"},{"line_number":2112,"context_line":"        if r.status_code \u003d\u003d 204:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_80b6be24","line":2109,"updated":"2018-09-19 14:18:02.000000000","message":"We need to add the consumer_generation to the payload, no?","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ba11ce365fc9dcdd9b62ec81d14436f1052b8ec","unresolved":false,"context_lines":[{"line_number":2106,"context_line":""},{"line_number":2107,"context_line":"        # removing every resources from the allocation will auto delete the"},{"line_number":2108,"context_line":"        # consumer in placement"},{"line_number":2109,"context_line":"        allocations[\u0027allocations\u0027] \u003d {}"},{"line_number":2110,"context_line":"        r \u003d self.put(url, allocations, global_request_id\u003dcontext.global_id,"},{"line_number":2111,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"},{"line_number":2112,"context_line":"        if r.status_code \u003d\u003d 204:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_b1df5cd5","line":2109,"in_reply_to":"3f79a3b5_61d81d51","updated":"2018-09-21 13:13:47.000000000","message":"Ah, right you are, as usual, Giblet :)","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"dbcbc28e65a2ba675efcb3c028ecb1eec041cd2a","unresolved":false,"context_lines":[{"line_number":2106,"context_line":""},{"line_number":2107,"context_line":"        # removing every resources from the allocation will auto delete the"},{"line_number":2108,"context_line":"        # consumer in placement"},{"line_number":2109,"context_line":"        allocations[\u0027allocations\u0027] \u003d {}"},{"line_number":2110,"context_line":"        r \u003d self.put(url, allocations, global_request_id\u003dcontext.global_id,"},{"line_number":2111,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"},{"line_number":2112,"context_line":"        if r.status_code \u003d\u003d 204:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_61d81d51","line":2109,"in_reply_to":"3f79a3b5_80b6be24","updated":"2018-09-21 08:45:08.000000000","message":"allocations is the full dict we received from placement GET at L2090 containing project, user and consumer gen and allocations. Then here the code nukes the allocation key of that dict but does not change the rest. So the payload of the PUT request does have consumer_generation key in it.\n\n\nThis is a printout from the functional test case showing the payload of PUT:\n\n{u\u0027project_id\u0027: u\u00276f70656e737461636b20342065766572\u0027, u\u0027user_id\u0027: u\u0027admin\u0027, u\u0027allocations\u0027: {}, u\u0027consumer_generation\u0027: 1}\n\nI did made a mistake when I update the unit test for this call as there I did not used the proper response for the GET query. I will fix that in the next PS.","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cd93806898d3a3a06386de5a1f3c4653f241c7b","unresolved":false,"context_lines":[{"line_number":2076,"context_line":"                     towards placement"},{"line_number":2077,"context_line":"        :return: Returns True if the allocation is successfully deleted by this"},{"line_number":2078,"context_line":"                 call. Returns False if the allocation does not exist."},{"line_number":2079,"context_line":"        :raises AllocationDeleteFailed: If the allocation exists but we cannot"},{"line_number":2080,"context_line":"                read it from placement or it is changed by another process"},{"line_number":2081,"context_line":"                while we tried to delete it."},{"line_number":2082,"context_line":"        \"\"\""},{"line_number":2083,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % uuid"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_7fbaeabf","line":2080,"range":{"start_line":2079,"start_character":65,"end_line":2080,"end_character":38},"updated":"2018-09-21 15:27:44.000000000","message":"I\u0027m not sure what this means - how can we know it exists if we can\u0027t GET it? Also note that CachingScheduler won\u0027t create allocations, so will this prevent people running the CachingScheduler from being able to delete instances which don\u0027t have allocations?","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"aa137f17afe9c4f0dd213bdc6ba8326078234f95","unresolved":false,"context_lines":[{"line_number":2076,"context_line":"                     towards placement"},{"line_number":2077,"context_line":"        :return: Returns True if the allocation is successfully deleted by this"},{"line_number":2078,"context_line":"                 call. Returns False if the allocation does not exist."},{"line_number":2079,"context_line":"        :raises AllocationDeleteFailed: If the allocation exists but we cannot"},{"line_number":2080,"context_line":"                read it from placement or it is changed by another process"},{"line_number":2081,"context_line":"                while we tried to delete it."},{"line_number":2082,"context_line":"        \"\"\""},{"line_number":2083,"context_line":"        url \u003d \u0027/allocations/%s\u0027 % uuid"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_e363a718","line":2080,"range":{"start_line":2079,"start_character":65,"end_line":2080,"end_character":38},"in_reply_to":"3f79a3b5_7fbaeabf","updated":"2018-09-24 16:04:13.000000000","message":"\u003e I\u0027m not sure what this means - how can we know it exists if we\n \u003e can\u0027t GET it? \n\nTrue. :) There is no case that a consumer does not exists as placement auto-creates it during the GET if it does not exists. \n\n \u003e Also note that CachingScheduler won\u0027t create\n \u003e allocations, so will this prevent people running the\n \u003e CachingScheduler from being able to delete instances which don\u0027t\n \u003e have allocations?\n\nI think it will work as placement will return an empty allocation and then this function returns False. Interestingly there is only one caller (_delete_allocation_after_move) that checks the return value of this call. In case of caching scheduler that will lead to an error log \"Failed to save manipulated allocation\" but doesn\u0027t break the ongoing VM lifecycle operation.","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cd93806898d3a3a06386de5a1f3c4653f241c7b","unresolved":false,"context_lines":[{"line_number":2085,"context_line":"        # for that consumer. If between the GET and the PUT the consumer"},{"line_number":2086,"context_line":"        # generation changes then we raise AllocationDeleteFailed."},{"line_number":2087,"context_line":"        # NOTE(gibi): placement does not return 404 for non-existing consumer"},{"line_number":2088,"context_line":"        # but returns an empty consumer instead. Putting an empty allocation to"},{"line_number":2089,"context_line":"        # that non-existing consumer won\u0027t be 404 or other error either."},{"line_number":2090,"context_line":"        r \u003d self.get(url, global_request_id\u003dcontext.global_id,"},{"line_number":2091,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_7fdf4a0b","line":2088,"range":{"start_line":2088,"start_character":22,"end_line":2088,"end_character":47},"updated":"2018-09-21 15:27:44.000000000","message":"Returns {\"allocations\": {}} right?","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"aa137f17afe9c4f0dd213bdc6ba8326078234f95","unresolved":false,"context_lines":[{"line_number":2085,"context_line":"        # for that consumer. If between the GET and the PUT the consumer"},{"line_number":2086,"context_line":"        # generation changes then we raise AllocationDeleteFailed."},{"line_number":2087,"context_line":"        # NOTE(gibi): placement does not return 404 for non-existing consumer"},{"line_number":2088,"context_line":"        # but returns an empty consumer instead. Putting an empty allocation to"},{"line_number":2089,"context_line":"        # that non-existing consumer won\u0027t be 404 or other error either."},{"line_number":2090,"context_line":"        r \u003d self.get(url, global_request_id\u003dcontext.global_id,"},{"line_number":2091,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_7b14214e","line":2088,"range":{"start_line":2088,"start_character":22,"end_line":2088,"end_character":47},"in_reply_to":"3f79a3b5_7fdf4a0b","updated":"2018-09-24 16:04:13.000000000","message":"It returns\n{\n\"allocations\": {},\n\"user_id\": \u003cuser_id\u003e\n\"project_id\": \u003cproject_id\u003e,\n\"consumer_generation\": \u003cgen\u003e (most probably 0 as this is a new consumer)\n}","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cd93806898d3a3a06386de5a1f3c4653f241c7b","unresolved":false,"context_lines":[{"line_number":2089,"context_line":"        # that non-existing consumer won\u0027t be 404 or other error either."},{"line_number":2090,"context_line":"        r \u003d self.get(url, global_request_id\u003dcontext.global_id,"},{"line_number":2091,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"},{"line_number":2092,"context_line":"        if not r:"},{"line_number":2093,"context_line":"            # at the moment there is no way placement returns a failure so we"},{"line_number":2094,"context_line":"            # could even delete this code"},{"line_number":2095,"context_line":"            LOG.warning(\u0027Unable to delete allocation for instance \u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_5fdcce16","line":2092,"updated":"2018-09-21 15:27:44.000000000","message":"So this is checking the response status code for status_code\u003e\u003d400, OK.","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cd93806898d3a3a06386de5a1f3c4653f241c7b","unresolved":false,"context_lines":[{"line_number":2101,"context_line":"                                                   error\u003dr.text)"},{"line_number":2102,"context_line":"        allocations \u003d r.json()"},{"line_number":2103,"context_line":"        if allocations[\u0027allocations\u0027] \u003d\u003d {}:"},{"line_number":2104,"context_line":"            # the consumer did not exist in the first place"},{"line_number":2105,"context_line":"            LOG.debug(\u0027Cannot delete allocation for %s consumer in placement \u0027"},{"line_number":2106,"context_line":"                      \u0027as consumer does not exists\u0027, uuid)"},{"line_number":2107,"context_line":"            return False"},{"line_number":2108,"context_line":""},{"line_number":2109,"context_line":"        # removing all resources from the allocation will auto delete the"},{"line_number":2110,"context_line":"        # consumer in placement"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_dfcf7e54","line":2107,"range":{"start_line":2104,"start_character":12,"end_line":2107,"end_character":24},"updated":"2018-09-21 15:27:44.000000000","message":"OK I think this is the CachingScheduler case so we should be OK as long as something doesn\u0027t fail when this method returns False.","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"aa137f17afe9c4f0dd213bdc6ba8326078234f95","unresolved":false,"context_lines":[{"line_number":2101,"context_line":"                                                   error\u003dr.text)"},{"line_number":2102,"context_line":"        allocations \u003d r.json()"},{"line_number":2103,"context_line":"        if allocations[\u0027allocations\u0027] \u003d\u003d {}:"},{"line_number":2104,"context_line":"            # the consumer did not exist in the first place"},{"line_number":2105,"context_line":"            LOG.debug(\u0027Cannot delete allocation for %s consumer in placement \u0027"},{"line_number":2106,"context_line":"                      \u0027as consumer does not exists\u0027, uuid)"},{"line_number":2107,"context_line":"            return False"},{"line_number":2108,"context_line":""},{"line_number":2109,"context_line":"        # removing all resources from the allocation will auto delete the"},{"line_number":2110,"context_line":"        # consumer in placement"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_9b47bd7b","line":2107,"range":{"start_line":2104,"start_character":12,"end_line":2107,"end_character":24},"in_reply_to":"3f79a3b5_dfcf7e54","updated":"2018-09-24 16:04:13.000000000","message":"I think it is the case for CachingScheduler.","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"0cd93806898d3a3a06386de5a1f3c4653f241c7b","unresolved":false,"context_lines":[{"line_number":2106,"context_line":"                      \u0027as consumer does not exists\u0027, uuid)"},{"line_number":2107,"context_line":"            return False"},{"line_number":2108,"context_line":""},{"line_number":2109,"context_line":"        # removing all resources from the allocation will auto delete the"},{"line_number":2110,"context_line":"        # consumer in placement"},{"line_number":2111,"context_line":"        allocations[\u0027allocations\u0027] \u003d {}"},{"line_number":2112,"context_line":"        r \u003d self.put(url, allocations, global_request_id\u003dcontext.global_id,"},{"line_number":2113,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_5f05ae78","line":2110,"range":{"start_line":2109,"start_character":8,"end_line":2110,"end_character":31},"updated":"2018-09-21 15:27:44.000000000","message":"This might be worth noting in the API reference:\n\nhttps://developer.openstack.org/api-ref/placement/#update-allocations","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"aa137f17afe9c4f0dd213bdc6ba8326078234f95","unresolved":false,"context_lines":[{"line_number":2106,"context_line":"                      \u0027as consumer does not exists\u0027, uuid)"},{"line_number":2107,"context_line":"            return False"},{"line_number":2108,"context_line":""},{"line_number":2109,"context_line":"        # removing all resources from the allocation will auto delete the"},{"line_number":2110,"context_line":"        # consumer in placement"},{"line_number":2111,"context_line":"        allocations[\u0027allocations\u0027] \u003d {}"},{"line_number":2112,"context_line":"        r \u003d self.put(url, allocations, global_request_id\u003dcontext.global_id,"},{"line_number":2113,"context_line":"                     version\u003dCONSUMER_GENERATION_VERSION)"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_43cb7b72","line":2110,"range":{"start_line":2109,"start_character":8,"end_line":2110,"end_character":31},"in_reply_to":"3f79a3b5_5f05ae78","updated":"2018-09-24 16:04:13.000000000","message":"I filed a bug to fix the API ref. https://bugs.launchpad.net/nova/+bug/1794138","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"1a8871d114ac56f62de24d676da837b2098b6f58","unresolved":false,"context_lines":[{"line_number":2065,"context_line":"        # NOTE(gibi): This only detect a small portion of possible cases when"},{"line_number":2066,"context_line":"        # allocation is modified outside of the delete code path. The rest can"},{"line_number":2067,"context_line":"        # only be detected if nova would cache at least the consumer generation"},{"line_number":2068,"context_line":"        # of the instance."},{"line_number":2069,"context_line":"        # NOTE(gibi): placement does not return 404 for non-existing consumer"},{"line_number":2070,"context_line":"        # but returns an empty consumer instead. Putting an empty allocation to"},{"line_number":2071,"context_line":"        # that non-existing consumer won\u0027t be 404 or other error either."}],"source_content_type":"text/x-python","patch_set":7,"id":"3f79a3b5_def3d908","line":2068,"updated":"2018-09-24 22:03:00.000000000","message":"++","commit_id":"65b5dd09ab30b2a034ed7eb55c518eb0111229de"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"69cb335cb05c1bf949199162f4929fc20276d6dc","unresolved":false,"context_lines":[{"line_number":4289,"context_line":""},{"line_number":4290,"context_line":"        server \u003d self._boot_and_check_allocations(self.flavor, source_hostname)"},{"line_number":4291,"context_line":""},{"line_number":4292,"context_line":"        rsp \u003d mock.Mock()"},{"line_number":4293,"context_line":"        rsp.status_code \u003d 409"},{"line_number":4294,"context_line":"        rsp.text \u003d \u0027consumer generation conflict\u0027"},{"line_number":4295,"context_line":""},{"line_number":4296,"context_line":"        with mock.patch(\u0027keystoneauth1.adapter.Adapter.put\u0027,"},{"line_number":4297,"context_line":"                        autospec\u003dTrue) as mock_put:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_cfd190ce","line":4294,"range":{"start_line":4292,"start_character":0,"end_line":4294,"end_character":49},"updated":"2018-09-15 17:57:24.000000000","message":"Use nova.tests.unit.fake_requests.FakeResponse instead.","commit_id":"5b3fbc05ed66f028afeb22c7741923a0207e0498"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"327f1dadcbbc50819aee2f70b7ae7f6654718630","unresolved":false,"context_lines":[{"line_number":4289,"context_line":""},{"line_number":4290,"context_line":"        server \u003d self._boot_and_check_allocations(self.flavor, source_hostname)"},{"line_number":4291,"context_line":""},{"line_number":4292,"context_line":"        rsp \u003d mock.Mock()"},{"line_number":4293,"context_line":"        rsp.status_code \u003d 409"},{"line_number":4294,"context_line":"        rsp.text \u003d \u0027consumer generation conflict\u0027"},{"line_number":4295,"context_line":""},{"line_number":4296,"context_line":"        with mock.patch(\u0027keystoneauth1.adapter.Adapter.put\u0027,"},{"line_number":4297,"context_line":"                        autospec\u003dTrue) as mock_put:"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_2b6e7f95","line":4294,"range":{"start_line":4292,"start_character":0,"end_line":4294,"end_character":49},"in_reply_to":"3f79a3b5_cfd190ce","updated":"2018-09-21 12:53:38.000000000","message":"Done","commit_id":"5b3fbc05ed66f028afeb22c7741923a0207e0498"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3ea52457684a52fa7f92feb2b35c9d1fce19aded","unresolved":false,"context_lines":[{"line_number":4553,"context_line":""},{"line_number":4554,"context_line":"        rsp \u003d mock.Mock()"},{"line_number":4555,"context_line":"        rsp.status_code \u003d 409"},{"line_number":4556,"context_line":"        rsp.text \u003d \u0027consumer generation conflict\u0027"},{"line_number":4557,"context_line":""},{"line_number":4558,"context_line":"        with mock.patch(\u0027keystoneauth1.adapter.Adapter.put\u0027,"},{"line_number":4559,"context_line":"                        autospec\u003dTrue) as mock_put:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_00594efb","line":4556,"updated":"2018-09-19 14:18:02.000000000","message":"This is fine, but it\u0027s more of a unit test than a functional test. If it was a functional test, it would have caught the fact that you are missing the consumer_generation from the request payload for PUT /allocations/{consumer_uuid} :)","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"dbcbc28e65a2ba675efcb3c028ecb1eec041cd2a","unresolved":false,"context_lines":[{"line_number":4553,"context_line":""},{"line_number":4554,"context_line":"        rsp \u003d mock.Mock()"},{"line_number":4555,"context_line":"        rsp.status_code \u003d 409"},{"line_number":4556,"context_line":"        rsp.text \u003d \u0027consumer generation conflict\u0027"},{"line_number":4557,"context_line":""},{"line_number":4558,"context_line":"        with mock.patch(\u0027keystoneauth1.adapter.Adapter.put\u0027,"},{"line_number":4559,"context_line":"                        autospec\u003dTrue) as mock_put:"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_81e539dd","line":4556,"in_reply_to":"3f79a3b5_00594efb","updated":"2018-09-21 08:45:08.000000000","message":"Regarding consumer_generation see my reply in the report.py. :)\n\nRegarding functionalness of this test: I need to simulate that somebody in parallel changes the allocation in placement while the delete runs in nova. This is one way to simulate that. The other would be to mock the nova code to slow it down and try to execute a parallel placement PUT /allocation call in the meantime. Another would be to mock actual placement code that does the consumer_generation check deep in placement.\nI feel those would be similarly invasive from functional test perspective. \n\nI still want to have a test where the exception raised by nova can bubble up in the nova call stack to see the effect of such exception.","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f5c67c2105c78a2b00ae0ddcf9d2d15c2f82bdd8","unresolved":false,"context_lines":[{"line_number":4533,"context_line":"        self.assertNotEqual(other_host, found_server[\u0027OS-EXT-SRV-ATTR:host\u0027])"},{"line_number":4534,"context_line":""},{"line_number":4535,"context_line":""},{"line_number":4536,"context_line":"class ConsumerGenerationConflictTest("},{"line_number":4537,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":4538,"context_line":""},{"line_number":4539,"context_line":"    # we need the medium driver to be able to allocate resource not just for"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_7f7bcaf2","line":4536,"range":{"start_line":4536,"start_character":6,"end_line":4536,"end_character":36},"updated":"2018-09-21 15:29:44.000000000","message":"Would extending this class and running it with the CachingScheduler should any differences in behavior? I mean, obviously the allocations wouldn\u0027t be present. Maybe the answer is just, \"it\u0027s time to remove the CachingScheduler\" and then we don\u0027t have to worry about it.","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"aa137f17afe9c4f0dd213bdc6ba8326078234f95","unresolved":false,"context_lines":[{"line_number":4533,"context_line":"        self.assertNotEqual(other_host, found_server[\u0027OS-EXT-SRV-ATTR:host\u0027])"},{"line_number":4534,"context_line":""},{"line_number":4535,"context_line":""},{"line_number":4536,"context_line":"class ConsumerGenerationConflictTest("},{"line_number":4537,"context_line":"        integrated_helpers.ProviderUsageBaseTestCase):"},{"line_number":4538,"context_line":""},{"line_number":4539,"context_line":"    # we need the medium driver to be able to allocate resource not just for"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_e31ac77a","line":4536,"range":{"start_line":4536,"start_character":6,"end_line":4536,"end_character":36},"in_reply_to":"3f79a3b5_7f7bcaf2","updated":"2018-09-24 16:04:13.000000000","message":"See my answer in the report client. If you still feel that it needs test coverage then Sure I can add that.","commit_id":"56153439770e66b4de840914dce5f481cdc42695"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"47f404d7a7281dea750212819b302adea0977f5c","unresolved":false,"context_lines":[{"line_number":4584,"context_line":"        server \u003d self._boot_and_check_allocations(self.flavor, source_hostname)"},{"line_number":4585,"context_line":"        source_compute_id \u003d self.admin_api.get_services("},{"line_number":4586,"context_line":"            host\u003dself.compute1.host, binary\u003d\u0027nova-compute\u0027)[0][\u0027id\u0027]"},{"line_number":4587,"context_line":"        self.compute1.stop()"},{"line_number":4588,"context_line":"        self.admin_api.put_service("},{"line_number":4589,"context_line":"            source_compute_id, {\u0027forced_down\u0027: \u0027true\u0027})"},{"line_number":4590,"context_line":""},{"line_number":4591,"context_line":"        rsp \u003d fake_requests.FakeResponse("},{"line_number":4592,"context_line":"            409, jsonutils.dumps({\u0027text\u0027: \u0027consumer generation conflict\u0027}))"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_2d5df778","line":4589,"range":{"start_line":4587,"start_character":8,"end_line":4589,"end_character":55},"updated":"2018-09-25 14:46:44.000000000","message":"OK this enables the local delete flow in the API. Comments in the test would have been nice, but that\u0027s a nit.","commit_id":"6f1a1f5e8ead9ceb145e13927cd9ae7fdca9add4"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4115391b980448a3d807cef658c1dc3e4590adc7","unresolved":false,"context_lines":[{"line_number":4599,"context_line":"                                   self.api.delete_server, server[\u0027id\u0027])"},{"line_number":4600,"context_line":"            self.assertEqual(409, ex.response.status_code)"},{"line_number":4601,"context_line":"            self.assertIn(\u0027Failed to delete allocations for consumer\u0027,"},{"line_number":4602,"context_line":"                          jsonutils.loads(ex.response.content)["},{"line_number":4603,"context_line":"                              \u0027conflictingRequest\u0027][\u0027message\u0027])"},{"line_number":4604,"context_line":"            self.assertEqual(1, mock_put.call_count)"},{"line_number":4605,"context_line":""}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_64d8eb7f","line":4602,"range":{"start_line":4602,"start_character":26,"end_line":4602,"end_character":62},"updated":"2018-09-25 13:19:17.000000000","message":"or ex.response.json()","commit_id":"6f1a1f5e8ead9ceb145e13927cd9ae7fdca9add4"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"47f404d7a7281dea750212819b302adea0977f5c","unresolved":false,"context_lines":[{"line_number":4614,"context_line":"        self.assertFlavorMatchesAllocation(self.flavor, source_allocation)"},{"line_number":4615,"context_line":""},{"line_number":4616,"context_line":"        # retry the delete to make sure that allocations are removed this time"},{"line_number":4617,"context_line":"        self._delete_and_check_allocations(server)"}],"source_content_type":"text/x-python","patch_set":8,"id":"3f79a3b5_addd87de","line":4617,"updated":"2018-09-25 14:46:44.000000000","message":"OK this works b/c you\u0027re not mocking KSA this time...","commit_id":"6f1a1f5e8ead9ceb145e13927cd9ae7fdca9add4"}],"nova/tests/unit/scheduler/client/test_report.py":[{"author":{"_account_id":9708,"name":"Balazs Gibizer","display_name":"gibi","email":"gibizer@gmail.com","username":"gibi"},"change_message_id":"dbcbc28e65a2ba675efcb3c028ecb1eec041cd2a","unresolved":false,"context_lines":[{"line_number":3299,"context_line":"                \u0027put\u0027)"},{"line_number":3300,"context_line":"    def test_update_instance_allocation_delete(self, mock_put, mock_get):"},{"line_number":3301,"context_line":"        mock_get.return_value \u003d fake_requests.FakeResponse("},{"line_number":3302,"context_line":"            200, jsonutils.dumps({\u0027allocations\u0027: {\u0027fake\u0027: \u0027alloc\u0027}}))"},{"line_number":3303,"context_line":"        mock_put.return_value \u003d fake_requests.FakeResponse(204)"},{"line_number":3304,"context_line":"        cn \u003d objects.ComputeNode(uuid\u003duuids.cn)"},{"line_number":3305,"context_line":"        inst \u003d objects.Instance(uuid\u003duuids.inst)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_9ce83e16","line":3302,"updated":"2018-09-21 08:45:08.000000000","message":"This needs to be updated as this is not what placement returns when GET /allocations/consumer_uuid is called with 1.28 microversion.","commit_id":"15fbc8e7d8036a8592de57dfe8e56b92a45eb9db"}]}
