)]}'
{"nova/compute/resource_tracker.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f326a3f7c8c14289920d4823e69f1cd765d8a606","unresolved":false,"context_lines":[{"line_number":813,"context_line":"            # Retrieve the provider tree associated with this compute node.  If"},{"line_number":814,"context_line":"            # it doesn\u0027t exist yet, this will create it with a (single, root)"},{"line_number":815,"context_line":"            # provider corresponding to the compute node."},{"line_number":816,"context_line":"            prov_tree \u003d self.reportclient.get_provider_tree("},{"line_number":817,"context_line":"                compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":818,"context_line":"            # Let the virt driver rearrange the provider tree and set/update"},{"line_number":819,"context_line":"            # the inventory throughout."}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_eae4160f","line":816,"range":{"start_line":816,"start_character":42,"end_line":816,"end_character":59},"updated":"2017-11-16 17:42:57.000000000","message":"Of some ugliness: This guy needs to retrieve from placement every time, since we can\u0027t tell by looking at any one incarnation of the tree whether additional nodes have been added since we last retrieved it.","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ddc225dd4df8674a1b5dfd3d047485fd98344c3a","unresolved":false,"context_lines":[{"line_number":818,"context_line":"            # Let the virt driver rearrange the provider tree and set/update"},{"line_number":819,"context_line":"            # the inventory throughout."},{"line_number":820,"context_line":"            updated \u003d self.driver.update_inventory(nodename, prov_tree)"},{"line_number":821,"context_line":"            if updated:"},{"line_number":822,"context_line":"                # Now we have to walk the tree and normalize the inventory from"},{"line_number":823,"context_line":"                # each provider therein - the driver-rearranged tree could"},{"line_number":824,"context_line":"                # provide standard resources from providers other than the root"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_b41565e7","line":821,"updated":"2017-11-16 16:23:57.000000000","message":"Le crap, how do I detect and flush deleted providers?","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6d5d910da9d93d24c103f70330a9466c27a70736","unresolved":false,"context_lines":[{"line_number":818,"context_line":"            # Let the virt driver rearrange the provider tree and set/update"},{"line_number":819,"context_line":"            # the inventory throughout."},{"line_number":820,"context_line":"            updated \u003d self.driver.update_inventory(nodename, prov_tree)"},{"line_number":821,"context_line":"            if updated:"},{"line_number":822,"context_line":"                # Now we have to walk the tree and normalize the inventory from"},{"line_number":823,"context_line":"                # each provider therein - the driver-rearranged tree could"},{"line_number":824,"context_line":"                # provide standard resources from providers other than the root"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_89724fac","line":821,"in_reply_to":"1f485f77_b41565e7","updated":"2017-11-16 19:07:02.000000000","message":"You wouldn\u0027t. :) The ProviderTree would be updated by the virt driver (or GDM, eventually) and return whether any changes were made to the ProviderTree. (more below)","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f36319e37149a4fa8e4a542667bdb05ce8634ab5","unresolved":false,"context_lines":[{"line_number":827,"context_line":"                                                     compute_node)"},{"line_number":828,"context_line":"                    # And flush the changes back to the placement API"},{"line_number":829,"context_line":"                    self.scheduler_client.set_inventory_for_provider("},{"line_number":830,"context_line":"                        provider.uuid, provider.name, provider.inventory)"},{"line_number":831,"context_line":"        except NotImplementedError:"},{"line_number":832,"context_line":"            # Okay, update_inventory isn\u0027t implemented yet - try get_inventory"},{"line_number":833,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_80deab0e","line":830,"updated":"2017-11-16 14:33:26.000000000","message":"Need to pass the parent UUID in here - needed for when set_inventory_for_provider is creating the provider.","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"6d5d910da9d93d24c103f70330a9466c27a70736","unresolved":false,"context_lines":[{"line_number":819,"context_line":"            # the inventory throughout."},{"line_number":820,"context_line":"            updated \u003d self.driver.update_inventory(nodename, prov_tree)"},{"line_number":821,"context_line":"            if updated:"},{"line_number":822,"context_line":"                # Now we have to walk the tree and normalize the inventory from"},{"line_number":823,"context_line":"                # each provider therein - the driver-rearranged tree could"},{"line_number":824,"context_line":"                # provide standard resources from providers other than the root"},{"line_number":825,"context_line":"                for provider in prov_tree:"},{"line_number":826,"context_line":"                    _normalize_inventory_from_cn_obj(provider.inventory,"},{"line_number":827,"context_line":"                                                     compute_node)"},{"line_number":828,"context_line":"                    # And flush the changes back to the placement API"},{"line_number":829,"context_line":"                    self.scheduler_client.set_inventory_for_provider("},{"line_number":830,"context_line":"                        provider.uuid, provider.name, provider.inventory)"},{"line_number":831,"context_line":"        except NotImplementedError:"},{"line_number":832,"context_line":"            # Okay, update_inventory isn\u0027t implemented yet - try get_inventory"},{"line_number":833,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_c98a8768","line":830,"range":{"start_line":822,"start_character":0,"end_line":830,"end_character":73},"updated":"2017-11-16 19:07:02.000000000","message":"OK, I see where you\u0027re going with this. However, I think it\u0027s a cleaner interface if we hide any tree traversal logic behind the scheduler reportclient class interface. The reportclient should be responsible for ensuring that the placement API is called to update any inventory (and soon, traits) information for providers in the ProviderTree.\n\nSo, here, I\u0027d recommend just doing:\n\n if updated:\n     self.reportclient.update_provider_tree(prov_tree)\n\nand hiding the traversal and details behind that.\n\nWithin the reportclient\u0027s update_provider_tree() method, you may want to do something like:\n\n\n def update_provider_tree(self, new_tree):\n    # Check if new tree has changes from our known tree\u0027s\n    # contents\n    new_nodes \u003d new_tree.uuid_set()\n    existing_nodes \u003d self.provider_tree.uuid_set()\n    to_add \u003d new_nodes - existing_nodes\n    to_delete \u003d existing_nodes - new_nodes\n    changed \u003d set()\n    with self.provider_tree.lock():\n        for node in new_nodes:\n            if node.uuid not in existing_nodes:\n                continue\n            existing \u003d self.provider_tree.find(node.uuid)\n            if existing.has_changes(node):\n                 changed.add(node)\n\n    # Now that you have the nodes to add, nodes to remove\n    # and changed nodes, do the needful updates in the\n    # placement API...","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"1569d11f56c7ede90ed32de05baec3573496af77","unresolved":false,"context_lines":[{"line_number":819,"context_line":"            # the inventory throughout."},{"line_number":820,"context_line":"            updated \u003d self.driver.update_inventory(nodename, prov_tree)"},{"line_number":821,"context_line":"            if updated:"},{"line_number":822,"context_line":"                # Now we have to walk the tree and normalize the inventory from"},{"line_number":823,"context_line":"                # each provider therein - the driver-rearranged tree could"},{"line_number":824,"context_line":"                # provide standard resources from providers other than the root"},{"line_number":825,"context_line":"                for provider in prov_tree:"},{"line_number":826,"context_line":"                    _normalize_inventory_from_cn_obj(provider.inventory,"},{"line_number":827,"context_line":"                                                     compute_node)"},{"line_number":828,"context_line":"                    # And flush the changes back to the placement API"},{"line_number":829,"context_line":"                    self.scheduler_client.set_inventory_for_provider("},{"line_number":830,"context_line":"                        provider.uuid, provider.name, provider.inventory)"},{"line_number":831,"context_line":"        except NotImplementedError:"},{"line_number":832,"context_line":"            # Okay, update_inventory isn\u0027t implemented yet - try get_inventory"},{"line_number":833,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_549eac54","line":830,"range":{"start_line":822,"start_character":0,"end_line":830,"end_character":73},"in_reply_to":"1f485f77_270dad8f","updated":"2017-11-22 06:57:23.000000000","message":"Hi, Eric. In which patch can I find ProviderTree.all_by_uuid() ?\nDo you mean using the API above, I could traverse the whole tree to delete all the rps which are out of date?","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ac6ef1b0c292f29d861c67b67b9accff5c776b41","unresolved":false,"context_lines":[{"line_number":819,"context_line":"            # the inventory throughout."},{"line_number":820,"context_line":"            updated \u003d self.driver.update_inventory(nodename, prov_tree)"},{"line_number":821,"context_line":"            if updated:"},{"line_number":822,"context_line":"                # Now we have to walk the tree and normalize the inventory from"},{"line_number":823,"context_line":"                # each provider therein - the driver-rearranged tree could"},{"line_number":824,"context_line":"                # provide standard resources from providers other than the root"},{"line_number":825,"context_line":"                for provider in prov_tree:"},{"line_number":826,"context_line":"                    _normalize_inventory_from_cn_obj(provider.inventory,"},{"line_number":827,"context_line":"                                                     compute_node)"},{"line_number":828,"context_line":"                    # And flush the changes back to the placement API"},{"line_number":829,"context_line":"                    self.scheduler_client.set_inventory_for_provider("},{"line_number":830,"context_line":"                        provider.uuid, provider.name, provider.inventory)"},{"line_number":831,"context_line":"        except NotImplementedError:"},{"line_number":832,"context_line":"            # Okay, update_inventory isn\u0027t implemented yet - try get_inventory"},{"line_number":833,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_270dad8f","line":830,"range":{"start_line":822,"start_character":0,"end_line":830,"end_character":73},"in_reply_to":"1f485f77_29747bfd","updated":"2017-11-17 15:23:14.000000000","message":"\u003e But I still need to _normalize_inventory_from_cn_obj for each\n \u003e provider in the tree.\n\n[Later] No, I\u0027m putting a stake in the ground that consumers of update_provider_tree (TAFKA update_inventory) must handle their own allocation_ratio, reserved, etc.  They can still do so by consuming conf values - but we\u0027ll no longer do it for them.\n\n \u003e And the virt driver is going to have to have some way to walk the\n \u003e tree it\u0027s given.\n\nIf they really need to, there\u0027s now a ProviderTree.all_by_uuid() that returns a dict, from which they can traverse however they need to.  But most of the time the virt driver can probably just use exists(), find(), etc.  See for example:\n\nhttps://review.openstack.org/#/c/520313/9/nova/virt/xenapi/driver.py","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d1960ccccad2f6b66b07094b812aacaabfc5af91","unresolved":false,"context_lines":[{"line_number":819,"context_line":"            # the inventory throughout."},{"line_number":820,"context_line":"            updated \u003d self.driver.update_inventory(nodename, prov_tree)"},{"line_number":821,"context_line":"            if updated:"},{"line_number":822,"context_line":"                # Now we have to walk the tree and normalize the inventory from"},{"line_number":823,"context_line":"                # each provider therein - the driver-rearranged tree could"},{"line_number":824,"context_line":"                # provide standard resources from providers other than the root"},{"line_number":825,"context_line":"                for provider in prov_tree:"},{"line_number":826,"context_line":"                    _normalize_inventory_from_cn_obj(provider.inventory,"},{"line_number":827,"context_line":"                                                     compute_node)"},{"line_number":828,"context_line":"                    # And flush the changes back to the placement API"},{"line_number":829,"context_line":"                    self.scheduler_client.set_inventory_for_provider("},{"line_number":830,"context_line":"                        provider.uuid, provider.name, provider.inventory)"},{"line_number":831,"context_line":"        except NotImplementedError:"},{"line_number":832,"context_line":"            # Okay, update_inventory isn\u0027t implemented yet - try get_inventory"},{"line_number":833,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"1f485f77_29747bfd","line":830,"range":{"start_line":822,"start_character":0,"end_line":830,"end_character":73},"in_reply_to":"1f485f77_c98a8768","updated":"2017-11-16 19:18:10.000000000","message":"I dig it.\n\nBut I still need to _normalize_inventory_from_cn_obj for each provider in the tree.\n\nAnd the virt driver is going to have to have some way to walk the tree it\u0027s given.","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"19a435bab8493f9832ca61571dfcd53b583810b9","unresolved":false,"context_lines":[{"line_number":819,"context_line":"            # the inventory throughout."},{"line_number":820,"context_line":"            updated \u003d self.driver.update_inventory(nodename, prov_tree)"},{"line_number":821,"context_line":"            if updated:"},{"line_number":822,"context_line":"                # Now we have to walk the tree and normalize the inventory from"},{"line_number":823,"context_line":"                # each provider therein - the driver-rearranged tree could"},{"line_number":824,"context_line":"                # provide standard resources from providers other than the root"},{"line_number":825,"context_line":"                for provider in prov_tree:"},{"line_number":826,"context_line":"                    _normalize_inventory_from_cn_obj(provider.inventory,"},{"line_number":827,"context_line":"                                                     compute_node)"},{"line_number":828,"context_line":"                    # And flush the changes back to the placement API"},{"line_number":829,"context_line":"                    self.scheduler_client.set_inventory_for_provider("},{"line_number":830,"context_line":"                        provider.uuid, provider.name, provider.inventory)"},{"line_number":831,"context_line":"        except NotImplementedError:"},{"line_number":832,"context_line":"            # Okay, update_inventory isn\u0027t implemented yet - try get_inventory"},{"line_number":833,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_8ed5f545","line":830,"range":{"start_line":822,"start_character":0,"end_line":830,"end_character":73},"in_reply_to":"ff82abbf_549eac54","updated":"2017-11-22 14:22:05.000000000","message":"Yeah, that\u0027s what I meant.  It\u0027s called uuid_set() now, and it\u0027s in https://review.openstack.org/#/c/520243/","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"bd172e4bf061eff0ba84763152b0276bf9005990","unresolved":false,"context_lines":[{"line_number":819,"context_line":"            # the inventory throughout."},{"line_number":820,"context_line":"            updated \u003d self.driver.update_inventory(nodename, prov_tree)"},{"line_number":821,"context_line":"            if updated:"},{"line_number":822,"context_line":"                # Now we have to walk the tree and normalize the inventory from"},{"line_number":823,"context_line":"                # each provider therein - the driver-rearranged tree could"},{"line_number":824,"context_line":"                # provide standard resources from providers other than the root"},{"line_number":825,"context_line":"                for provider in prov_tree:"},{"line_number":826,"context_line":"                    _normalize_inventory_from_cn_obj(provider.inventory,"},{"line_number":827,"context_line":"                                                     compute_node)"},{"line_number":828,"context_line":"                    # And flush the changes back to the placement API"},{"line_number":829,"context_line":"                    self.scheduler_client.set_inventory_for_provider("},{"line_number":830,"context_line":"                        provider.uuid, provider.name, provider.inventory)"},{"line_number":831,"context_line":"        except NotImplementedError:"},{"line_number":832,"context_line":"            # Okay, update_inventory isn\u0027t implemented yet - try get_inventory"},{"line_number":833,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff82abbf_1f87c3d9","line":830,"range":{"start_line":822,"start_character":0,"end_line":830,"end_character":73},"in_reply_to":"ff82abbf_8ed5f545","updated":"2017-11-23 03:00:11.000000000","message":"Got it, thanks, Eric","commit_id":"58c4aad9db55600e6cbdbbcc7338f3baea3640ea"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"1ca3033bc445299517f1123637ca91e40b5af68a","unresolved":false,"context_lines":[{"line_number":802,"context_line":"            return True"},{"line_number":803,"context_line":"        return False"},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"    def _update(self, context, compute_node):"},{"line_number":806,"context_line":"        \"\"\"Update partial stats locally and populate them to Scheduler.\"\"\""},{"line_number":807,"context_line":"        if not self._resource_change(compute_node):"},{"line_number":808,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_7802200c","line":805,"updated":"2017-11-17 16:52:51.000000000","message":"For the sake of multi-node (ironic), we should consider making _update take the provider_tree as an optional kwarg, since it\u0027s so expensive to build.  Then e.g. in _init_compute_node, where we\u0027re calling _update() in a tight loop for each compute node, we build it once and pass the same one in every time.  The virt driver may elect to update only the one node\u0027s providers, in which case we might be flushing changes every iteration; or it could update everything at once (ignoring the nodename parameter) and the last N-1 iterations would be no-ops.  Guess it depends how expensive it is for ironic to gather the information it needs for a given compute node.\n\nNeed to get a better understanding of how _update() is invoked for ironic code paths other than _init_compute_node.","commit_id":"14c7c4bfc3353c023246acbc6d1adf8972a469b0"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b489e77d051e34075b7ff8a8e6c2d266a643ffdf","unresolved":false,"context_lines":[{"line_number":802,"context_line":"            return True"},{"line_number":803,"context_line":"        return False"},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"    def _update(self, context, compute_node):"},{"line_number":806,"context_line":"        \"\"\"Update partial stats locally and populate them to Scheduler.\"\"\""},{"line_number":807,"context_line":"        if not self._resource_change(compute_node):"},{"line_number":808,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_ad5df779","line":805,"in_reply_to":"1f485f77_7802200c","updated":"2017-11-17 20:37:49.000000000","message":"Eek, I take it back: _init_compute_node doesn\u0027t loop over the compute nodes - that happens all the way up at ComputeManager.update_available_resource.  We would have to pass the provider_tree through that whole call stack.\n\nWhich still may be a consideration if we find performance sucking for ironic.","commit_id":"14c7c4bfc3353c023246acbc6d1adf8972a469b0"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"85b1d8c16069e928b3d8325420396922dfcdda10","unresolved":false,"context_lines":[{"line_number":880,"context_line":"                compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":881,"context_line":"            # Let the virt driver rearrange the provider tree and set/update"},{"line_number":882,"context_line":"            # the inventory throughout."},{"line_number":883,"context_line":"            if self.driver.update_provider_tree(nodename, prov_tree):"},{"line_number":884,"context_line":"                # The virt driver indicated that the provider tree has changed."},{"line_number":885,"context_line":"                # Flush the changes."},{"line_number":886,"context_line":"                self.scheduler_client.update_from_provider_tree(prov_tree)"},{"line_number":887,"context_line":"                # NOTE(efried): We do not _normalize_inventory_from_cn_obj if"},{"line_number":888,"context_line":"                # the virt driver is advanced enough to have implemented"},{"line_number":889,"context_line":"                # update_provider_tree."},{"line_number":890,"context_line":"        else:"},{"line_number":891,"context_line":"            # update_provider_tree isn\u0027t implemented yet - try get_inventory"},{"line_number":892,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_0b7d78e6","line":889,"range":{"start_line":883,"start_character":0,"end_line":889,"end_character":39},"updated":"2017-12-14 09:29:40.000000000","message":"Do we need an exception when there is no rp tree return from scheduler client?","commit_id":"ae36a35c79e937dcf145d3bc4d18ca82ffae9f3f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"fc0764ab8a53051032697ea77a1813ffd3801067","unresolved":false,"context_lines":[{"line_number":880,"context_line":"                compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":881,"context_line":"            # Let the virt driver rearrange the provider tree and set/update"},{"line_number":882,"context_line":"            # the inventory throughout."},{"line_number":883,"context_line":"            if self.driver.update_provider_tree(nodename, prov_tree):"},{"line_number":884,"context_line":"                # The virt driver indicated that the provider tree has changed."},{"line_number":885,"context_line":"                # Flush the changes."},{"line_number":886,"context_line":"                self.scheduler_client.update_from_provider_tree(prov_tree)"},{"line_number":887,"context_line":"                # NOTE(efried): We do not _normalize_inventory_from_cn_obj if"},{"line_number":888,"context_line":"                # the virt driver is advanced enough to have implemented"},{"line_number":889,"context_line":"                # update_provider_tree."},{"line_number":890,"context_line":"        else:"},{"line_number":891,"context_line":"            # update_provider_tree isn\u0027t implemented yet - try get_inventory"},{"line_number":892,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_1fba91dd","line":889,"range":{"start_line":883,"start_character":0,"end_line":889,"end_character":39},"in_reply_to":"df87a7cf_0b7d78e6","updated":"2017-12-14 12:49:45.000000000","message":"If the compute host\u0027s provider didn\u0027t exist before this call, this call creates it.  And we\u0027ve reworked the error paths in the report client such that we\u0027ll raise an exception on any API error (and it\u0027ll raise up through here to a common catch-point).\n\nThis is a good question; keep \u0027em coming.","commit_id":"ae36a35c79e937dcf145d3bc4d18ca82ffae9f3f"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"2efa07bf1bdc8815c001ba3e562e618e1f68b937","unresolved":false,"context_lines":[{"line_number":880,"context_line":"                compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":881,"context_line":"            # Let the virt driver rearrange the provider tree and set/update"},{"line_number":882,"context_line":"            # the inventory throughout."},{"line_number":883,"context_line":"            if self.driver.update_provider_tree(nodename, prov_tree):"},{"line_number":884,"context_line":"                # The virt driver indicated that the provider tree has changed."},{"line_number":885,"context_line":"                # Flush the changes."},{"line_number":886,"context_line":"                self.scheduler_client.update_from_provider_tree(prov_tree)"},{"line_number":887,"context_line":"                # NOTE(efried): We do not _normalize_inventory_from_cn_obj if"},{"line_number":888,"context_line":"                # the virt driver is advanced enough to have implemented"},{"line_number":889,"context_line":"                # update_provider_tree."},{"line_number":890,"context_line":"        else:"},{"line_number":891,"context_line":"            # update_provider_tree isn\u0027t implemented yet - try get_inventory"},{"line_number":892,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":13,"id":"df87a7cf_6eaafb85","line":889,"range":{"start_line":883,"start_character":0,"end_line":889,"end_character":39},"in_reply_to":"df87a7cf_1fba91dd","updated":"2017-12-15 01:37:33.000000000","message":"Got it. Thanks, Eric.","commit_id":"ae36a35c79e937dcf145d3bc4d18ca82ffae9f3f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"b8d75821ecb168b26bef0c895e7a9c21eb7ccade","unresolved":false,"context_lines":[{"line_number":883,"context_line":"            if self.driver.update_provider_tree(nodename, prov_tree):"},{"line_number":884,"context_line":"                # The virt driver indicated that the provider tree has changed."},{"line_number":885,"context_line":"                # Flush the changes."},{"line_number":886,"context_line":"                self.scheduler_client.update_from_provider_tree(prov_tree)"},{"line_number":887,"context_line":"                # NOTE(efried): We do not _normalize_inventory_from_cn_obj if"},{"line_number":888,"context_line":"                # the virt driver is advanced enough to have implemented"},{"line_number":889,"context_line":"                # update_provider_tree."}],"source_content_type":"text/x-python","patch_set":19,"id":"9f91af0f_4d2a4e7f","line":886,"range":{"start_line":886,"start_character":38,"end_line":886,"end_character":63},"updated":"2018-01-08 14:58:10.000000000","message":"Do conflict detection at this level, and redrive update_provider_tree.","commit_id":"954dd2075343b57b4166c37fc7446174f6b3172a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6e65405d84b2b84cf3a6086d0d570262077893d0","unresolved":false,"context_lines":[{"line_number":883,"context_line":"            if self.driver.update_provider_tree(nodename, prov_tree):"},{"line_number":884,"context_line":"                # The virt driver indicated that the provider tree has changed."},{"line_number":885,"context_line":"                # Flush the changes."},{"line_number":886,"context_line":"                self.scheduler_client.update_from_provider_tree(prov_tree)"},{"line_number":887,"context_line":"                # NOTE(efried): We do not _normalize_inventory_from_cn_obj if"},{"line_number":888,"context_line":"                # the virt driver is advanced enough to have implemented"},{"line_number":889,"context_line":"                # update_provider_tree."}],"source_content_type":"text/x-python","patch_set":19,"id":"5f93b717_5451e9d7","line":886,"range":{"start_line":886,"start_character":38,"end_line":886,"end_character":63},"in_reply_to":"9f91af0f_4d2a4e7f","updated":"2018-01-25 20:49:11.000000000","message":"update_from_provider_tree is now best-effort (tries hard to hit all providers, even if some fail) and raises exceptions, but for \"redrive\" we\u0027ll just wait for the next natural invocation of this code path.","commit_id":"954dd2075343b57b4166c37fc7446174f6b3172a"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"1c1aa6fad94ee4cedee40b9b074ab25118d14806","unresolved":false,"context_lines":[{"line_number":868,"context_line":"        # is changed."},{"line_number":869,"context_line":"        nodename \u003d compute_node.hypervisor_hostname"},{"line_number":870,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":871,"context_line":"        # NOTE(efried): Check up front whether the driver overrides"},{"line_number":872,"context_line":"        # update_provider_tree.  This is deliberately backwards from the usual"},{"line_number":873,"context_line":"        # try / except NotImplementedError because get_provider_tree (the input"},{"line_number":874,"context_line":"        # to update_provider_tree) is expensive to build."}],"source_content_type":"text/x-python","patch_set":23,"id":"7f96bb07_595a6ff3","line":871,"updated":"2018-01-12 15:19:35.000000000","message":"Today this is happening under COMPUTE_RESOURCE_SEMAPHORE.  Need to make sure it stays that way, at least until proper generation handling is in place.","commit_id":"a47804d49d0bb6428bb1875be9f5f40bcca2f12d"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"64bfb198cd1195029c50ad957e910e39f5227fe9","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"},{"line_number":874,"context_line":"        # provider corresponding to the compute node."},{"line_number":875,"context_line":"        prov_tree \u003d self.scheduler_client.get_provider_tree("},{"line_number":876,"context_line":"            compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."}],"source_content_type":"text/x-python","patch_set":29,"id":"7f96bb07_4733bd62","line":875,"range":{"start_line":875,"start_character":42,"end_line":875,"end_character":59},"updated":"2018-01-18 16:04:34.000000000","message":"as mentioned on hangout... change this to get_provider_tree_and_ensure_root() to indicate that this is NOT actually a read-only operation.","commit_id":"9673cf649672ae21f217f632792b0c97be8289a2"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6e65405d84b2b84cf3a6086d0d570262077893d0","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"},{"line_number":874,"context_line":"        # provider corresponding to the compute node."},{"line_number":875,"context_line":"        prov_tree \u003d self.scheduler_client.get_provider_tree("},{"line_number":876,"context_line":"            compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."}],"source_content_type":"text/x-python","patch_set":29,"id":"5f93b717_54bc8904","line":875,"range":{"start_line":875,"start_character":42,"end_line":875,"end_character":59},"in_reply_to":"7f96bb07_4733bd62","updated":"2018-01-25 20:49:11.000000000","message":"Done","commit_id":"9673cf649672ae21f217f632792b0c97be8289a2"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"7028937fe3a3146d9a069ffb380c4435a726c002","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"},{"line_number":874,"context_line":"        # provider corresponding to the compute node."},{"line_number":875,"context_line":"        prov_tree \u003d self.scheduler_client.get_provider_tree("},{"line_number":876,"context_line":"            compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."}],"source_content_type":"text/x-python","patch_set":30,"id":"7f96bb07_be74eeff","line":875,"updated":"2018-01-19 15:02:24.000000000","message":"this must be get_provider_tree_and_ensure_root, right?","commit_id":"8dd338f3e05bb8e8f76f95ed1c77cb0efa163ce1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6e65405d84b2b84cf3a6086d0d570262077893d0","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"},{"line_number":874,"context_line":"        # provider corresponding to the compute node."},{"line_number":875,"context_line":"        prov_tree \u003d self.scheduler_client.get_provider_tree("},{"line_number":876,"context_line":"            compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."}],"source_content_type":"text/x-python","patch_set":30,"id":"5f93b717_b4594dff","line":875,"in_reply_to":"7f96bb07_19dbbc7d","updated":"2018-01-25 20:49:11.000000000","message":"Done","commit_id":"8dd338f3e05bb8e8f76f95ed1c77cb0efa163ce1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6470562ba7e92901b337bdf464a2ae5e2557d84","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"},{"line_number":874,"context_line":"        # provider corresponding to the compute node."},{"line_number":875,"context_line":"        prov_tree \u003d self.scheduler_client.get_provider_tree("},{"line_number":876,"context_line":"            compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."}],"source_content_type":"text/x-python","patch_set":30,"id":"7f96bb07_19dbbc7d","line":875,"in_reply_to":"7f96bb07_be74eeff","updated":"2018-01-19 15:25:13.000000000","message":"Yes.","commit_id":"8dd338f3e05bb8e8f76f95ed1c77cb0efa163ce1"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"2de13f1083438e9da17762345d6dfa32882b8737","unresolved":false,"context_lines":[{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."},{"line_number":879,"context_line":"        try:"},{"line_number":880,"context_line":"            if self.driver.update_provider_tree(nodename, prov_tree):"},{"line_number":881,"context_line":"                # The virt driver indicated that the provider tree has changed."},{"line_number":882,"context_line":"                # Flush the changes."},{"line_number":883,"context_line":"                self.scheduler_client.update_from_provider_tree(prov_tree)"}],"source_content_type":"text/x-python","patch_set":30,"id":"7f96bb07_9e2ed2f8","line":880,"updated":"2018-01-19 14:54:37.000000000","message":"parameters should be reversed here","commit_id":"8dd338f3e05bb8e8f76f95ed1c77cb0efa163ce1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"f6470562ba7e92901b337bdf464a2ae5e2557d84","unresolved":false,"context_lines":[{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."},{"line_number":879,"context_line":"        try:"},{"line_number":880,"context_line":"            if self.driver.update_provider_tree(nodename, prov_tree):"},{"line_number":881,"context_line":"                # The virt driver indicated that the provider tree has changed."},{"line_number":882,"context_line":"                # Flush the changes."},{"line_number":883,"context_line":"                self.scheduler_client.update_from_provider_tree(prov_tree)"}],"source_content_type":"text/x-python","patch_set":30,"id":"7f96bb07_f9e1302c","line":880,"in_reply_to":"7f96bb07_9e2ed2f8","updated":"2018-01-19 15:25:13.000000000","message":"Right you are.","commit_id":"8dd338f3e05bb8e8f76f95ed1c77cb0efa163ce1"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6e65405d84b2b84cf3a6086d0d570262077893d0","unresolved":false,"context_lines":[{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."},{"line_number":879,"context_line":"        try:"},{"line_number":880,"context_line":"            if self.driver.update_provider_tree(nodename, prov_tree):"},{"line_number":881,"context_line":"                # The virt driver indicated that the provider tree has changed."},{"line_number":882,"context_line":"                # Flush the changes."},{"line_number":883,"context_line":"                self.scheduler_client.update_from_provider_tree(prov_tree)"}],"source_content_type":"text/x-python","patch_set":30,"id":"5f93b717_1465a1b5","line":880,"in_reply_to":"7f96bb07_f9e1302c","updated":"2018-01-25 20:49:11.000000000","message":"Done","commit_id":"8dd338f3e05bb8e8f76f95ed1c77cb0efa163ce1"},{"author":{"_account_id":9172,"name":"Radoslav Gerganov","email":"rgerganov@vmware.com","username":"rgerganov"},"change_message_id":"816165589a7c5e13f9ec92a61cffd2c72febadc8","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"},{"line_number":874,"context_line":"        # provider corresponding to the compute node."},{"line_number":875,"context_line":"        prov_tree \u003d self.scheduler_client.get_provider_tree("},{"line_number":876,"context_line":"            compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."}],"source_content_type":"text/x-python","patch_set":32,"id":"7f96bb07_6a32f5a9","line":875,"updated":"2018-01-22 12:26:25.000000000","message":"Are we going to add a new method in the SchedulerClient or we are going to use the SchedulerReportClient through scheduler_client.reportclient?","commit_id":"0e1c734081a4cefa024d5e8013dd890512a49276"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6e65405d84b2b84cf3a6086d0d570262077893d0","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"},{"line_number":874,"context_line":"        # provider corresponding to the compute node."},{"line_number":875,"context_line":"        prov_tree \u003d self.scheduler_client.get_provider_tree("},{"line_number":876,"context_line":"            compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."}],"source_content_type":"text/x-python","patch_set":32,"id":"5f93b717_140a81d1","line":875,"in_reply_to":"7f96bb07_5a1ee870","updated":"2018-01-25 20:49:11.000000000","message":"Done","commit_id":"0e1c734081a4cefa024d5e8013dd890512a49276"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"06761f9af38e1b1672d7d8ace56e260a19ae05dc","unresolved":false,"context_lines":[{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"},{"line_number":874,"context_line":"        # provider corresponding to the compute node."},{"line_number":875,"context_line":"        prov_tree \u003d self.scheduler_client.get_provider_tree("},{"line_number":876,"context_line":"            compute_node.uuid, compute_node.hypervisor_hostname)"},{"line_number":877,"context_line":"        # Let the virt driver rearrange the provider tree and set/update"},{"line_number":878,"context_line":"        # the inventory, traits, and aggregates throughout."}],"source_content_type":"text/x-python","patch_set":32,"id":"7f96bb07_5a1ee870","line":875,"in_reply_to":"7f96bb07_6a32f5a9","updated":"2018-01-22 14:34:49.000000000","message":"I found out partway through this cycle that \"we\" (Jay) don\u0027t care to maintain the SchedulerClient shim anymore (and eventually want to get rid of it entirely) - so the latter.","commit_id":"0e1c734081a4cefa024d5e8013dd890512a49276"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"8e59ae14ab569befbcf777f143320502ef6b52ee","unresolved":false,"context_lines":[{"line_number":902,"context_line":"                self.scheduler_client.update_compute_node(context,"},{"line_number":903,"context_line":"                                                          compute_node)"},{"line_number":904,"context_line":""},{"line_number":905,"context_line":"        try:"},{"line_number":906,"context_line":"            traits \u003d self.driver.get_traits(nodename)"},{"line_number":907,"context_line":"        except NotImplementedError:"},{"line_number":908,"context_line":"            pass"},{"line_number":909,"context_line":"        else:"},{"line_number":910,"context_line":"            # NOTE(mgoddard): set_traits_for_provider does not refresh the"},{"line_number":911,"context_line":"            # provider tree in the report client, so we rely on the above call"},{"line_number":912,"context_line":"            # to set_inventory_for_provider or update_compute_node to ensure"},{"line_number":913,"context_line":"            # that the resource provider exists in the tree and has had its"},{"line_number":914,"context_line":"            # cached traits refreshed."},{"line_number":915,"context_line":"            self.reportclient.set_traits_for_provider("},{"line_number":916,"context_line":"                compute_node.uuid, traits)"},{"line_number":917,"context_line":""},{"line_number":918,"context_line":"        if self.pci_tracker:"},{"line_number":919,"context_line":"            self.pci_tracker.save(context)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa0c359_0977dc3c","line":916,"range":{"start_line":905,"start_character":0,"end_line":916,"end_character":42},"updated":"2018-02-05 19:16:09.000000000","message":"Per spec review [1], indent this one scope (so it\u0027s *not* applied when update_provider_tree is implemented, but it *is* applied for both the get_inventory and update_compute_node paths.\n\n[1] https://review.openstack.org/#/c/540111/2/specs/rocky/approved/update-provider-tree.rst@183","commit_id":"c3eca4e2c3f4a14c0adcb7f66c43640cbc9986e9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"1d804cbb913f84b30a52b6d06d656493e7f6a2c0","unresolved":false,"context_lines":[{"line_number":902,"context_line":"                self.scheduler_client.update_compute_node(context,"},{"line_number":903,"context_line":"                                                          compute_node)"},{"line_number":904,"context_line":""},{"line_number":905,"context_line":"        try:"},{"line_number":906,"context_line":"            traits \u003d self.driver.get_traits(nodename)"},{"line_number":907,"context_line":"        except NotImplementedError:"},{"line_number":908,"context_line":"            pass"},{"line_number":909,"context_line":"        else:"},{"line_number":910,"context_line":"            # NOTE(mgoddard): set_traits_for_provider does not refresh the"},{"line_number":911,"context_line":"            # provider tree in the report client, so we rely on the above call"},{"line_number":912,"context_line":"            # to set_inventory_for_provider or update_compute_node to ensure"},{"line_number":913,"context_line":"            # that the resource provider exists in the tree and has had its"},{"line_number":914,"context_line":"            # cached traits refreshed."},{"line_number":915,"context_line":"            self.reportclient.set_traits_for_provider("},{"line_number":916,"context_line":"                compute_node.uuid, traits)"},{"line_number":917,"context_line":""},{"line_number":918,"context_line":"        if self.pci_tracker:"},{"line_number":919,"context_line":"            self.pci_tracker.save(context)"}],"source_content_type":"text/x-python","patch_set":47,"id":"3fa0c359_49c5dd3b","line":916,"range":{"start_line":905,"start_character":0,"end_line":916,"end_character":42},"in_reply_to":"3fa0c359_0977dc3c","updated":"2018-02-05 23:48:35.000000000","message":"Done","commit_id":"c3eca4e2c3f4a14c0adcb7f66c43640cbc9986e9"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8723672df1e085989269bf2abd7b3bebbc23c950","unresolved":false,"context_lines":[{"line_number":867,"context_line":"        # ensure the update request to placement only happens when inventory"},{"line_number":868,"context_line":"        # is changed."},{"line_number":869,"context_line":"        nodename \u003d compute_node.hypervisor_hostname"},{"line_number":870,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":871,"context_line":"        # First try update_provider_tree"},{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"}],"source_content_type":"text/x-python","patch_set":53,"id":"df7087c5_165fdbe5","line":870,"updated":"2018-03-20 12:17:53.000000000","message":"this comment no longer has the accuracy it once did","commit_id":"2964c722808626d3312b79f60ead78a799621c6e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"56a6adcf65ce97340cc9a5e04aa52b918875d800","unresolved":false,"context_lines":[{"line_number":867,"context_line":"        # ensure the update request to placement only happens when inventory"},{"line_number":868,"context_line":"        # is changed."},{"line_number":869,"context_line":"        nodename \u003d compute_node.hypervisor_hostname"},{"line_number":870,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":871,"context_line":"        # First try update_provider_tree"},{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"}],"source_content_type":"text/x-python","patch_set":53,"id":"df7087c5_9173c280","line":870,"in_reply_to":"df7087c5_165fdbe5","updated":"2018-03-22 00:19:57.000000000","message":"How not?","commit_id":"2964c722808626d3312b79f60ead78a799621c6e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8723672df1e085989269bf2abd7b3bebbc23c950","unresolved":false,"context_lines":[{"line_number":880,"context_line":"        try:"},{"line_number":881,"context_line":"            self.driver.update_provider_tree(prov_tree, nodename)"},{"line_number":882,"context_line":"            # Flush any changes."},{"line_number":883,"context_line":"            src.update_from_provider_tree(context, prov_tree)"},{"line_number":884,"context_line":"            # NOTE(efried): We do not _normalize_inventory_from_cn_obj if"},{"line_number":885,"context_line":"            # the virt driver is advanced enough to have implemented"},{"line_number":886,"context_line":"            # update_provider_tree."}],"source_content_type":"text/x-python","patch_set":53,"id":"df7087c5_d6dba34c","line":883,"updated":"2018-03-20 12:17:53.000000000","message":"src reads like \"source\" not \"reportclient\", maybe use that instead?","commit_id":"2964c722808626d3312b79f60ead78a799621c6e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"56a6adcf65ce97340cc9a5e04aa52b918875d800","unresolved":false,"context_lines":[{"line_number":880,"context_line":"        try:"},{"line_number":881,"context_line":"            self.driver.update_provider_tree(prov_tree, nodename)"},{"line_number":882,"context_line":"            # Flush any changes."},{"line_number":883,"context_line":"            src.update_from_provider_tree(context, prov_tree)"},{"line_number":884,"context_line":"            # NOTE(efried): We do not _normalize_inventory_from_cn_obj if"},{"line_number":885,"context_line":"            # the virt driver is advanced enough to have implemented"},{"line_number":886,"context_line":"            # update_provider_tree."}],"source_content_type":"text/x-python","patch_set":53,"id":"df7087c5_516d2a96","line":883,"in_reply_to":"df7087c5_d6dba34c","updated":"2018-03-22 00:19:57.000000000","message":"Done","commit_id":"2964c722808626d3312b79f60ead78a799621c6e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b8ac6bde741a3fcca7b52d3bcf0bdbde490c6781","unresolved":false,"context_lines":[{"line_number":867,"context_line":"        # ensure the update request to placement only happens when inventory"},{"line_number":868,"context_line":"        # is changed."},{"line_number":869,"context_line":"        nodename \u003d compute_node.hypervisor_hostname"},{"line_number":870,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":871,"context_line":"        # First try update_provider_tree"},{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"}],"source_content_type":"text/x-python","patch_set":54,"id":"bf659307_a50e05e3","line":870,"updated":"2018-03-26 13:15:27.000000000","message":"The reason it\u0027s not quite accurate is that much of the updating is to placement, not nova-scheduler.","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":25638,"name":"Naichuan Sun","email":"naichuan.sun@citrix.com","username":"naichuans"},"change_message_id":"6b7f8f738e8b5acc3e4d79871dfc30938da9b1a6","unresolved":false,"context_lines":[{"line_number":867,"context_line":"        # ensure the update request to placement only happens when inventory"},{"line_number":868,"context_line":"        # is changed."},{"line_number":869,"context_line":"        nodename \u003d compute_node.hypervisor_hostname"},{"line_number":870,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":871,"context_line":"        # First try update_provider_tree"},{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"}],"source_content_type":"text/x-python","patch_set":54,"id":"bf659307_673779e5","line":870,"in_reply_to":"bf659307_7541620b","updated":"2018-03-27 08:03:57.000000000","message":"Persist to placement Database?","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"1d1153d6c251b9e35ddefe52ddf9bb1584746bc6","unresolved":false,"context_lines":[{"line_number":867,"context_line":"        # ensure the update request to placement only happens when inventory"},{"line_number":868,"context_line":"        # is changed."},{"line_number":869,"context_line":"        nodename \u003d compute_node.hypervisor_hostname"},{"line_number":870,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":871,"context_line":"        # First try update_provider_tree"},{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"}],"source_content_type":"text/x-python","patch_set":54,"id":"bf659307_e16ce309","line":870,"in_reply_to":"bf659307_a50e05e3","updated":"2018-03-26 22:06:47.000000000","message":"...via the scheduler?","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"70a614a2b3cdbb30e36cec3070691831de4f3852","unresolved":false,"context_lines":[{"line_number":867,"context_line":"        # ensure the update request to placement only happens when inventory"},{"line_number":868,"context_line":"        # is changed."},{"line_number":869,"context_line":"        nodename \u003d compute_node.hypervisor_hostname"},{"line_number":870,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":871,"context_line":"        # First try update_provider_tree"},{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"}],"source_content_type":"text/x-python","patch_set":54,"id":"bf659307_281e0570","line":870,"in_reply_to":"bf659307_a50e05e3","updated":"2018-03-28 13:40:56.000000000","message":"Regardless, this line doesn\u0027t change in this patch. For the record, the comment above refers to the updating of usage information in the caching scheduler that is sent from the compute nodes to the scheduler directly via these scheduler queryclient\u0027s methods:\n\nhttps://github.com/openstack/nova/blob/master/nova/scheduler/client/__init__.py#L71-L83","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b3dd97f1ef7c39d7ffd8a423468c9b05a5452abc","unresolved":false,"context_lines":[{"line_number":867,"context_line":"        # ensure the update request to placement only happens when inventory"},{"line_number":868,"context_line":"        # is changed."},{"line_number":869,"context_line":"        nodename \u003d compute_node.hypervisor_hostname"},{"line_number":870,"context_line":"        # Persist the stats to the Scheduler"},{"line_number":871,"context_line":"        # First try update_provider_tree"},{"line_number":872,"context_line":"        # Retrieve the provider tree associated with this compute node.  If"},{"line_number":873,"context_line":"        # it doesn\u0027t exist yet, this will create it with a (single, root)"}],"source_content_type":"text/x-python","patch_set":54,"id":"bf659307_7541620b","line":870,"in_reply_to":"bf659307_e16ce309","updated":"2018-03-27 07:34:10.000000000","message":"When the resource tracker updates placement, it is via the report client, but the nova-scheduler process is not involved.","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"}],"nova/tests/functional/test_servers.py":[{"author":{"_account_id":19853,"name":"Nguyen Hung Phuong","email":"phuongnh@vn.fujitsu.com","username":"phuongnh"},"change_message_id":"a2ab0565663c306933de0649216c42871bc79cab","unresolved":false,"context_lines":[{"line_number":1590,"context_line":"            compute.manager.update_available_resource(ctx)"},{"line_number":1591,"context_line":"        LOG.info(\u0027Finished with periodics\u0027)"},{"line_number":1592,"context_line":""},{"line_number":1593,"context_line":"    def _get_all_providers(self):"},{"line_number":1594,"context_line":"        return self.src.get("},{"line_number":1595,"context_line":"            \u0027/resource_providers\u0027, version\u003d\u00271.14\u0027).json()[\u0027resource_providers\u0027]"},{"line_number":1596,"context_line":""}],"source_content_type":"text/x-python","patch_set":45,"id":"5f93b717_0f4e3537","line":1593,"updated":"2018-02-02 01:10:48.000000000","message":"duplicated","commit_id":"e4d35dc8d07f729d0bbb397734ec0ab54c363e05"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"8723672df1e085989269bf2abd7b3bebbc23c950","unresolved":false,"context_lines":[{"line_number":1850,"context_line":"                         self._get_provider_traits(uuids.pf2_2))"},{"line_number":1851,"context_line":"        self.assertEqual("},{"line_number":1852,"context_line":"            4,"},{"line_number":1853,"context_line":"            self._get_provider_inventory(uuids.pf2_2)[\u0027SRIOV_NET_VF\u0027][\u0027total\u0027])"},{"line_number":1854,"context_line":""},{"line_number":1855,"context_line":"        # Compute and NUMAs don\u0027t have any traits"},{"line_number":1856,"context_line":"        for uuid in (self.host_uuid, uuids.numa1, uuids.numa2):"}],"source_content_type":"text/x-python","patch_set":53,"id":"df7087c5_967c4b21","line":1853,"updated":"2018-03-20 12:17:53.000000000","message":"This mixture of indent styles ought to drive someone, not sure who, crazy. Kudos.","commit_id":"2964c722808626d3312b79f60ead78a799621c6e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"56a6adcf65ce97340cc9a5e04aa52b918875d800","unresolved":false,"context_lines":[{"line_number":1850,"context_line":"                         self._get_provider_traits(uuids.pf2_2))"},{"line_number":1851,"context_line":"        self.assertEqual("},{"line_number":1852,"context_line":"            4,"},{"line_number":1853,"context_line":"            self._get_provider_inventory(uuids.pf2_2)[\u0027SRIOV_NET_VF\u0027][\u0027total\u0027])"},{"line_number":1854,"context_line":""},{"line_number":1855,"context_line":"        # Compute and NUMAs don\u0027t have any traits"},{"line_number":1856,"context_line":"        for uuid in (self.host_uuid, uuids.numa1, uuids.numa2):"}],"source_content_type":"text/x-python","patch_set":53,"id":"df7087c5_d1dcda47","line":1853,"in_reply_to":"df7087c5_967c4b21","updated":"2018-03-22 00:19:57.000000000","message":"It\u0027s totally consistent.  Rules:\n\n1) Make sure each argument fits on one line.\n2) Put each argument on its own line, unless they both fit on one line.\n3) Put arguments on the same line as the assert, to save a newline, unless this violates rule #1.\n4) Put everything on one line if it fits.\n\nBut I\u0027m sure you\u0027re right.","commit_id":"2964c722808626d3312b79f60ead78a799621c6e"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"09404b8fef905d0367cc47277f64a2e7b85f24a3","unresolved":false,"context_lines":[{"line_number":1658,"context_line":"        rt \u003d self.compute._get_resource_tracker()"},{"line_number":1659,"context_line":"        self.assertRaises("},{"line_number":1660,"context_line":"            exception.ResourceProviderSyncFailed,"},{"line_number":1661,"context_line":"            rt.update_available_resource, ctx, self.compute.host)"},{"line_number":1662,"context_line":""},{"line_number":1663,"context_line":"    def test_update_provider_tree_associated_info(self):"},{"line_number":1664,"context_line":"        \"\"\"Inventory in some standard and custom resource classes.  Standard"}],"source_content_type":"text/x-python","patch_set":54,"id":"bf659307_95e1412d","line":1661,"updated":"2018-03-29 17:06:34.000000000","message":"What is it about calling ResourceTracker.update_available_resource that makes it raise ResourceProviderSyncFailed -- rt.update_available_resource is expected to raise one of the helper_exceptions? I had a look through the previous patch and couldn\u0027t really connect how/why we expect a sync failure in this scenario.","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"273e05d248f1b6454bbce7b97fa46711a5e99fb3","unresolved":false,"context_lines":[{"line_number":1658,"context_line":"        rt \u003d self.compute._get_resource_tracker()"},{"line_number":1659,"context_line":"        self.assertRaises("},{"line_number":1660,"context_line":"            exception.ResourceProviderSyncFailed,"},{"line_number":1661,"context_line":"            rt.update_available_resource, ctx, self.compute.host)"},{"line_number":1662,"context_line":""},{"line_number":1663,"context_line":"    def test_update_provider_tree_associated_info(self):"},{"line_number":1664,"context_line":"        \"\"\"Inventory in some standard and custom resource classes.  Standard"}],"source_content_type":"text/x-python","patch_set":54,"id":"bf659307_2ab0fd42","line":1661,"in_reply_to":"bf659307_95e1412d","updated":"2018-03-30 19:20:02.000000000","message":"This is helper that allows us to run update_from_provider_tree in its native habitat, but in a way that we can assert it raises the expected exception.  Otherwise I would just use _run_periodicals - but update_available_resource_for_node swallows all exceptions.\n\nI marked up the two places below where the helper is used.","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":25625,"name":"Tetsuro Nakamura","email":"tetsuro.nakamura.bc@hco.ntt.co.jp","username":"tetsuro0907"},"change_message_id":"a8b12c1cb57f419bc415f4bf03a5758249542ab1","unresolved":false,"context_lines":[{"line_number":1695,"context_line":""},{"line_number":1696,"context_line":"        def update_provider_tree(prov_tree, nodename):"},{"line_number":1697,"context_line":"            prov_tree.update_inventory(self.compute.host, inv, None)"},{"line_number":1698,"context_line":"            prov_tree.update_traits(self.compute.host, traits)"},{"line_number":1699,"context_line":"            prov_tree.update_aggregates(self.compute.host, aggs)"},{"line_number":1700,"context_line":"        self.mock_upt.side_effect \u003d update_provider_tree"},{"line_number":1701,"context_line":""},{"line_number":1702,"context_line":"        self.assertNotIn(\u0027CUSTOM_BANDWIDTH\u0027, self._get_all_resource_classes())"}],"source_content_type":"text/x-python","patch_set":54,"id":"df7087c5_79f02c92","line":1699,"range":{"start_line":1698,"start_character":0,"end_line":1699,"end_character":64},"updated":"2018-03-23 08:24:01.000000000","message":"nit: We\u0027d like to let https://review.openstack.org/#/c/553475/ go earlier and use the new add_traits/aggregates functions here to make it clear to nova developers that the virt driver should use add_traits/aggregates rather than update_traits/aggregates..., right?","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"ebc5a9e0333b0d1c57eafb193134ad8bbd5de462","unresolved":false,"context_lines":[{"line_number":1695,"context_line":""},{"line_number":1696,"context_line":"        def update_provider_tree(prov_tree, nodename):"},{"line_number":1697,"context_line":"            prov_tree.update_inventory(self.compute.host, inv, None)"},{"line_number":1698,"context_line":"            prov_tree.update_traits(self.compute.host, traits)"},{"line_number":1699,"context_line":"            prov_tree.update_aggregates(self.compute.host, aggs)"},{"line_number":1700,"context_line":"        self.mock_upt.side_effect \u003d update_provider_tree"},{"line_number":1701,"context_line":""},{"line_number":1702,"context_line":"        self.assertNotIn(\u0027CUSTOM_BANDWIDTH\u0027, self._get_all_resource_classes())"}],"source_content_type":"text/x-python","patch_set":54,"id":"df7087c5_31a63f11","line":1699,"range":{"start_line":1698,"start_character":0,"end_line":1699,"end_character":64},"in_reply_to":"df7087c5_3a7ff9df","updated":"2018-03-23 15:45:21.000000000","message":"Yeah, I didn\u0027t want to reshuffle this whole series, since it was so close to ready and the other patch was brand new.","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"b60f1cf864d12b953a5676b833300440c0890e12","unresolved":false,"context_lines":[{"line_number":1695,"context_line":""},{"line_number":1696,"context_line":"        def update_provider_tree(prov_tree, nodename):"},{"line_number":1697,"context_line":"            prov_tree.update_inventory(self.compute.host, inv, None)"},{"line_number":1698,"context_line":"            prov_tree.update_traits(self.compute.host, traits)"},{"line_number":1699,"context_line":"            prov_tree.update_aggregates(self.compute.host, aggs)"},{"line_number":1700,"context_line":"        self.mock_upt.side_effect \u003d update_provider_tree"},{"line_number":1701,"context_line":""},{"line_number":1702,"context_line":"        self.assertNotIn(\u0027CUSTOM_BANDWIDTH\u0027, self._get_all_resource_classes())"}],"source_content_type":"text/x-python","patch_set":54,"id":"df7087c5_3a7ff9df","line":1699,"range":{"start_line":1698,"start_character":0,"end_line":1699,"end_character":64},"in_reply_to":"df7087c5_79f02c92","updated":"2018-03-23 15:06:58.000000000","message":"meh, that\u0027s later in this patch series. I\u0027m fine doing this for now.","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"273e05d248f1b6454bbce7b97fa46711a5e99fb3","unresolved":false,"context_lines":[{"line_number":1865,"context_line":"        self.assertIn(\u0027VCPU\u0027, rcs)"},{"line_number":1866,"context_line":"        self.assertNotIn(\u0027FOO\u0027, rcs)"},{"line_number":1867,"context_line":""},{"line_number":1868,"context_line":"        self._run_update_available_resource_and_assert_sync_error()"},{"line_number":1869,"context_line":""},{"line_number":1870,"context_line":"        rcs \u003d self._get_all_resource_classes()"},{"line_number":1871,"context_line":"        self.assertIn(\u0027VCPU\u0027, rcs)"}],"source_content_type":"text/x-python","patch_set":54,"id":"bf659307_6ac915aa","line":1868,"range":{"start_line":1868,"start_character":8,"end_line":1868,"end_character":67},"updated":"2018-03-30 19:20:02.000000000","message":"Here we set up a bogus resource class.  update_from_provider_tree tries to post it back to placement, receives InvalidResourceClass (via catch_all), converts it to ResourceProviderSyncFailed, and raises it for this helper to validate.","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"273e05d248f1b6454bbce7b97fa46711a5e99fb3","unresolved":false,"context_lines":[{"line_number":1880,"context_line":"        self.assertIn(\u0027HW_CPU_X86_AVX\u0027, traits)"},{"line_number":1881,"context_line":"        self.assertNotIn(\u0027FOO\u0027, traits)"},{"line_number":1882,"context_line":""},{"line_number":1883,"context_line":"        self._run_update_available_resource_and_assert_sync_error()"},{"line_number":1884,"context_line":""},{"line_number":1885,"context_line":"        traits \u003d self._get_all_traits()"},{"line_number":1886,"context_line":"        self.assertIn(\u0027HW_CPU_X86_AVX\u0027, traits)"}],"source_content_type":"text/x-python","patch_set":54,"id":"bf659307_8acee9b1","line":1883,"range":{"start_line":1883,"start_character":8,"end_line":1883,"end_character":67},"updated":"2018-03-30 19:20:02.000000000","message":"Here we set up a bogus trait.  update_from_provider_tree tries to post it back to placement, receives TraitCreationFailed (via catch_all), converts it to ResourceProviderSyncFailed, and raises it for this helper to validate.","commit_id":"33791cf09ce421cabac9d7addb129da18872dc1e"}]}
