)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14525,"name":"Vasyl Saienko","email":"vsaienko@mirantis.com","username":"vsaienko"},"change_message_id":"77f8ddaa71e36a70a3fe7d442e29571aaef628fe","unresolved":false,"context_lines":[{"line_number":18,"context_line":"node is deleted. It also adds a method to the scheduler report client"},{"line_number":19,"context_line":"to make these calls to the placement API."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1661258"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: I6098d186d05ff8b9a568e23f860295a7bc2e6447"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"1a430d35_3989a2cb","line":21,"updated":"2017-02-03 09:32:04.000000000","message":"also closes bug https://bugs.launchpad.net/ironic/+bug/1661014\nverified here: https://review.openstack.org/#/c/414160/","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":18,"context_line":"node is deleted. It also adds a method to the scheduler report client"},{"line_number":19,"context_line":"to make these calls to the placement API."},{"line_number":20,"context_line":""},{"line_number":21,"context_line":"Closes-Bug: #1661258"},{"line_number":22,"context_line":""},{"line_number":23,"context_line":"Change-Id: I6098d186d05ff8b9a568e23f860295a7bc2e6447"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"1a430d35_666d4632","line":21,"in_reply_to":"1a430d35_3989a2cb","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"}],"nova/compute/manager.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1e9983d291bc8ab7fa5c5de39c31f8bfac2c3e8","unresolved":false,"context_lines":[{"line_number":514,"context_line":"        self.consoleauth_rpcapi \u003d consoleauth.rpcapi.ConsoleAuthAPI()"},{"line_number":515,"context_line":"        self.cells_rpcapi \u003d cells_rpcapi.CellsAPI()"},{"line_number":516,"context_line":"        self.scheduler_client \u003d scheduler_client.SchedulerClient()"},{"line_number":517,"context_line":"        self.report_client \u003d self.scheduler_client.reportclient"},{"line_number":518,"context_line":"        self._resource_tracker \u003d None"},{"line_number":519,"context_line":"        self.instance_events \u003d InstanceEvents()"},{"line_number":520,"context_line":"        self._sync_power_pool \u003d eventlet.GreenPool("}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_a0cf20b2","line":517,"updated":"2017-02-03 03:10:12.000000000","message":"nit: I\u0027d just call self.scheduler_client.report_client in the one place we need to and be done with it, I think we want to move this all into the resource tracker at some point anyway.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":514,"context_line":"        self.consoleauth_rpcapi \u003d consoleauth.rpcapi.ConsoleAuthAPI()"},{"line_number":515,"context_line":"        self.cells_rpcapi \u003d cells_rpcapi.CellsAPI()"},{"line_number":516,"context_line":"        self.scheduler_client \u003d scheduler_client.SchedulerClient()"},{"line_number":517,"context_line":"        self.report_client \u003d self.scheduler_client.reportclient"},{"line_number":518,"context_line":"        self._resource_tracker \u003d None"},{"line_number":519,"context_line":"        self.instance_events \u003d InstanceEvents()"},{"line_number":520,"context_line":"        self._sync_power_pool \u003d eventlet.GreenPool("}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_06bf22d1","line":517,"in_reply_to":"1a430d35_a0cf20b2","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1e9983d291bc8ab7fa5c5de39c31f8bfac2c3e8","unresolved":false,"context_lines":[{"line_number":6584,"context_line":"                             {\u0027id\u0027: cn.id, \u0027hh\u0027: cn.hypervisor_hostname,"},{"line_number":6585,"context_line":"                              \u0027nodes\u0027: nodenames})"},{"line_number":6586,"context_line":"                cn.destroy()"},{"line_number":6587,"context_line":"                # Delete the corresponding resource provider in placement,"},{"line_number":6588,"context_line":"                # along with any associated allocations and inventory."},{"line_number":6589,"context_line":"                self.report_client.delete_resource_provider(context, cn,"},{"line_number":6590,"context_line":"                                                            cascade\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_e0c928ae","line":6587,"updated":"2017-02-03 03:10:12.000000000","message":"nit: I think Jay wanted to eventually move this stuff into the resource tracker, so a TODO might be useful, but it\u0027s not a huge deal for this.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":6584,"context_line":"                             {\u0027id\u0027: cn.id, \u0027hh\u0027: cn.hypervisor_hostname,"},{"line_number":6585,"context_line":"                              \u0027nodes\u0027: nodenames})"},{"line_number":6586,"context_line":"                cn.destroy()"},{"line_number":6587,"context_line":"                # Delete the corresponding resource provider in placement,"},{"line_number":6588,"context_line":"                # along with any associated allocations and inventory."},{"line_number":6589,"context_line":"                self.report_client.delete_resource_provider(context, cn,"},{"line_number":6590,"context_line":"                                                            cascade\u003dTrue)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_26b41ef1","line":6587,"in_reply_to":"1a430d35_e0c928ae","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"5f6bf0864fc6f90b77ab874d1ffea5b4cdf9ab08","unresolved":false,"context_lines":[{"line_number":6587,"context_line":"                # along with any associated allocations and inventory."},{"line_number":6588,"context_line":"                # TODO(cdent): Move use of reportclient into resource tracker."},{"line_number":6589,"context_line":"                self.scheduler_client.reportclient.delete_resource_provider("},{"line_number":6590,"context_line":"                    context, cn, cascade\u003dTrue)"},{"line_number":6591,"context_line":""},{"line_number":6592,"context_line":"    def _get_compute_nodes_in_db(self, context, use_slave\u003dFalse):"},{"line_number":6593,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a430d35_312b7632","line":6590,"updated":"2017-02-03 11:33:09.000000000","message":"I guess, for things we already deleted from the DB, this doesn\u0027t help. But I guess thats almost nothing at this point. (Crosses fingers).","commit_id":"eb45dfa13b23f2905bfa5878e9aca8696cc6293d"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"ad623e14b3c905f9f25732ef11d4f26059be326a","unresolved":false,"context_lines":[{"line_number":6587,"context_line":"                # along with any associated allocations and inventory."},{"line_number":6588,"context_line":"                # TODO(cdent): Move use of reportclient into resource tracker."},{"line_number":6589,"context_line":"                self.scheduler_client.reportclient.delete_resource_provider("},{"line_number":6590,"context_line":"                    context, cn, cascade\u003dTrue)"},{"line_number":6591,"context_line":""},{"line_number":6592,"context_line":"    def _get_compute_nodes_in_db(self, context, use_slave\u003dFalse):"},{"line_number":6593,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a430d35_b14be6af","line":6590,"in_reply_to":"1a430d35_312b7632","updated":"2017-02-03 11:43:50.000000000","message":"Maybe we throw a release note in with this, something like\n\n  fixes:\n    - Fixes a bug where \u003c...\u003e. This will not remove any\n      nodes from the placement engine that have been\n      deleted (since foo commit?). Operators should compare\n      compute_nodes table to resource_provider table and\n      use the API to delete resource providers that are\n      not in the compute nodes table.","commit_id":"eb45dfa13b23f2905bfa5878e9aca8696cc6293d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"d01107aa49e9d75144b2aa5e50b18feb9bb3c5d3","unresolved":false,"context_lines":[{"line_number":6587,"context_line":"                # along with any associated allocations and inventory."},{"line_number":6588,"context_line":"                # TODO(cdent): Move use of reportclient into resource tracker."},{"line_number":6589,"context_line":"                self.scheduler_client.reportclient.delete_resource_provider("},{"line_number":6590,"context_line":"                    context, cn, cascade\u003dTrue)"},{"line_number":6591,"context_line":""},{"line_number":6592,"context_line":"    def _get_compute_nodes_in_db(self, context, use_slave\u003dFalse):"},{"line_number":6593,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a430d35_6c236506","line":6590,"in_reply_to":"1a430d35_4caf89e3","updated":"2017-02-03 11:59:05.000000000","message":"I was forgetting this could already an issue in production for folks, we should do that thing.","commit_id":"eb45dfa13b23f2905bfa5878e9aca8696cc6293d"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"a3e9822e07be715b359172405c8b0cba93cbe019","unresolved":false,"context_lines":[{"line_number":6587,"context_line":"                # along with any associated allocations and inventory."},{"line_number":6588,"context_line":"                # TODO(cdent): Move use of reportclient into resource tracker."},{"line_number":6589,"context_line":"                self.scheduler_client.reportclient.delete_resource_provider("},{"line_number":6590,"context_line":"                    context, cn, cascade\u003dTrue)"},{"line_number":6591,"context_line":""},{"line_number":6592,"context_line":"    def _get_compute_nodes_in_db(self, context, use_slave\u003dFalse):"},{"line_number":6593,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a430d35_4caf89e3","line":6590,"in_reply_to":"1a430d35_b14be6af","updated":"2017-02-03 11:49:08.000000000","message":"++ reno would be good. Also can confirm that this patch fixes the issue :)","commit_id":"eb45dfa13b23f2905bfa5878e9aca8696cc6293d"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d0b7cba1c70f728cafd39ab659d01d43c142658c","unresolved":false,"context_lines":[{"line_number":751,"context_line":"            instances \u003d objects.InstanceList.get_by_host(context, rp_uuid)"},{"line_number":752,"context_line":"            for instance in instances:"},{"line_number":753,"context_line":"                self._delete_allocation_for_instance(instance.uuid)"},{"line_number":754,"context_line":"            # Now delete the inventory"},{"line_number":755,"context_line":"            self._delete_inventory(rp_uuid)"},{"line_number":756,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"},{"line_number":757,"context_line":"        resp \u003d self.delete(url)"}],"source_content_type":"text/x-python","patch_set":1,"id":"3a461143_24aeaa98","line":754,"updated":"2017-02-02 19:31:55.000000000","message":"You don\u0027t need to delete the inventory. When the resource provider has no allocations, when you call delete() on the rp object it will delete inventory and aggregate associations.\n\nSo the instance stuff above is enough.","commit_id":"8f9c48bd67d99dcaa05eb695c9e260731f9d1d88"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"d0b7cba1c70f728cafd39ab659d01d43c142658c","unresolved":false,"context_lines":[{"line_number":758,"context_line":"        if resp:"},{"line_number":759,"context_line":"            LOG.info(_LI(\"Deleted resource provider  %s\"), rp_uuid)"},{"line_number":760,"context_line":"        else:"},{"line_number":761,"context_line":"            # Check for 404 since we don\"t need to log a warning if we tried to"},{"line_number":762,"context_line":"            # delete something which doesn\"t actually exist."},{"line_number":763,"context_line":"            if resp.status_code !\u003d 404:"},{"line_number":764,"context_line":"                LOG.warning("}],"source_content_type":"text/x-python","patch_set":1,"id":"3a461143_c48ec626","line":761,"updated":"2017-02-02 19:31:55.000000000","message":"don\u0027t","commit_id":"8f9c48bd67d99dcaa05eb695c9e260731f9d1d88"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"250b58ccf2e4f75efcd98c22c302204f5e24de51","unresolved":false,"context_lines":[{"line_number":745,"context_line":"        \"\"\""},{"line_number":746,"context_line":"        rp_uuid \u003d compute_node.uuid"},{"line_number":747,"context_line":"        if cascade:"},{"line_number":748,"context_line":"            # Delete any allocations for this resource provider. "},{"line_number":749,"context_line":"            # Since allocations are by consumer, we get the consumers on this"},{"line_number":750,"context_line":"            # host, which are its instances."},{"line_number":751,"context_line":"            instances \u003d objects.InstanceList.get_by_host(context, rp_uuid)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3a461143_0d58f1f9","line":748,"updated":"2017-02-02 20:24:25.000000000","message":"nit whitespace","commit_id":"aea131a015440f0d95cdd1090eeefe19ddf0213b"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"c2c24326c18e6f1284e4291990e89a105fa1a245","unresolved":false,"context_lines":[{"line_number":794,"context_line":"        :param alloc_data: A dict, keyed by resource class, of amounts consumed"},{"line_number":795,"context_line":"                           by the instance."},{"line_number":796,"context_line":"        \"\"\""},{"line_number":797,"context_line":"        self._put_allocations(rp_uuid, consumer_uuid, alloc_data)"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"    @safe_connect"},{"line_number":800,"context_line":"    def delete_resource_provider(self, context, compute_node, cascade\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_14d11afc","line":797,"updated":"2017-02-03 00:32:19.000000000","message":"Not sure why everything from here up is in this patch, suspect a broken rebase?","commit_id":"99e9ba9537f89ddabcbd26d0061d275d88963bcf"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"f251c93385d00c9cca827405226fa93f0dba56a8","unresolved":false,"context_lines":[{"line_number":794,"context_line":"        :param alloc_data: A dict, keyed by resource class, of amounts consumed"},{"line_number":795,"context_line":"                           by the instance."},{"line_number":796,"context_line":"        \"\"\""},{"line_number":797,"context_line":"        self._put_allocations(rp_uuid, consumer_uuid, alloc_data)"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"    @safe_connect"},{"line_number":800,"context_line":"    def delete_resource_provider(self, context, compute_node, cascade\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_945fca74","line":797,"in_reply_to":"1a430d35_14d11afc","updated":"2017-02-03 01:07:56.000000000","message":"My rebase skills are lacking tonight. Fixed.","commit_id":"99e9ba9537f89ddabcbd26d0061d275d88963bcf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"c2c24326c18e6f1284e4291990e89a105fa1a245","unresolved":false,"context_lines":[{"line_number":803,"context_line":"        If \u0027cascade\u0027 is True, it will first delete any associated Allocation"},{"line_number":804,"context_line":"        and Inventory records for that ResourceProvider. If \u0027cascade\u0027 is False,"},{"line_number":805,"context_line":"        and the ResourceProvider has any associated Allocation/Inventory"},{"line_number":806,"context_line":"        records, a ResourceProviderInUse exception will be raised."},{"line_number":807,"context_line":"        \"\"\""},{"line_number":808,"context_line":"        rp_uuid \u003d compute_node.uuid"},{"line_number":809,"context_line":"        if cascade:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_5476423f","line":806,"updated":"2017-02-03 00:32:19.000000000","message":"Could we use the standard :param: and :raises: things here?","commit_id":"99e9ba9537f89ddabcbd26d0061d275d88963bcf"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"f251c93385d00c9cca827405226fa93f0dba56a8","unresolved":false,"context_lines":[{"line_number":803,"context_line":"        If \u0027cascade\u0027 is True, it will first delete any associated Allocation"},{"line_number":804,"context_line":"        and Inventory records for that ResourceProvider. If \u0027cascade\u0027 is False,"},{"line_number":805,"context_line":"        and the ResourceProvider has any associated Allocation/Inventory"},{"line_number":806,"context_line":"        records, a ResourceProviderInUse exception will be raised."},{"line_number":807,"context_line":"        \"\"\""},{"line_number":808,"context_line":"        rp_uuid \u003d compute_node.uuid"},{"line_number":809,"context_line":"        if cascade:"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_3fa0af90","line":806,"in_reply_to":"1a430d35_5476423f","updated":"2017-02-03 01:07:56.000000000","message":"Ugh, I guess. I write docstrings to be read, not to generate additional docs, but it *is* the OpenStack way.","commit_id":"99e9ba9537f89ddabcbd26d0061d275d88963bcf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"c2c24326c18e6f1284e4291990e89a105fa1a245","unresolved":false,"context_lines":[{"line_number":810,"context_line":"            # Delete any allocations for this resource provider."},{"line_number":811,"context_line":"            # Since allocations are by consumer, we get the consumers on this"},{"line_number":812,"context_line":"            # host, which are its instances."},{"line_number":813,"context_line":"            instances \u003d objects.InstanceList.get_by_host(context, rp_uuid)"},{"line_number":814,"context_line":"            for instance in instances:"},{"line_number":815,"context_line":"                self._delete_allocation_for_instance(instance.uuid)"},{"line_number":816,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_3479b630","line":813,"updated":"2017-02-03 00:32:19.000000000","message":"In the ironic case, I believe this returns all instances that belong to a given compute *service*, not compute *node*. Which gives us two issues here: 1) this could be a really big list, meaning lots of RAM and API calls here, and 2) obviously we only want to delete allocations for instances on the compute node, not service.","commit_id":"99e9ba9537f89ddabcbd26d0061d275d88963bcf"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"f251c93385d00c9cca827405226fa93f0dba56a8","unresolved":false,"context_lines":[{"line_number":810,"context_line":"            # Delete any allocations for this resource provider."},{"line_number":811,"context_line":"            # Since allocations are by consumer, we get the consumers on this"},{"line_number":812,"context_line":"            # host, which are its instances."},{"line_number":813,"context_line":"            instances \u003d objects.InstanceList.get_by_host(context, rp_uuid)"},{"line_number":814,"context_line":"            for instance in instances:"},{"line_number":815,"context_line":"                self._delete_allocation_for_instance(instance.uuid)"},{"line_number":816,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_df816bfd","line":813,"in_reply_to":"1a430d35_3479b630","updated":"2017-02-03 01:07:56.000000000","message":"Good catch. I\u0027ll change this.","commit_id":"99e9ba9537f89ddabcbd26d0061d275d88963bcf"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"c2c24326c18e6f1284e4291990e89a105fa1a245","unresolved":false,"context_lines":[{"line_number":820,"context_line":"        else:"},{"line_number":821,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":822,"context_line":"            # delete something which doesn\"t actually exist."},{"line_number":823,"context_line":"            if resp.status_code !\u003d 404:"},{"line_number":824,"context_line":"                LOG.warning("},{"line_number":825,"context_line":"                    _LW(\"Unable to delete resource provider \""},{"line_number":826,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_d4af927b","line":823,"updated":"2017-02-03 00:32:19.000000000","message":"This feels wrong, if response is falsy it won\u0027t have a status_code attribute, right? Maybe the if on L818 is wrong?","commit_id":"99e9ba9537f89ddabcbd26d0061d275d88963bcf"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"f251c93385d00c9cca827405226fa93f0dba56a8","unresolved":false,"context_lines":[{"line_number":820,"context_line":"        else:"},{"line_number":821,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":822,"context_line":"            # delete something which doesn\"t actually exist."},{"line_number":823,"context_line":"            if resp.status_code !\u003d 404:"},{"line_number":824,"context_line":"                LOG.warning("},{"line_number":825,"context_line":"                    _LW(\"Unable to delete resource provider \""},{"line_number":826,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_1f95b33f","line":823,"in_reply_to":"1a430d35_d4af927b","updated":"2017-02-03 01:07:56.000000000","message":"I copied this from lines 703-708, with the exception of not using a single-letter variable name. It seems to be the webob pattern to make a non-2xx response False-y","commit_id":"99e9ba9537f89ddabcbd26d0061d275d88963bcf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"3bd8722fb2a05b050bd16399fbd4004fc4aec0a2","unresolved":false,"context_lines":[{"line_number":820,"context_line":"        else:"},{"line_number":821,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":822,"context_line":"            # delete something which doesn\"t actually exist."},{"line_number":823,"context_line":"            if resp.status_code !\u003d 404:"},{"line_number":824,"context_line":"                LOG.warning("},{"line_number":825,"context_line":"                    _LW(\"Unable to delete resource provider \""},{"line_number":826,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a430d35_df0ecbe4","line":823,"in_reply_to":"1a430d35_d4af927b","updated":"2017-02-03 01:01:27.000000000","message":"The response will have a status_code regardless, this is just checking to see if it\u0027s 404 specifically. There is a similar pattern for this elsewhere in this class.","commit_id":"99e9ba9537f89ddabcbd26d0061d275d88963bcf"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1e9983d291bc8ab7fa5c5de39c31f8bfac2c3e8","unresolved":false,"context_lines":[{"line_number":748,"context_line":"        \"\"\"Deletes the ResourceProvider record for the compute_node."},{"line_number":749,"context_line":""},{"line_number":750,"context_line":"        :param context: The security context"},{"line_number":751,"context_line":"        :param compute_node: The objects.compute_node object that is the"},{"line_number":752,"context_line":"                             resource provider being deleted."},{"line_number":753,"context_line":"        :param cascade: Boolean value that, when True, will first delete any"},{"line_number":754,"context_line":"                        associated Allocation and Inventory records for the"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_40c11c80","line":751,"range":{"start_line":751,"start_character":33,"end_line":751,"end_character":53},"updated":"2017-02-03 03:10:12.000000000","message":"nit: nova.objects.ComputeNode","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":748,"context_line":"        \"\"\"Deletes the ResourceProvider record for the compute_node."},{"line_number":749,"context_line":""},{"line_number":750,"context_line":"        :param context: The security context"},{"line_number":751,"context_line":"        :param compute_node: The objects.compute_node object that is the"},{"line_number":752,"context_line":"                             resource provider being deleted."},{"line_number":753,"context_line":"        :param cascade: Boolean value that, when True, will first delete any"},{"line_number":754,"context_line":"                        associated Allocation and Inventory records for the"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_46b92ae9","line":751,"in_reply_to":"1a430d35_40c11c80","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"13becff9fac102355790be6f925bde45f6f70afc","unresolved":false,"context_lines":[{"line_number":754,"context_line":"                        associated Allocation and Inventory records for the"},{"line_number":755,"context_line":"                        compute node"},{"line_number":756,"context_line":""},{"line_number":757,"context_line":"        :raises ResourceProviderInUse if cascade is False and the"},{"line_number":758,"context_line":"                ResourceProvider for the compute_node has any associated"},{"line_number":759,"context_line":"                allocations."},{"line_number":760,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_40791c2f","line":757,"range":{"start_line":757,"start_character":16,"end_line":757,"end_character":37},"updated":"2017-02-03 03:12:53.000000000","message":"This isn\u0027t actually true..._delete_allocation_for_instance will log something but not raise an error. And you don\u0027t raise anything in here if you get a 409.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":754,"context_line":"                        associated Allocation and Inventory records for the"},{"line_number":755,"context_line":"                        compute node"},{"line_number":756,"context_line":""},{"line_number":757,"context_line":"        :raises ResourceProviderInUse if cascade is False and the"},{"line_number":758,"context_line":"                ResourceProvider for the compute_node has any associated"},{"line_number":759,"context_line":"                allocations."},{"line_number":760,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_c6735a4c","line":757,"in_reply_to":"1a430d35_40791c2f","updated":"2017-02-03 11:16:17.000000000","message":"I\u0027ll just remove this for now. I guess logging is really all we can do in this case. It\u0027s not like we can die or something.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9572dbcf411eb55bd3bf76db87e83e84e6a5366d","unresolved":false,"context_lines":[{"line_number":754,"context_line":"                        associated Allocation and Inventory records for the"},{"line_number":755,"context_line":"                        compute node"},{"line_number":756,"context_line":""},{"line_number":757,"context_line":"        :raises ResourceProviderInUse if cascade is False and the"},{"line_number":758,"context_line":"                ResourceProvider for the compute_node has any associated"},{"line_number":759,"context_line":"                allocations."},{"line_number":760,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_66870110","line":757,"in_reply_to":"1a430d35_c6735a4c","updated":"2017-02-03 13:27:17.000000000","message":"Actually we should die, see comment on latest patch set.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1e9983d291bc8ab7fa5c5de39c31f8bfac2c3e8","unresolved":false,"context_lines":[{"line_number":772,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"},{"line_number":773,"context_line":"        resp \u003d self.delete(url)"},{"line_number":774,"context_line":"        if resp:"},{"line_number":775,"context_line":"            LOG.info(_LI(\"Deleted resource provider  %s\"), rp_uuid)"},{"line_number":776,"context_line":"        else:"},{"line_number":777,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":778,"context_line":"            # delete something which doesn\"t actually exist."}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_a02ba032","line":775,"range":{"start_line":775,"start_character":51,"end_line":775,"end_character":53},"updated":"2017-02-03 03:10:12.000000000","message":"one too many spaces","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":772,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"},{"line_number":773,"context_line":"        resp \u003d self.delete(url)"},{"line_number":774,"context_line":"        if resp:"},{"line_number":775,"context_line":"            LOG.info(_LI(\"Deleted resource provider  %s\"), rp_uuid)"},{"line_number":776,"context_line":"        else:"},{"line_number":777,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":778,"context_line":"            # delete something which doesn\"t actually exist."}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_86a07292","line":775,"in_reply_to":"1a430d35_a02ba032","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"776811a20e0ae05e46b2b5d1cae709d54b8393a4","unresolved":false,"context_lines":[{"line_number":776,"context_line":"        else:"},{"line_number":777,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":778,"context_line":"            # delete something which doesn\"t actually exist."},{"line_number":779,"context_line":"            if resp.status_code !\u003d 404:"},{"line_number":780,"context_line":"                LOG.warning("},{"line_number":781,"context_line":"                    _LW(\"Unable to delete resource provider \""},{"line_number":782,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_26441e73","line":779,"updated":"2017-02-03 11:20:56.000000000","message":"Feels we should log something for other status codes too. 409 certainly possible if the delete_allocation failed for some network blip, etc.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"2d842d1b44eeb3fe9ac0091a394c1a9532782979","unresolved":false,"context_lines":[{"line_number":776,"context_line":"        else:"},{"line_number":777,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":778,"context_line":"            # delete something which doesn\"t actually exist."},{"line_number":779,"context_line":"            if resp.status_code !\u003d 404:"},{"line_number":780,"context_line":"                LOG.warning("},{"line_number":781,"context_line":"                    _LW(\"Unable to delete resource provider \""},{"line_number":782,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_d1feb204","line":779,"in_reply_to":"1a430d35_26441e73","updated":"2017-02-03 11:24:34.000000000","message":"this is log for any failure that is _not_ a 404. We skip 404 because that just means the resource provider is already gone so job done.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":778,"context_line":"            # delete something which doesn\"t actually exist."},{"line_number":779,"context_line":"            if resp.status_code !\u003d 404:"},{"line_number":780,"context_line":"                LOG.warning("},{"line_number":781,"context_line":"                    _LW(\"Unable to delete resource provider \""},{"line_number":782,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"},{"line_number":783,"context_line":"                    {\"uuid\": rp_uuid,"},{"line_number":784,"context_line":"                     \"code\": resp.status_code,"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_a6dbae1a","line":781,"updated":"2017-02-03 11:16:17.000000000","message":"If Ia8ee36ab0e79dfc2a178f2d354288b13d48bccdb lands, then it would be handy to have the request id in here.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7df82a868cf70b6f2f73b11109d2ac1fe1510725","unresolved":false,"context_lines":[{"line_number":768,"context_line":"            # Delete any allocations for this resource provider."},{"line_number":769,"context_line":"            # Since allocations are by consumer, we get the consumers on this"},{"line_number":770,"context_line":"            # host, which are its instances."},{"line_number":771,"context_line":"            instances \u003d objects.InstanceList.get_by_host_and_node(context,"},{"line_number":772,"context_line":"                    host, nodename)"},{"line_number":773,"context_line":"            for instance in instances:"},{"line_number":774,"context_line":"                self._delete_allocation_for_instance(instance.uuid)"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a430d35_e60051ad","line":771,"range":{"start_line":771,"start_character":45,"end_line":771,"end_character":65},"updated":"2017-02-03 13:25:10.000000000","message":"On this, can\u0027t we list allocations by resource provider from the placement API? Or would that be deleting all things from this host, including all nodes on this host, and we just want the one host/node combo?","commit_id":"eb45dfa13b23f2905bfa5878e9aca8696cc6293d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"7df82a868cf70b6f2f73b11109d2ac1fe1510725","unresolved":false,"context_lines":[{"line_number":779,"context_line":"        else:"},{"line_number":780,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":781,"context_line":"            # delete something which doesn\"t actually exist."},{"line_number":782,"context_line":"            if resp.status_code !\u003d 404:"},{"line_number":783,"context_line":"                LOG.warning("},{"line_number":784,"context_line":"                    _LW(\"Unable to delete resource provider \""},{"line_number":785,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a430d35_86e78d11","line":782,"updated":"2017-02-03 13:25:10.000000000","message":"So on the previous patch about raising an error for a conflict, wouldn\u0027t we want to do that in the case of a 409? The thing is, if we don\u0027t fail and raise an exception, the Ironic build in the compute manager (from this bug) is going to keep going, but what we really need is a reschedule, which is what happens today without this fix.","commit_id":"eb45dfa13b23f2905bfa5878e9aca8696cc6293d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ce821f8c798aaf2dc78ebde83dbf087ded44f12a","unresolved":false,"context_lines":[{"line_number":779,"context_line":"        else:"},{"line_number":780,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":781,"context_line":"            # delete something which doesn\"t actually exist."},{"line_number":782,"context_line":"            if resp.status_code !\u003d 404:"},{"line_number":783,"context_line":"                LOG.warning("},{"line_number":784,"context_line":"                    _LW(\"Unable to delete resource provider \""},{"line_number":785,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"}],"source_content_type":"text/x-python","patch_set":6,"id":"1a430d35_860ced43","line":782,"in_reply_to":"1a430d35_86e78d11","updated":"2017-02-03 13:42:22.000000000","message":"Sorry I forgot this was in a periodic task so raising an exception doesn\u0027t do anything.","commit_id":"eb45dfa13b23f2905bfa5878e9aca8696cc6293d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ee492a996972dd907ee2ebce9f0f114dbabd1b5d","unresolved":false,"context_lines":[{"line_number":755,"context_line":"        \"\"\"Deletes the ResourceProvider record for the compute_node."},{"line_number":756,"context_line":""},{"line_number":757,"context_line":"        :param context: The security context"},{"line_number":758,"context_line":"        :param compute_node: The nova.objects.compute_node object that is the"},{"line_number":759,"context_line":"                             resource provider being deleted."},{"line_number":760,"context_line":"        :param cascade: Boolean value that, when True, will first delete any"},{"line_number":761,"context_line":"                        associated Allocation and Inventory records for the"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_bc3496de","line":758,"range":{"start_line":758,"start_character":46,"end_line":758,"end_character":58},"updated":"2017-02-03 14:08:21.000000000","message":"nit: ComputeNode","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"05a2344a132f5c5a8b1626f5f3ddde6ba8ce202a","unresolved":false,"context_lines":[{"line_number":769,"context_line":"            # Since allocations are by consumer, we get the consumers on this"},{"line_number":770,"context_line":"            # host, which are its instances."},{"line_number":771,"context_line":"            instances \u003d objects.InstanceList.get_by_host_and_node(context,"},{"line_number":772,"context_line":"                    host, nodename)"},{"line_number":773,"context_line":"            for instance in instances:"},{"line_number":774,"context_line":"                self._delete_allocation_for_instance(instance.uuid)"},{"line_number":775,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_dc69628d","line":772,"updated":"2017-02-03 14:19:35.000000000","message":"are we sure we also delete the allocation when the instance is soft-deleted ?\n\nAlso what happens to instances when a compute node is deleted ? Are we keeping those ?","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"2c01023828bbaef9453122c50e2ea15c03b77523","unresolved":false,"context_lines":[{"line_number":769,"context_line":"            # Since allocations are by consumer, we get the consumers on this"},{"line_number":770,"context_line":"            # host, which are its instances."},{"line_number":771,"context_line":"            instances \u003d objects.InstanceList.get_by_host_and_node(context,"},{"line_number":772,"context_line":"                    host, nodename)"},{"line_number":773,"context_line":"            for instance in instances:"},{"line_number":774,"context_line":"                self._delete_allocation_for_instance(instance.uuid)"},{"line_number":775,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_3c126663","line":772,"in_reply_to":"1a430d35_3c8346ce","updated":"2017-02-03 14:31:17.000000000","message":"I\u0027m fine with allocations being deleted when an instance is deleted, thanks for the pointer.\n\nThat said, I still have one question before I +W. What happens to instances when we delete a compute node record ? Are we still leaving the instances like they are ? are we soft-deleting them ? If the latter, it could be racy here because we would lookup the list of instances and not find them if they are already deleted.\n\nThat said, the crux is, if we soft-delete an instance when the compute is deleted, then we should go thru the path where we also delete the allocation records, so we should still be good from a Placement PoV.\n\nBut all of that is a bit silent, so I\u0027d prefer to know the answer without guessing about any possible impact.","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f2e7c028f3c5824b9d9cffde910fb836b8352981","unresolved":false,"context_lines":[{"line_number":769,"context_line":"            # Since allocations are by consumer, we get the consumers on this"},{"line_number":770,"context_line":"            # host, which are its instances."},{"line_number":771,"context_line":"            instances \u003d objects.InstanceList.get_by_host_and_node(context,"},{"line_number":772,"context_line":"                    host, nodename)"},{"line_number":773,"context_line":"            for instance in instances:"},{"line_number":774,"context_line":"                self._delete_allocation_for_instance(instance.uuid)"},{"line_number":775,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_3c8346ce","line":772,"in_reply_to":"1a430d35_dc69628d","updated":"2017-02-03 14:25:33.000000000","message":"I don\u0027t understand these questions so will leave answers to someone else.","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8c0ad3b82e538ec6c25295daee611525bc41fa74","unresolved":false,"context_lines":[{"line_number":769,"context_line":"            # Since allocations are by consumer, we get the consumers on this"},{"line_number":770,"context_line":"            # host, which are its instances."},{"line_number":771,"context_line":"            instances \u003d objects.InstanceList.get_by_host_and_node(context,"},{"line_number":772,"context_line":"                    host, nodename)"},{"line_number":773,"context_line":"            for instance in instances:"},{"line_number":774,"context_line":"                self._delete_allocation_for_instance(instance.uuid)"},{"line_number":775,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_1c304a56","line":772,"in_reply_to":"1a430d35_dc69628d","updated":"2017-02-03 14:23:46.000000000","message":"See remove_deleted_instances above, the RT takes care of those.","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"05a2344a132f5c5a8b1626f5f3ddde6ba8ce202a","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"},{"line_number":776,"context_line":"        resp \u003d self.delete(url)"},{"line_number":777,"context_line":"        if resp:"},{"line_number":778,"context_line":"            LOG.info(_LI(\"Deleted resource provider %s\"), rp_uuid)"},{"line_number":779,"context_line":"        else:"},{"line_number":780,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":781,"context_line":"            # delete something which doesn\"t actually exist."}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_9c1d1a12","line":778,"updated":"2017-02-03 14:19:35.000000000","message":"I guess inventories are deleted when the RP is deleted, right?","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"8c0ad3b82e538ec6c25295daee611525bc41fa74","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"},{"line_number":776,"context_line":"        resp \u003d self.delete(url)"},{"line_number":777,"context_line":"        if resp:"},{"line_number":778,"context_line":"            LOG.info(_LI(\"Deleted resource provider %s\"), rp_uuid)"},{"line_number":779,"context_line":"        else:"},{"line_number":780,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":781,"context_line":"            # delete something which doesn\"t actually exist."}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_3c350646","line":778,"in_reply_to":"1a430d35_9c1d1a12","updated":"2017-02-03 14:23:46.000000000","message":"Yeah.","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f2e7c028f3c5824b9d9cffde910fb836b8352981","unresolved":false,"context_lines":[{"line_number":775,"context_line":"        url \u003d \"/resource_providers/%s\" % rp_uuid"},{"line_number":776,"context_line":"        resp \u003d self.delete(url)"},{"line_number":777,"context_line":"        if resp:"},{"line_number":778,"context_line":"            LOG.info(_LI(\"Deleted resource provider %s\"), rp_uuid)"},{"line_number":779,"context_line":"        else:"},{"line_number":780,"context_line":"            # Check for 404 since we don\u0027t need to log a warning if we tried to"},{"line_number":781,"context_line":"            # delete something which doesn\"t actually exist."}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_dc46c2be","line":778,"in_reply_to":"1a430d35_9c1d1a12","updated":"2017-02-03 14:25:33.000000000","message":"Yes, there\u0027s discussion on that in earlier patchsets but the gist is that if there are no allocations (done above), then a delete of an rp will delete inventory and aggregate associations too.","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"05a2344a132f5c5a8b1626f5f3ddde6ba8ce202a","unresolved":false,"context_lines":[{"line_number":785,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"},{"line_number":786,"context_line":"                    {\"uuid\": rp_uuid,"},{"line_number":787,"context_line":"                     \"code\": resp.status_code,"},{"line_number":788,"context_line":"                     \"text\": resp.text})"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_bcc81676","line":788,"updated":"2017-02-03 14:19:35.000000000","message":"also, given all the questions I have above, it would be good to have a functional test verifying them.","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f2e7c028f3c5824b9d9cffde910fb836b8352981","unresolved":false,"context_lines":[{"line_number":785,"context_line":"                        \"%(uuid)s: (%(code)i %(text)s)\"),"},{"line_number":786,"context_line":"                    {\"uuid\": rp_uuid,"},{"line_number":787,"context_line":"                     \"code\": resp.status_code,"},{"line_number":788,"context_line":"                     \"text\": resp.text})"}],"source_content_type":"text/x-python","patch_set":8,"id":"1a430d35_9c6a7a19","line":788,"in_reply_to":"1a430d35_bcc81676","updated":"2017-02-03 14:25:33.000000000","message":"Yes, I think we all agree that more testing would be good, but we\u0027re rushing this one. There\u0027s plans to do a more complete solution later which presumably would include more robust testing.","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"2010b4d6510a285c771dbf9ef6d16550d08fc612","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        # A dict, keyed by the resource provider UUID, of ResourceProvider"},{"line_number":186,"context_line":"        # objects that will have their inventories and allocations tracked by"},{"line_number":187,"context_line":"        # the placement API for the compute host"},{"line_number":188,"context_line":"        self._resource_providers \u003d {}"},{"line_number":189,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":190,"context_line":"        # the provider is associated with"},{"line_number":191,"context_line":"        self._provider_aggregate_map \u003d {}"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a430d35_2de85610","line":188,"updated":"2017-02-04 13:54:26.000000000","message":"I forgot to point out that we need to cleanup the value from this when we delete a resource provider.","commit_id":"965fffc09d6fffba7918117e170d5799c69fe99b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"91bbc6d7d7476706e29aa7b8510e7129cee4fa68","unresolved":false,"context_lines":[{"line_number":188,"context_line":"        self._resource_providers \u003d {}"},{"line_number":189,"context_line":"        # A dict, keyed by resource provider UUID, of sets of aggregate UUIDs"},{"line_number":190,"context_line":"        # the provider is associated with"},{"line_number":191,"context_line":"        self._provider_aggregate_map \u003d {}"},{"line_number":192,"context_line":"        auth_plugin \u003d keystone.load_auth_from_conf_options("},{"line_number":193,"context_line":"            CONF, \u0027placement\u0027)"},{"line_number":194,"context_line":"        self._client \u003d session.Session(auth\u003dauth_plugin)"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a430d35_cdcfd2ae","line":191,"updated":"2017-02-04 13:55:20.000000000","message":"And this I suppose.","commit_id":"965fffc09d6fffba7918117e170d5799c69fe99b"}],"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":"a1e9983d291bc8ab7fa5c5de39c31f8bfac2c3e8","unresolved":false,"context_lines":[{"line_number":1302,"context_line":"        # make sure warning wasn\u0027t called for the 404"},{"line_number":1303,"context_line":"        mock_log.warning.assert_not_called()"},{"line_number":1304,"context_line":""},{"line_number":1305,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.put\u0027)"},{"line_number":1306,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.LOG\u0027)"},{"line_number":1307,"context_line":"    def test_put_allocations(self, mock_log, mock_put):"},{"line_number":1308,"context_line":"        rp_uuid \u003d uuids.resource_provider"},{"line_number":1309,"context_line":"        cons_uuid \u003d uuids.consumer"},{"line_number":1310,"context_line":"        alloc_data \u003d {\"fake_resource\": 99}"},{"line_number":1311,"context_line":"        mock_response \u003d mock.MagicMock(status_code\u003d204)"},{"line_number":1312,"context_line":"        mock_put.return_value \u003d mock_response"},{"line_number":1313,"context_line":"        ret \u003d self.client._put_allocations(rp_uuid, cons_uuid, alloc_data)"},{"line_number":1314,"context_line":"        expected_url \u003d \"/allocations/%s\" % cons_uuid"},{"line_number":1315,"context_line":"        expected_payload \u003d {"},{"line_number":1316,"context_line":"                \"allocations\": [{\"resource_provider\": {\"uuid\": rp_uuid},"},{"line_number":1317,"context_line":"                \"resources\": alloc_data}]}"},{"line_number":1318,"context_line":"        mock_put.assert_called_once_with(expected_url, expected_payload)"},{"line_number":1319,"context_line":"        # Since we got back the expected 204, the LOG.warning should not have"},{"line_number":1320,"context_line":"        # been called."},{"line_number":1321,"context_line":"        mock_log.warning.assert_not_called()"},{"line_number":1322,"context_line":"        self.assertTrue(ret)"},{"line_number":1323,"context_line":""},{"line_number":1324,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.SchedulerReportClient.put\u0027)"},{"line_number":1325,"context_line":"    @mock.patch(\u0027nova.scheduler.client.report.LOG\u0027)"},{"line_number":1326,"context_line":"    def test_put_allocations_error(self, mock_log, mock_put):"},{"line_number":1327,"context_line":"        rp_uuid \u003d uuids.resource_provider"},{"line_number":1328,"context_line":"        cons_uuid \u003d uuids.consumer"},{"line_number":1329,"context_line":"        alloc_data \u003d {\"fake_resource\": 99}"},{"line_number":1330,"context_line":"        mock_response \u003d mock.MagicMock(status_code\u003d404)"},{"line_number":1331,"context_line":"        mock_put.side_effect \u003d mock_response"},{"line_number":1332,"context_line":"        ret \u003d self.client._put_allocations(rp_uuid, cons_uuid, alloc_data)"},{"line_number":1333,"context_line":"        expected_url \u003d \"/allocations/%s\" % cons_uuid"},{"line_number":1334,"context_line":"        expected_payload \u003d {"},{"line_number":1335,"context_line":"                \"allocations\": [{\"resource_provider\": {\"uuid\": rp_uuid},"},{"line_number":1336,"context_line":"                \"resources\": alloc_data}]}"},{"line_number":1337,"context_line":"        mock_put.assert_called_once_with(expected_url, expected_payload)"},{"line_number":1338,"context_line":"        # Since we got back a 404, the LOG.warning should have been called."},{"line_number":1339,"context_line":"        mock_log.warning.assert_called_once()"},{"line_number":1340,"context_line":"        self.assertFalse(ret)"},{"line_number":1341,"context_line":""},{"line_number":1342,"context_line":"    @mock.patch(\"nova.scheduler.client.report.SchedulerReportClient.\""},{"line_number":1343,"context_line":"                \"delete\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_601a9819","line":1340,"range":{"start_line":1305,"start_character":4,"end_line":1340,"end_character":29},"updated":"2017-02-03 03:10:12.000000000","message":"These shouldn\u0027t be in here, bad rebase.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":1337,"context_line":"        mock_put.assert_called_once_with(expected_url, expected_payload)"},{"line_number":1338,"context_line":"        # Since we got back a 404, the LOG.warning should have been called."},{"line_number":1339,"context_line":"        mock_log.warning.assert_called_once()"},{"line_number":1340,"context_line":"        self.assertFalse(ret)"},{"line_number":1341,"context_line":""},{"line_number":1342,"context_line":"    @mock.patch(\"nova.scheduler.client.report.SchedulerReportClient.\""},{"line_number":1343,"context_line":"                \"delete\")"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_06300256","line":1340,"in_reply_to":"1a430d35_601a9819","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1e9983d291bc8ab7fa5c5de39c31f8bfac2c3e8","unresolved":false,"context_lines":[{"line_number":1374,"context_line":"                objects\u003d[inst1, inst2])"},{"line_number":1375,"context_line":"        resp_mock \u003d mock.Mock(status_code\u003d204)"},{"line_number":1376,"context_line":"        mock_delete.return_value \u003d resp_mock"},{"line_number":1377,"context_line":"        self.client.delete_resource_provider(self.context, cn, cascade\u003dFalse)"},{"line_number":1378,"context_line":"        mock_del_alloc.assert_not_called()"},{"line_number":1379,"context_line":"        exp_url \u003d \"/resource_providers/%s\" % uuids.cn"},{"line_number":1380,"context_line":"        mock_delete.assert_called_once_with(exp_url)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_60c8d875","line":1377,"range":{"start_line":1377,"start_character":63,"end_line":1377,"end_character":76},"updated":"2017-02-03 03:10:12.000000000","message":"nit: since this is the default you could just omit this.","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":1374,"context_line":"                objects\u003d[inst1, inst2])"},{"line_number":1375,"context_line":"        resp_mock \u003d mock.Mock(status_code\u003d204)"},{"line_number":1376,"context_line":"        mock_delete.return_value \u003d resp_mock"},{"line_number":1377,"context_line":"        self.client.delete_resource_provider(self.context, cn, cascade\u003dFalse)"},{"line_number":1378,"context_line":"        mock_del_alloc.assert_not_called()"},{"line_number":1379,"context_line":"        exp_url \u003d \"/resource_providers/%s\" % uuids.cn"},{"line_number":1380,"context_line":"        mock_delete.assert_called_once_with(exp_url)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_260c1e94","line":1377,"in_reply_to":"1a430d35_60c8d875","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1e9983d291bc8ab7fa5c5de39c31f8bfac2c3e8","unresolved":false,"context_lines":[{"line_number":1393,"context_line":"            # py3 uses __bool__"},{"line_number":1394,"context_line":"            resp_mock.__bool__.return_value \u003d True"},{"line_number":1395,"context_line":"        mock_delete.return_value \u003d resp_mock"},{"line_number":1396,"context_line":"        self.client.delete_resource_provider(self.context, cn, cascade\u003dFalse)"},{"line_number":1397,"context_line":"        # With a 204, only the info should be called"},{"line_number":1398,"context_line":"        self.assertEqual(1, mock_log.info.call_count)"},{"line_number":1399,"context_line":"        self.assertEqual(0, mock_log.warning.call_count)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_a0a000a7","line":1396,"range":{"start_line":1396,"start_character":63,"end_line":1396,"end_character":76},"updated":"2017-02-03 03:10:12.000000000","message":"ditto","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":1393,"context_line":"            # py3 uses __bool__"},{"line_number":1394,"context_line":"            resp_mock.__bool__.return_value \u003d True"},{"line_number":1395,"context_line":"        mock_delete.return_value \u003d resp_mock"},{"line_number":1396,"context_line":"        self.client.delete_resource_provider(self.context, cn, cascade\u003dFalse)"},{"line_number":1397,"context_line":"        # With a 204, only the info should be called"},{"line_number":1398,"context_line":"        self.assertEqual(1, mock_log.info.call_count)"},{"line_number":1399,"context_line":"        self.assertEqual(0, mock_log.warning.call_count)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_46112aac","line":1396,"in_reply_to":"1a430d35_a0a000a7","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1e9983d291bc8ab7fa5c5de39c31f8bfac2c3e8","unresolved":false,"context_lines":[{"line_number":1406,"context_line":"        except AttributeError:"},{"line_number":1407,"context_line":"            # py3 uses __bool__"},{"line_number":1408,"context_line":"            resp_mock.__bool__.return_value \u003d False"},{"line_number":1409,"context_line":"        self.client.delete_resource_provider(self.context, cn, cascade\u003dFalse)"},{"line_number":1410,"context_line":"        # With a 404, neither log message should be called"},{"line_number":1411,"context_line":"        self.assertEqual(0, mock_log.info.call_count)"},{"line_number":1412,"context_line":"        self.assertEqual(0, mock_log.warning.call_count)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_c0a50cb6","line":1409,"range":{"start_line":1409,"start_character":63,"end_line":1409,"end_character":76},"updated":"2017-02-03 03:10:12.000000000","message":"ditto","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":1406,"context_line":"        except AttributeError:"},{"line_number":1407,"context_line":"            # py3 uses __bool__"},{"line_number":1408,"context_line":"            resp_mock.__bool__.return_value \u003d False"},{"line_number":1409,"context_line":"        self.client.delete_resource_provider(self.context, cn, cascade\u003dFalse)"},{"line_number":1410,"context_line":"        # With a 404, neither log message should be called"},{"line_number":1411,"context_line":"        self.assertEqual(0, mock_log.info.call_count)"},{"line_number":1412,"context_line":"        self.assertEqual(0, mock_log.warning.call_count)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_86231205","line":1409,"in_reply_to":"1a430d35_c0a50cb6","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"a1e9983d291bc8ab7fa5c5de39c31f8bfac2c3e8","unresolved":false,"context_lines":[{"line_number":1414,"context_line":"        # Finally, check a 409 response"},{"line_number":1415,"context_line":"        mock_log.reset_mock()"},{"line_number":1416,"context_line":"        resp_mock.status_code \u003d 409"},{"line_number":1417,"context_line":"        self.client.delete_resource_provider(self.context, cn, cascade\u003dFalse)"},{"line_number":1418,"context_line":"        # With a 409, only the warning should be called"},{"line_number":1419,"context_line":"        self.assertEqual(0, mock_log.info.call_count)"},{"line_number":1420,"context_line":"        self.assertEqual(1, mock_log.warning.call_count)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_00b0f4f3","line":1417,"range":{"start_line":1417,"start_character":63,"end_line":1417,"end_character":76},"updated":"2017-02-03 03:10:12.000000000","message":"ditto","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"865d792daf28be84a3c9d63f70fff3a72c686435","unresolved":false,"context_lines":[{"line_number":1414,"context_line":"        # Finally, check a 409 response"},{"line_number":1415,"context_line":"        mock_log.reset_mock()"},{"line_number":1416,"context_line":"        resp_mock.status_code \u003d 409"},{"line_number":1417,"context_line":"        self.client.delete_resource_provider(self.context, cn, cascade\u003dFalse)"},{"line_number":1418,"context_line":"        # With a 409, only the warning should be called"},{"line_number":1419,"context_line":"        self.assertEqual(0, mock_log.info.call_count)"},{"line_number":1420,"context_line":"        self.assertEqual(1, mock_log.warning.call_count)"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a430d35_c61d1abf","line":1417,"in_reply_to":"1a430d35_00b0f4f3","updated":"2017-02-03 11:16:17.000000000","message":"Done","commit_id":"f1d3391b8a3c1338c9b35a772b1a3fb3246df8cb"}],"releasenotes/notes/bug-1661258-ee202843157f6a27.yaml":[{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"05a2344a132f5c5a8b1626f5f3ddde6ba8ce202a","unresolved":false,"context_lines":[{"line_number":6,"context_line":"      decisions, leading to a reschedule. If this happens, the orphaned"},{"line_number":7,"context_line":"      resource providers will need to be identified and removed."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"      See also https://bugs.launchpad.net/nova/+bug/1661258"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"1a430d35_bcf1f6cf","line":9,"range":{"start_line":9,"start_character":6,"end_line":9,"end_character":59},"updated":"2017-02-03 14:19:35.000000000","message":"not sure we need to comment that way, but meh it\u0027s a nit.","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"f2e7c028f3c5824b9d9cffde910fb836b8352981","unresolved":false,"context_lines":[{"line_number":6,"context_line":"      decisions, leading to a reschedule. If this happens, the orphaned"},{"line_number":7,"context_line":"      resource providers will need to be identified and removed."},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"      See also https://bugs.launchpad.net/nova/+bug/1661258"}],"source_content_type":"text/x-yaml","patch_set":8,"id":"1a430d35_1c092a96","line":9,"in_reply_to":"1a430d35_bcf1f6cf","updated":"2017-02-03 14:25:33.000000000","message":"We etherpadded over this and decided that providing some additional info was good.","commit_id":"e7f23e2cd21e2e9ea39a871fd65dd86e400891d8"}]}
