)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"82448330921f0b1273d1b8fb41e069bb393aaeeb","unresolved":false,"context_lines":[{"line_number":30,"context_line":"Co-Authored-By: Ed Leafe \u003ced@leafe.com\u003e"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Change-Id: Iee05dcf25155afbbfeecf9f186571b61a74353f8"},{"line_number":33,"context_line":"blueprint: custom-resource-classes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":34,"id":"fa31d9ce_97cc0437","line":33,"updated":"2017-02-10 18:45:18.000000000","message":"This needs to change now, since I closed that blueprint for ocata since most of the groundwork was done. Let\u0027s create a new custom-resource-classes-pike blueprint for any remaining work.","commit_id":"41ce277cc3f23b12478f22b3fb8a5820a67e0fb6"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6c2618cef712e3ecfa5911e7befaa12566107688","unresolved":false,"context_lines":[{"line_number":30,"context_line":"Co-Authored-By: Ed Leafe \u003ced@leafe.com\u003e"},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"Change-Id: Iee05dcf25155afbbfeecf9f186571b61a74353f8"},{"line_number":33,"context_line":"blueprint: custom-resource-classes"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":34,"id":"fa31d9ce_979a4413","line":33,"in_reply_to":"fa31d9ce_97cc0437","updated":"2017-02-10 18:46:54.000000000","message":"I guess I already did:\n\nhttps://blueprints.launchpad.net/nova/+spec/custom-resource-classes-pike","commit_id":"41ce277cc3f23b12478f22b3fb8a5820a67e0fb6"}],"nova/compute/resource_tracker.py":[{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"4c9e5b1e2a0e60c261b9b6bf52523185793b6e69","unresolved":false,"context_lines":[{"line_number":475,"context_line":"                          call."},{"line_number":476,"context_line":"        \"\"\""},{"line_number":477,"context_line":"        if self._is_ironic():"},{"line_number":478,"context_line":"            bm_node_class \u003d resources[\u0027resource_class\u0027]"},{"line_number":479,"context_line":"            # NOTE(jaypipes): Ironic baremetal node resource providers only"},{"line_number":480,"context_line":"            # ever have a single inventory record, of quantity 1 of the"},{"line_number":481,"context_line":"            # resource class indicated for the node."}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_83d621ef","line":478,"updated":"2016-12-05 20:52:23.000000000","message":"We\u0027ll want to check if this is None and warn/skip if so. It isn\u0027t required in ironic. It also isn\u0027t strictly required in Nova until Pike IMO, since old-style flavors won\u0027t work in Pike.","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4636814abd6b46d200e1e4f34c35327dde14372d","unresolved":false,"context_lines":[{"line_number":475,"context_line":"                          call."},{"line_number":476,"context_line":"        \"\"\""},{"line_number":477,"context_line":"        if self._is_ironic():"},{"line_number":478,"context_line":"            bm_node_class \u003d resources[\u0027resource_class\u0027]"},{"line_number":479,"context_line":"            # NOTE(jaypipes): Ironic baremetal node resource providers only"},{"line_number":480,"context_line":"            # ever have a single inventory record, of quantity 1 of the"},{"line_number":481,"context_line":"            # resource class indicated for the node."}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_e0bd8f03","line":478,"in_reply_to":"1a6eadb0_f01f67b4","updated":"2016-12-19 14:15:59.000000000","message":"Done","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"e55623c4532a2c473ffe758632e8196425b219e8","unresolved":false,"context_lines":[{"line_number":475,"context_line":"                          call."},{"line_number":476,"context_line":"        \"\"\""},{"line_number":477,"context_line":"        if self._is_ironic():"},{"line_number":478,"context_line":"            bm_node_class \u003d resources[\u0027resource_class\u0027]"},{"line_number":479,"context_line":"            # NOTE(jaypipes): Ironic baremetal node resource providers only"},{"line_number":480,"context_line":"            # ever have a single inventory record, of quantity 1 of the"},{"line_number":481,"context_line":"            # resource class indicated for the node."}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_f01f67b4","line":478,"in_reply_to":"3a71b18c_4b536617","updated":"2016-12-16 13:07:47.000000000","message":"It will be \"required\" to use ironic with nova, but we also allow for use without nova. So no, the API won\u0027t validate it.","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"42c2ad240b74f1fb461fdb3152a1a704360c167f","unresolved":false,"context_lines":[{"line_number":475,"context_line":"                          call."},{"line_number":476,"context_line":"        \"\"\""},{"line_number":477,"context_line":"        if self._is_ironic():"},{"line_number":478,"context_line":"            bm_node_class \u003d resources[\u0027resource_class\u0027]"},{"line_number":479,"context_line":"            # NOTE(jaypipes): Ironic baremetal node resource providers only"},{"line_number":480,"context_line":"            # ever have a single inventory record, of quantity 1 of the"},{"line_number":481,"context_line":"            # resource class indicated for the node."}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_4b536617","line":478,"in_reply_to":"3a71b18c_83d621ef","updated":"2016-12-09 23:13:41.000000000","message":"Is this going to be required in ironic any time soon?","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"42c2ad240b74f1fb461fdb3152a1a704360c167f","unresolved":false,"context_lines":[{"line_number":491,"context_line":"            }"},{"line_number":492,"context_line":"            try:"},{"line_number":493,"context_line":"                self.scheduler_client.set_provider_inventory("},{"line_number":494,"context_line":"                    cn.uuid,"},{"line_number":495,"context_line":"                    cn.hypervisor_hostname,"},{"line_number":496,"context_line":"                    inv_data,"},{"line_number":497,"context_line":"                )"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_2b89ca26","line":494,"range":{"start_line":494,"start_character":20,"end_line":494,"end_character":28},"updated":"2016-12-09 23:13:41.000000000","message":"Shouldn\u0027t this be a child RP of the compute node? Otherwise, how will it be possible to have only one of any ironic class per compute node?","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4636814abd6b46d200e1e4f34c35327dde14372d","unresolved":false,"context_lines":[{"line_number":491,"context_line":"            }"},{"line_number":492,"context_line":"            try:"},{"line_number":493,"context_line":"                self.scheduler_client.set_provider_inventory("},{"line_number":494,"context_line":"                    cn.uuid,"},{"line_number":495,"context_line":"                    cn.hypervisor_hostname,"},{"line_number":496,"context_line":"                    inv_data,"},{"line_number":497,"context_line":"                )"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_a071d779","line":494,"range":{"start_line":494,"start_character":20,"end_line":494,"end_character":28},"in_reply_to":"3a71b18c_2b89ca26","updated":"2016-12-19 14:15:59.000000000","message":"Nope, each Ironic node is its own top-level resource provider, as discussed on IRC.","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"4c9e5b1e2a0e60c261b9b6bf52523185793b6e69","unresolved":false,"context_lines":[{"line_number":494,"context_line":"                    cn.uuid,"},{"line_number":495,"context_line":"                    cn.hypervisor_hostname,"},{"line_number":496,"context_line":"                    inv_data,"},{"line_number":497,"context_line":"                )"},{"line_number":498,"context_line":"            except exception.InventoryInUse:"},{"line_number":499,"context_line":"                # The Ironic baremetal node had already been allocated to an"},{"line_number":500,"context_line":"                # instance and allocation records for VCPU, MEMORY_MB and"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_9e003603","line":497,"updated":"2016-12-05 20:52:23.000000000","message":"AIUI, this will remove the existing inventory records (CPU, RAM, disk), and put this new inventory data in. This will break existing flavors and won\u0027t allow a smooth transition to the new flavors, right?\n\n(This assumes the old style flavors use the placement engine for scheduling based on cpu/ram/disk, and not the old resource tracker records. Correct me if I\u0027m wrong)","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4636814abd6b46d200e1e4f34c35327dde14372d","unresolved":false,"context_lines":[{"line_number":494,"context_line":"                    cn.uuid,"},{"line_number":495,"context_line":"                    cn.hypervisor_hostname,"},{"line_number":496,"context_line":"                    inv_data,"},{"line_number":497,"context_line":"                )"},{"line_number":498,"context_line":"            except exception.InventoryInUse:"},{"line_number":499,"context_line":"                # The Ironic baremetal node had already been allocated to an"},{"line_number":500,"context_line":"                # instance and allocation records for VCPU, MEMORY_MB and"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_6025ff5a","line":497,"in_reply_to":"1a6eadb0_d0526b66","updated":"2016-12-19 14:15:59.000000000","message":"That is correct, Jim.","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"e55623c4532a2c473ffe758632e8196425b219e8","unresolved":false,"context_lines":[{"line_number":494,"context_line":"                    cn.uuid,"},{"line_number":495,"context_line":"                    cn.hypervisor_hostname,"},{"line_number":496,"context_line":"                    inv_data,"},{"line_number":497,"context_line":"                )"},{"line_number":498,"context_line":"            except exception.InventoryInUse:"},{"line_number":499,"context_line":"                # The Ironic baremetal node had already been allocated to an"},{"line_number":500,"context_line":"                # instance and allocation records for VCPU, MEMORY_MB and"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_d0526b66","line":497,"in_reply_to":"3a71b18c_2b754a97","updated":"2016-12-16 13:07:47.000000000","message":"So they will still be in nova\u0027s compute_nodes table, just not the placement engine\u0027s table?","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"42c2ad240b74f1fb461fdb3152a1a704360c167f","unresolved":false,"context_lines":[{"line_number":494,"context_line":"                    cn.uuid,"},{"line_number":495,"context_line":"                    cn.hypervisor_hostname,"},{"line_number":496,"context_line":"                    inv_data,"},{"line_number":497,"context_line":"                )"},{"line_number":498,"context_line":"            except exception.InventoryInUse:"},{"line_number":499,"context_line":"                # The Ironic baremetal node had already been allocated to an"},{"line_number":500,"context_line":"                # instance and allocation records for VCPU, MEMORY_MB and"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_2b754a97","line":497,"in_reply_to":"3a71b18c_9e003603","updated":"2016-12-09 23:13:41.000000000","message":"It will remove them, but placement won\u0027t be used for ironic node selection in Ocata. So the old flavors will still work with the scheduler.","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"42c2ad240b74f1fb461fdb3152a1a704360c167f","unresolved":false,"context_lines":[{"line_number":496,"context_line":"                    inv_data,"},{"line_number":497,"context_line":"                )"},{"line_number":498,"context_line":"            except exception.InventoryInUse:"},{"line_number":499,"context_line":"                # The Ironic baremetal node had already been allocated to an"},{"line_number":500,"context_line":"                # instance and allocation records for VCPU, MEMORY_MB and"},{"line_number":501,"context_line":"                # DISK_GB had been created against the resource provider. We"},{"line_number":502,"context_line":"                # need to delete those old allocation records, set the"},{"line_number":503,"context_line":"                # inventory for the resource provider to the new single custom"},{"line_number":504,"context_line":"                # resource class and then insert a single new allocation record"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_abe87ae3","line":501,"range":{"start_line":499,"start_character":16,"end_line":501,"end_character":73},"updated":"2016-12-09 23:13:41.000000000","message":"I\u0027m confused about this. I thought the \"old-style\" was the CN was the provider, and there were ironic allocations against its inventory. The \"new-style\" would have the CN have a bunch of child providers, one for each ironic node. So the RP with the old inventory would be the CN, and the RP with the new inventory is the child RP. Or did I pick the wrong day to stop smoking crack?","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4636814abd6b46d200e1e4f34c35327dde14372d","unresolved":false,"context_lines":[{"line_number":496,"context_line":"                    inv_data,"},{"line_number":497,"context_line":"                )"},{"line_number":498,"context_line":"            except exception.InventoryInUse:"},{"line_number":499,"context_line":"                # The Ironic baremetal node had already been allocated to an"},{"line_number":500,"context_line":"                # instance and allocation records for VCPU, MEMORY_MB and"},{"line_number":501,"context_line":"                # DISK_GB had been created against the resource provider. We"},{"line_number":502,"context_line":"                # need to delete those old allocation records, set the"},{"line_number":503,"context_line":"                # inventory for the resource provider to the new single custom"},{"line_number":504,"context_line":"                # resource class and then insert a single new allocation record"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_a0cd5788","line":501,"range":{"start_line":499,"start_character":16,"end_line":501,"end_character":73},"in_reply_to":"3a71b18c_abe87ae3","updated":"2016-12-19 14:15:59.000000000","message":"Yes, as discussed last week on IRC, you did indeed pick the wrong day to stop smoking crack.","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"4c9e5b1e2a0e60c261b9b6bf52523185793b6e69","unresolved":false,"context_lines":[{"line_number":552,"context_line":"                \u0027nodename\u0027: cn.hypervisor_hostname,"},{"line_number":553,"context_line":"                \u0027num_instances\u0027: len(inst_list),"},{"line_number":554,"context_line":"            }"},{"line_number":555,"context_line":"            LOG.warning(msg % msg_args)"},{"line_number":556,"context_line":"            return"},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"        # OK, first things first, let\u0027s remove the old allocation records for"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_631e65bc","line":555,"updated":"2016-12-05 20:52:23.000000000","message":"Do we want to log the instance UUIDs, to give the operator more info to take action with?","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"42c2ad240b74f1fb461fdb3152a1a704360c167f","unresolved":false,"context_lines":[{"line_number":552,"context_line":"                \u0027nodename\u0027: cn.hypervisor_hostname,"},{"line_number":553,"context_line":"                \u0027num_instances\u0027: len(inst_list),"},{"line_number":554,"context_line":"            }"},{"line_number":555,"context_line":"            LOG.warning(msg % msg_args)"},{"line_number":556,"context_line":"            return"},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"        # OK, first things first, let\u0027s remove the old allocation records for"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_399be319","line":555,"range":{"start_line":555,"start_character":28,"end_line":555,"end_character":29},"updated":"2016-12-09 23:13:41.000000000","message":"should be a comma","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"4636814abd6b46d200e1e4f34c35327dde14372d","unresolved":false,"context_lines":[{"line_number":552,"context_line":"                \u0027nodename\u0027: cn.hypervisor_hostname,"},{"line_number":553,"context_line":"                \u0027num_instances\u0027: len(inst_list),"},{"line_number":554,"context_line":"            }"},{"line_number":555,"context_line":"            LOG.warning(msg % msg_args)"},{"line_number":556,"context_line":"            return"},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"        # OK, first things first, let\u0027s remove the old allocation records for"}],"source_content_type":"text/x-python","patch_set":4,"id":"1a6eadb0_60aa5f87","line":555,"in_reply_to":"3a71b18c_631e65bc","updated":"2016-12-19 14:15:59.000000000","message":"Done","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"4c9e5b1e2a0e60c261b9b6bf52523185793b6e69","unresolved":false,"context_lines":[{"line_number":556,"context_line":"            return"},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"        # OK, first things first, let\u0027s remove the old allocation records for"},{"line_number":559,"context_line":"        # VCPU, MEMORY_MB, DISK_GB, etc."},{"line_number":560,"context_line":"        inst \u003d inst_list[0]"},{"line_number":561,"context_line":"        self.scheduler_client.update_instance_allocation(cn, inst, -1)"},{"line_number":562,"context_line":"        msg \u003d _LI("}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_7e46fa4f","line":559,"updated":"2016-12-05 20:52:23.000000000","message":"Obvious ditto here re: old flavors","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"4c9e5b1e2a0e60c261b9b6bf52523185793b6e69","unresolved":false,"context_lines":[{"line_number":563,"context_line":"            \"Cleaning up old-style Ironic baremetal allocation records. \""},{"line_number":564,"context_line":"            \"Successfully deleted old allocations for baremetal node \""},{"line_number":565,"context_line":"            \"%(nodename)s against resource provider %(resource_provider)s.\""},{"line_number":566,"context_line":"        )"},{"line_number":567,"context_line":"        msg_args \u003d {"},{"line_number":568,"context_line":"            \u0027nodename\u0027: cn.hypervisor_hostname,"},{"line_number":569,"context_line":"            \u0027resource_provider\u0027: cn.uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_9e4e766d","line":566,"updated":"2016-12-05 20:52:23.000000000","message":"Is there a race here where something could get scheduled between delete and re-create?","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"42c2ad240b74f1fb461fdb3152a1a704360c167f","unresolved":false,"context_lines":[{"line_number":563,"context_line":"            \"Cleaning up old-style Ironic baremetal allocation records. \""},{"line_number":564,"context_line":"            \"Successfully deleted old allocations for baremetal node \""},{"line_number":565,"context_line":"            \"%(nodename)s against resource provider %(resource_provider)s.\""},{"line_number":566,"context_line":"        )"},{"line_number":567,"context_line":"        msg_args \u003d {"},{"line_number":568,"context_line":"            \u0027nodename\u0027: cn.hypervisor_hostname,"},{"line_number":569,"context_line":"            \u0027resource_provider\u0027: cn.uuid,"}],"source_content_type":"text/x-python","patch_set":4,"id":"3a71b18c_4befe61d","line":566,"in_reply_to":"3a71b18c_9e4e766d","updated":"2016-12-09 23:13:41.000000000","message":"I think it would be cleaner to have a single call that sets the RP\u0027s inventory, cleaning up any existing old allocation records. When the transition is complete, we can drop that cleanup portion.","commit_id":"5a144427388a25253e7c2ab719cb22229fd3c1c5"},{"author":{"_account_id":17920,"name":"Jianghua Wang","email":"jianghua.wang@citrix.com","username":"wjhfresh"},"change_message_id":"122e53d43226f2215b495639aeda543cc1ab5a49","unresolved":false,"context_lines":[{"line_number":474,"context_line":"        :param resources: Result of the virt driver\u0027s get_available_resource()"},{"line_number":475,"context_line":"                          call."},{"line_number":476,"context_line":"        \"\"\""},{"line_number":477,"context_line":"        if self._is_ironic():"},{"line_number":478,"context_line":"            bm_node_class \u003d resources[\u0027resource_class\u0027]"},{"line_number":479,"context_line":"            # NOTE(jaypipes): Ironic baremetal node resource providers only"},{"line_number":480,"context_line":"            # ever have a single inventory record, of quantity 1 of the"}],"source_content_type":"text/x-python","patch_set":7,"id":"1a6eadb0_597f9565","line":477,"updated":"2016-12-15 15:20:10.000000000","message":"Jay, could we define a common function at here for driver to report inventory data to resource tracker? It should be helpful to report inventory data automatically. E.g. VGPU belong to a compute node but different hypervisors may have different definition for it. Then we can use custom class resource to define the amount of VGPU. But absolutely it will be much easier for cloud administrators if we allow driver to report report automatically.\nIf we can do that, we can make Ironic driver to report the inv_data in resources dict. Here in resource_tracker check if the resource dict contains custom resource and set provider inventory accordingly.\nThanks.","commit_id":"b34f2b790dcb1b0415c450df8d7d68e4c9e609cb"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"d588199b4816064a821270db86bc02d4bb2e19f1","unresolved":false,"context_lines":[{"line_number":507,"context_line":"        :param resources: Result of the virt driver\u0027s get_available_resource()"},{"line_number":508,"context_line":"                          call."},{"line_number":509,"context_line":"        \"\"\""},{"line_number":510,"context_line":"        # NOTE(jaypipes): Until Pike, the nova.resource_class attribute in"},{"line_number":511,"context_line":"        # the Ironic API is not required to be set (though the attribute"},{"line_number":512,"context_line":"        # will be in the returned node JSON dict). If the value of the"},{"line_number":513,"context_line":"        # attribute is None, we simply default things to the \"old\""}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_bb7efd67","line":510,"range":{"start_line":510,"start_character":42,"end_line":510,"end_character":46},"updated":"2016-12-21 12:05:52.000000000","message":"node","commit_id":"584d3ef6c9fa54039999c9ef0be40c59e6a1681c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"280297d35f0236cae797522de40e03993ab32b09","unresolved":false,"context_lines":[{"line_number":507,"context_line":"        :param resources: Result of the virt driver\u0027s get_available_resource()"},{"line_number":508,"context_line":"                          call."},{"line_number":509,"context_line":"        \"\"\""},{"line_number":510,"context_line":"        # NOTE(jaypipes): Until Pike, the nova.resource_class attribute in"},{"line_number":511,"context_line":"        # the Ironic API is not required to be set (though the attribute"},{"line_number":512,"context_line":"        # will be in the returned node JSON dict). If the value of the"},{"line_number":513,"context_line":"        # attribute is None, we simply default things to the \"old\""}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_e6f4485c","line":510,"range":{"start_line":510,"start_character":42,"end_line":510,"end_character":46},"in_reply_to":"1a6eadb0_bb7efd67","updated":"2016-12-27 17:22:35.000000000","message":"Done","commit_id":"584d3ef6c9fa54039999c9ef0be40c59e6a1681c"},{"author":{"_account_id":13692,"name":"Roman Dobosz","email":"gryf73@gmail.com","username":"gryf"},"change_message_id":"c95c42a7a0166069bd5180771907c0c35e4a32c4","unresolved":false,"context_lines":[{"line_number":514,"context_line":"        # behaviour of using VCPU, MEMORY_MB and DISK_GB resources."},{"line_number":515,"context_line":"        bm_node_class \u003d resources.get(\u0027resource_class\u0027)"},{"line_number":516,"context_line":"        bm_node_class \u003d self._ensure_ironic_node_class(bm_node_class)"},{"line_number":517,"context_line":"        if not self._is_ironic() or bm_node_class is None:"},{"line_number":518,"context_line":"            self.scheduler_client.update_resource_stats(cn)"},{"line_number":519,"context_line":"        else:"},{"line_number":520,"context_line":"            # NOTE(jaypipes): Ironic baremetal node resource providers only"},{"line_number":521,"context_line":"            # ever have a single inventory record, of quantity 1 of the"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_78ae7099","line":518,"range":{"start_line":517,"start_character":8,"end_line":518,"end_character":59},"updated":"2016-12-20 10:53:20.000000000","message":"How about return quickly from the function in this branch and have all the ironic things below one indent less?","commit_id":"584d3ef6c9fa54039999c9ef0be40c59e6a1681c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"280297d35f0236cae797522de40e03993ab32b09","unresolved":false,"context_lines":[{"line_number":514,"context_line":"        # behaviour of using VCPU, MEMORY_MB and DISK_GB resources."},{"line_number":515,"context_line":"        bm_node_class \u003d resources.get(\u0027resource_class\u0027)"},{"line_number":516,"context_line":"        bm_node_class \u003d self._ensure_ironic_node_class(bm_node_class)"},{"line_number":517,"context_line":"        if not self._is_ironic() or bm_node_class is None:"},{"line_number":518,"context_line":"            self.scheduler_client.update_resource_stats(cn)"},{"line_number":519,"context_line":"        else:"},{"line_number":520,"context_line":"            # NOTE(jaypipes): Ironic baremetal node resource providers only"},{"line_number":521,"context_line":"            # ever have a single inventory record, of quantity 1 of the"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_06e6acaf","line":518,"range":{"start_line":517,"start_character":8,"end_line":518,"end_character":59},"in_reply_to":"1a6eadb0_78ae7099","updated":"2016-12-27 17:22:35.000000000","message":"Done","commit_id":"584d3ef6c9fa54039999c9ef0be40c59e6a1681c"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"d588199b4816064a821270db86bc02d4bb2e19f1","unresolved":false,"context_lines":[{"line_number":555,"context_line":"        single inventory record with a resource class equal to the Ironic"},{"line_number":556,"context_line":"        node\u0027s resource_class attribute."},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"        :param cn: ComputeNode object representing the Ironic baremetal node."},{"line_number":559,"context_line":"        :param inv_data: The dict, keyed by the Ironic node resource class, of"},{"line_number":560,"context_line":"                         inventory information to be added to placement API,"},{"line_number":561,"context_line":"                         replacing the old-style inventory records for VCPU,"}],"source_content_type":"text/x-python","patch_set":9,"id":"1a6eadb0_9bda214a","line":558,"updated":"2016-12-21 12:05:52.000000000","message":"After reading discussion on PS4, the inventory gets set to the compute node, not to a resource provider representing a single ironic node.\n\nIs this going to happen only during the transition period where the old-style resources are in compute node, and then inventory will be reassociated with actual ironic nodes\u0027 resource providers?","commit_id":"584d3ef6c9fa54039999c9ef0be40c59e6a1681c"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"280297d35f0236cae797522de40e03993ab32b09","unresolved":false,"context_lines":[{"line_number":555,"context_line":"        single inventory record with a resource class equal to the Ironic"},{"line_number":556,"context_line":"        node\u0027s resource_class attribute."},{"line_number":557,"context_line":""},{"line_number":558,"context_line":"        :param cn: ComputeNode object representing the Ironic baremetal node."},{"line_number":559,"context_line":"        :param inv_data: The dict, keyed by the Ironic node resource class, of"},{"line_number":560,"context_line":"                         inventory information to be added to placement API,"},{"line_number":561,"context_line":"                         replacing the old-style inventory records for VCPU,"}],"source_content_type":"text/x-python","patch_set":9,"id":"da4df55a_069dcc09","line":558,"in_reply_to":"1a6eadb0_9bda214a","updated":"2016-12-27 17:22:35.000000000","message":"@vdrok: No, the inventory is indeed set to a resource provider representing the single Ironic node. The \"legacy\" that we refer to here is the behaviour of setting inventory records for VCPU, MEMORY_MB, and DISK_GB for Ironic nodes. The new-style \"non-legacy\" behaviour is to have a single inventory record with the resource class set to the node.resource_class and remove the old inventory records for VCPU, MEMORY_MB and DISK_GB.","commit_id":"584d3ef6c9fa54039999c9ef0be40c59e6a1681c"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"17cd01b50ccfa194c1c6da043497abc2a2887ecd","unresolved":false,"context_lines":[{"line_number":626,"context_line":"                \"Successfully set inventory for %(resource_class)s on \""},{"line_number":627,"context_line":"                \"baremetal node %(nodename)s against resource provider \""},{"line_number":628,"context_line":"                \"%(resource_provider)s.\""},{"line_number":629,"context_line":"            )"},{"line_number":630,"context_line":"            msg_args \u003d {"},{"line_number":631,"context_line":"                \u0027resource_class\u0027: bm_resource_class,"},{"line_number":632,"context_line":"                \u0027nodename\u0027: cn.hypervisor_hostname,"}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5201f7_1d9c66bf","line":629,"updated":"2017-01-04 15:13:32.000000000","message":"I feel like I\u0027m reading C code. :)","commit_id":"6e8c43e3fd75a67ddca96815fa1c7e82d93e0f92"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"0859b5c74e8a9430e054ec29cb844a52a99392a3","unresolved":false,"context_lines":[{"line_number":490,"context_line":"            # We do this to avoid the need for the deployer to set up custom"},{"line_number":491,"context_line":"            # resource classes in \u003e1 place (they have already set the resource"},{"line_number":492,"context_line":"            # class in their Ironic nodes)."},{"line_number":493,"context_line":"            self.scheduler_client.get_or_create_resource_class(bm_node_class)"},{"line_number":494,"context_line":"            return bm_node_class"},{"line_number":495,"context_line":"        except exception.InvalidResourceClass:"},{"line_number":496,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a3c09a3_077decb0","line":493,"updated":"2017-01-16 20:20:24.000000000","message":"Please correct me if I\u0027m wrong but:\n\nThere\u0027s a chance that this method can return None after logging an exception from an unexpected response from the placement api. At which point this method will continue, returning bm_node_class, even when it hasn\u0027t been created on the server.\n\nAt which point, when the rest of _placement_set_inventory is called, it will try to do a PUT inventory which will then fail.\n\nShould this fail sooner, log more, retry better?","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"c6f5ccc5409fb304739fe5b6a3d10a621e368e33","unresolved":false,"context_lines":[{"line_number":490,"context_line":"            # We do this to avoid the need for the deployer to set up custom"},{"line_number":491,"context_line":"            # resource classes in \u003e1 place (they have already set the resource"},{"line_number":492,"context_line":"            # class in their Ironic nodes)."},{"line_number":493,"context_line":"            self.scheduler_client.get_or_create_resource_class(bm_node_class)"},{"line_number":494,"context_line":"            return bm_node_class"},{"line_number":495,"context_line":"        except exception.InvalidResourceClass:"},{"line_number":496,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a3905b3_661610a9","line":493,"in_reply_to":"5a3905b3_61aff02b","updated":"2017-01-25 10:53:35.000000000","message":"get_or_create_resource_class does not obviously raise exceptions when receiving unexpected status codes, it logs them and returns None. It handles 404, in which case it tries to create and if it can\u0027t raises InvalidResourceClass\n\nIf there\u0027s something else, perhaps as a result of a proxy being weird in the middle, or timeouts, or any of a variety of unexpected things, it returns None, has no exception, and the bm_node_class will be returned. Which is fake news, yeah?","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"3a4659bd9bb791bb3a07a5d1c70a962c196be4f2","unresolved":false,"context_lines":[{"line_number":490,"context_line":"            # We do this to avoid the need for the deployer to set up custom"},{"line_number":491,"context_line":"            # resource classes in \u003e1 place (they have already set the resource"},{"line_number":492,"context_line":"            # class in their Ironic nodes)."},{"line_number":493,"context_line":"            self.scheduler_client.get_or_create_resource_class(bm_node_class)"},{"line_number":494,"context_line":"            return bm_node_class"},{"line_number":495,"context_line":"        except exception.InvalidResourceClass:"},{"line_number":496,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":17,"id":"3a461143_0c490c8c","line":493,"in_reply_to":"5a3905b3_661610a9","updated":"2017-01-25 16:45:07.000000000","message":"Ah, ok, that\u0027s clearer. Let me address that.","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9376590a99de1343adbc017d18b0a53ff3ed1daf","unresolved":false,"context_lines":[{"line_number":490,"context_line":"            # We do this to avoid the need for the deployer to set up custom"},{"line_number":491,"context_line":"            # resource classes in \u003e1 place (they have already set the resource"},{"line_number":492,"context_line":"            # class in their Ironic nodes)."},{"line_number":493,"context_line":"            self.scheduler_client.get_or_create_resource_class(bm_node_class)"},{"line_number":494,"context_line":"            return bm_node_class"},{"line_number":495,"context_line":"        except exception.InvalidResourceClass:"},{"line_number":496,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a3905b3_61aff02b","line":493,"in_reply_to":"7a3c09a3_077decb0","updated":"2017-01-25 00:05:50.000000000","message":"I don\u0027t think that that\u0027s possible. The possibilities are a) the class already exists, which is fine; b) the class was created, also fine; c) the creation caused an exception, which is caught below. So I think this is ok.","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"e939d9771ee0d488de1eb292e2bb61a3df59e69b","unresolved":false,"context_lines":[{"line_number":490,"context_line":"            # We do this to avoid the need for the deployer to set up custom"},{"line_number":491,"context_line":"            # resource classes in \u003e1 place (they have already set the resource"},{"line_number":492,"context_line":"            # class in their Ironic nodes)."},{"line_number":493,"context_line":"            self.scheduler_client.get_or_create_resource_class(bm_node_class)"},{"line_number":494,"context_line":"            return bm_node_class"},{"line_number":495,"context_line":"        except exception.InvalidResourceClass:"},{"line_number":496,"context_line":"            return None"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a3905b3_e88801ea","line":493,"in_reply_to":"7a3c09a3_077decb0","updated":"2017-01-25 00:03:36.000000000","message":"I don\u0027t think that that\u0027s possible. The possibilities are a) the class already exists, which is fine; b) the class was created, also fine; c) the creation caused an exception, which is caught below. So I think this is ok.","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"8bf618fd1d947fb0b3ea537c20c15d076ce2d889","unresolved":false,"context_lines":[{"line_number":521,"context_line":""},{"line_number":522,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"},{"line_number":523,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"},{"line_number":524,"context_line":"        # indicated for the node."},{"line_number":525,"context_line":"        inv_data \u003d {"},{"line_number":526,"context_line":"            bm_node_class: {"},{"line_number":527,"context_line":"                \u0027total\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":17,"id":"7a3c09a3_47bc06bb","line":524,"updated":"2017-01-18 03:49:51.000000000","message":"If we have multiple nodes with same resource class which from same compute node, we only can see one node? I feel I miss something, forgive me if I ask stupid question.","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"d0699fa93e6d4f6ffd8a38ba3ca7367f77da1c88","unresolved":false,"context_lines":[{"line_number":521,"context_line":""},{"line_number":522,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"},{"line_number":523,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"},{"line_number":524,"context_line":"        # indicated for the node."},{"line_number":525,"context_line":"        inv_data \u003d {"},{"line_number":526,"context_line":"            bm_node_class: {"},{"line_number":527,"context_line":"                \u0027total\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a3905b3_133599f6","line":524,"in_reply_to":"5a3905b3_81acdc36","updated":"2017-01-25 06:55:30.000000000","message":"@Ed, thanks, I see now. I forget the point there will be different rp for different ironic node.","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"e939d9771ee0d488de1eb292e2bb61a3df59e69b","unresolved":false,"context_lines":[{"line_number":521,"context_line":""},{"line_number":522,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"},{"line_number":523,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"},{"line_number":524,"context_line":"        # indicated for the node."},{"line_number":525,"context_line":"        inv_data \u003d {"},{"line_number":526,"context_line":"            bm_node_class: {"},{"line_number":527,"context_line":"                \u0027total\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a3905b3_6ebc196d","line":524,"in_reply_to":"7a3c09a3_47bc06bb","updated":"2017-01-25 00:03:36.000000000","message":"The node is the resource provider, and so yes, it will always only have one class, and one unit of that class. Yes, there will be other machines of the same class, but they will be distinct nodes, and thus different resource providers.","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"9376590a99de1343adbc017d18b0a53ff3ed1daf","unresolved":false,"context_lines":[{"line_number":521,"context_line":""},{"line_number":522,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"},{"line_number":523,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"},{"line_number":524,"context_line":"        # indicated for the node."},{"line_number":525,"context_line":"        inv_data \u003d {"},{"line_number":526,"context_line":"            bm_node_class: {"},{"line_number":527,"context_line":"                \u0027total\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":17,"id":"5a3905b3_81acdc36","line":524,"in_reply_to":"7a3c09a3_47bc06bb","updated":"2017-01-25 00:05:50.000000000","message":"The node is the resource provider, and so yes, it will always only have one class, and one unit of that class. Yes, there will be other machines of the same class, but they will be distinct nodes, and thus different resource providers.","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":466,"context_line":"        self._placement_set_inventory(cn, resources)"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"    def _is_ironic(self):"},{"line_number":469,"context_line":"        return isinstance(self.driver, ironic_driver.IronicDriver)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def _ensure_ironic_node_class(self, bm_node_class):"},{"line_number":472,"context_line":"        \"\"\"Given an Ironic node resource class, first normalize the node class"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_4a0d7f3d","line":469,"updated":"2017-01-26 16:41:27.000000000","message":"Rather than import the Ironic driver code for this check, couldn\u0027t we just check that the hypervisor_type in the compute node (or resources) is \u0027ironic\u0027? We already have that info.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e9054ea4b240de0172a5fec41439909b2f08e02","unresolved":false,"context_lines":[{"line_number":466,"context_line":"        self._placement_set_inventory(cn, resources)"},{"line_number":467,"context_line":""},{"line_number":468,"context_line":"    def _is_ironic(self):"},{"line_number":469,"context_line":"        return isinstance(self.driver, ironic_driver.IronicDriver)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":"    def _ensure_ironic_node_class(self, bm_node_class):"},{"line_number":472,"context_line":"        \"\"\"Given an Ironic node resource class, first normalize the node class"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_f3a462ba","line":469,"in_reply_to":"3a461143_4a0d7f3d","updated":"2017-01-26 18:12:55.000000000","message":"Yeah, good catch.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":482,"context_line":"            return None"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"        bm_node_class \u003d bm_node_class.upper()"},{"line_number":485,"context_line":"        if not bm_node_class.startswith(\u0027CUSTOM_\u0027):"},{"line_number":486,"context_line":"            bm_node_class \u003d \u0027CUSTOM_\u0027 + bm_node_class"},{"line_number":487,"context_line":"        try:"},{"line_number":488,"context_line":"            # NOTE(jaypipes): Here, we auto-create the Ironic bare-metal"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_cd2c294d","line":485,"range":{"start_line":485,"start_character":41,"end_line":485,"end_character":48},"updated":"2017-01-26 16:41:27.000000000","message":"nit: for later cleanup, but we could re-use the ResourceClass.CUSTOM_NAMESPACE constant here.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e9054ea4b240de0172a5fec41439909b2f08e02","unresolved":false,"context_lines":[{"line_number":482,"context_line":"            return None"},{"line_number":483,"context_line":""},{"line_number":484,"context_line":"        bm_node_class \u003d bm_node_class.upper()"},{"line_number":485,"context_line":"        if not bm_node_class.startswith(\u0027CUSTOM_\u0027):"},{"line_number":486,"context_line":"            bm_node_class \u003d \u0027CUSTOM_\u0027 + bm_node_class"},{"line_number":487,"context_line":"        try:"},{"line_number":488,"context_line":"            # NOTE(jaypipes): Here, we auto-create the Ironic bare-metal"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_996dff9a","line":485,"range":{"start_line":485,"start_character":41,"end_line":485,"end_character":48},"in_reply_to":"3a461143_cd2c294d","updated":"2017-01-26 18:12:55.000000000","message":"Done","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        API client) to set inventory records for a compute node or an Ironic"},{"line_number":505,"context_line":"        baremetal node, depending on whether the virt driver is Ironic."},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"        If the virt driver is Ironic, we set the inventory manually to the"},{"line_number":508,"context_line":"        value of the resource_class attribute that the Ironic API returned from"},{"line_number":509,"context_line":"        the driver\u0027s get_available_resource() call (the resources param)."},{"line_number":510,"context_line":""},{"line_number":511,"context_line":"        :param cn: ComputeNode object"},{"line_number":512,"context_line":"        :param resources: Result of the virt driver\u0027s get_available_resource()"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_6dc0957d","line":509,"range":{"start_line":507,"start_character":8,"end_line":509,"end_character":73},"updated":"2017-01-26 16:41:27.000000000","message":"In general, and this is something not to deal with here on the day of Ocata FF, but I\u0027d rather abstract this out of the ResourceTracker that we use for all virt drivers and subclass it into an IronicResourceTracker which overrides the behavior needed for the special Ironic snowflake case, but is just a bare-bones call to self.scheduler_client.update_resource_stats(cn) for everything else. That would be a cleaner interface for me, but again, not something to do with right now.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e9054ea4b240de0172a5fec41439909b2f08e02","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        API client) to set inventory records for a compute node or an Ironic"},{"line_number":505,"context_line":"        baremetal node, depending on whether the virt driver is Ironic."},{"line_number":506,"context_line":""},{"line_number":507,"context_line":"        If the virt driver is Ironic, we set the inventory manually to the"},{"line_number":508,"context_line":"        value of the resource_class attribute that the Ironic API returned from"},{"line_number":509,"context_line":"        the driver\u0027s get_available_resource() call (the resources param)."},{"line_number":510,"context_line":""},{"line_number":511,"context_line":"        :param cn: ComputeNode object"},{"line_number":512,"context_line":"        :param resources: Result of the virt driver\u0027s get_available_resource()"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_39132b0f","line":509,"range":{"start_line":507,"start_character":8,"end_line":509,"end_character":73},"in_reply_to":"3a461143_6dc0957d","updated":"2017-01-26 18:12:55.000000000","message":"Agreed - that would be too disruptive now.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":512,"context_line":"        :param resources: Result of the virt driver\u0027s get_available_resource()"},{"line_number":513,"context_line":"                          call."},{"line_number":514,"context_line":"        \"\"\""},{"line_number":515,"context_line":"        # NOTE(jaypipes): Until Pike, the nova.resource_class attribute in"},{"line_number":516,"context_line":"        # the Ironic API is not required to be set (though the attribute"},{"line_number":517,"context_line":"        # will be in the returned node JSON dict). If the value of the"},{"line_number":518,"context_line":"        # attribute is None, we simply default things to the \"old\""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_ed29e58a","line":515,"range":{"start_line":515,"start_character":42,"end_line":515,"end_character":46},"updated":"2017-01-26 16:41:27.000000000","message":"node","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e9054ea4b240de0172a5fec41439909b2f08e02","unresolved":false,"context_lines":[{"line_number":512,"context_line":"        :param resources: Result of the virt driver\u0027s get_available_resource()"},{"line_number":513,"context_line":"                          call."},{"line_number":514,"context_line":"        \"\"\""},{"line_number":515,"context_line":"        # NOTE(jaypipes): Until Pike, the nova.resource_class attribute in"},{"line_number":516,"context_line":"        # the Ironic API is not required to be set (though the attribute"},{"line_number":517,"context_line":"        # will be in the returned node JSON dict). If the value of the"},{"line_number":518,"context_line":"        # attribute is None, we simply default things to the \"old\""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_59fab7be","line":515,"range":{"start_line":515,"start_character":42,"end_line":515,"end_character":46},"in_reply_to":"3a461143_ed29e58a","updated":"2017-01-26 18:12:55.000000000","message":"Done","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":517,"context_line":"        # will be in the returned node JSON dict). If the value of the"},{"line_number":518,"context_line":"        # attribute is None, we simply default things to the \"old\""},{"line_number":519,"context_line":"        # behaviour of using VCPU, MEMORY_MB and DISK_GB resources."},{"line_number":520,"context_line":"        bm_node_class \u003d resources.get(\u0027resource_class\u0027)"},{"line_number":521,"context_line":"        bm_node_class \u003d self._ensure_ironic_node_class(bm_node_class)"},{"line_number":522,"context_line":"        if not self._is_ironic() or bm_node_class is None:"},{"line_number":523,"context_line":"            self.scheduler_client.update_resource_stats(cn)"},{"line_number":524,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_6d9255a1","line":521,"range":{"start_line":520,"start_character":8,"end_line":521,"end_character":69},"updated":"2017-01-26 16:41:27.000000000","message":"I think I\u0027d rather do this stuff within an _is_ironic() check. This is OK the way it is since it handles non-Ironic, it\u0027s just sort of odd logic for me.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":10342,"name":"Jay Faulkner","display_name":"JayF","email":"jay@jvf.cc","username":"JayF","status":"youtube.com/@oss-gr / podcast.gr-oss.io"},"change_message_id":"572d7ad240155bcab7afe2e555ebb935c2f570de","unresolved":false,"context_lines":[{"line_number":478,"context_line":"            return None"},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"        bm_node_class \u003d bm_node_class.upper()"},{"line_number":481,"context_line":"        cust_prfx \u003d objects.ResourceClass.CUSTOM_NAMESPACE"},{"line_number":482,"context_line":"        if not bm_node_class.startswith(cust_prfx):"},{"line_number":483,"context_line":"            bm_node_class \u003d cust_prfx + bm_node_class"},{"line_number":484,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_40f9c97f","line":481,"updated":"2017-01-27 01:06:41.000000000","message":"I\u0027m curious if we need to do similar validation to this in Ironic, to prevent someone accidentally creating matching resource classes (i.e. SuperNode and SUPERNODE are equivalent). Today ironic appears to store and return the value without any normalization.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"1afe65e58544a8ada79542bf6dd73af3aace81a5","unresolved":false,"context_lines":[{"line_number":478,"context_line":"            return None"},{"line_number":479,"context_line":""},{"line_number":480,"context_line":"        bm_node_class \u003d bm_node_class.upper()"},{"line_number":481,"context_line":"        cust_prfx \u003d objects.ResourceClass.CUSTOM_NAMESPACE"},{"line_number":482,"context_line":"        if not bm_node_class.startswith(cust_prfx):"},{"line_number":483,"context_line":"            bm_node_class \u003d cust_prfx + bm_node_class"},{"line_number":484,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_56926fa0","line":481,"in_reply_to":"3a461143_40f9c97f","updated":"2017-01-27 01:51:53.000000000","message":"Probably wouldn\u0027t be a bad idea. But if SuperNode and SUPERNODE are treated as the same in Ironic, they\u0027ll be treated the same when it comes to ResourceClasses, too.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bd450e5d2024d25c29881726cc1ba4c0556089f","unresolved":false,"context_lines":[{"line_number":547,"context_line":"            # provider to the new single custom resource class and then insert"},{"line_number":548,"context_line":"            # a single new allocation record that consumes the entire"},{"line_number":549,"context_line":"            # inventory."},{"line_number":550,"context_line":"            self._cleanup_ironic_legacy_allocations(cn, inv_data)"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"    # TODO(jaypipes): Remove at end of Pike when all old-style Ironic"},{"line_number":553,"context_line":"    # allocation records will have been replaced with the new allocation"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_2a73c1e8","line":550,"updated":"2017-01-26 22:24:46.000000000","message":"Do we test this case?","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8f47206bab1c47ad8a3838f9099c94a380e7b603","unresolved":false,"context_lines":[{"line_number":547,"context_line":"            # provider to the new single custom resource class and then insert"},{"line_number":548,"context_line":"            # a single new allocation record that consumes the entire"},{"line_number":549,"context_line":"            # inventory."},{"line_number":550,"context_line":"            self._cleanup_ironic_legacy_allocations(cn, inv_data)"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"    # TODO(jaypipes): Remove at end of Pike when all old-style Ironic"},{"line_number":553,"context_line":"    # allocation records will have been replaced with the new allocation"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_102632ce","line":550,"in_reply_to":"3a461143_2a73c1e8","updated":"2017-01-27 01:43:39.000000000","message":"Done","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bd450e5d2024d25c29881726cc1ba4c0556089f","unresolved":false,"context_lines":[{"line_number":552,"context_line":"    # TODO(jaypipes): Remove at end of Pike when all old-style Ironic"},{"line_number":553,"context_line":"    # allocation records will have been replaced with the new allocation"},{"line_number":554,"context_line":"    # records for the Ironic node resource_class."},{"line_number":555,"context_line":"    def _cleanup_ironic_legacy_allocations(self, cn, inv_data):"},{"line_number":556,"context_line":"        \"\"\"Helper method that corrects old-style legacy allocations for an"},{"line_number":557,"context_line":"        Ironic baremetal node resource provider to the newer style with only a"},{"line_number":558,"context_line":"        single inventory record with a resource class equal to the Ironic"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_0a78c5c3","line":555,"updated":"2017-01-26 22:24:46.000000000","message":"Do we test any of this method?","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8f47206bab1c47ad8a3838f9099c94a380e7b603","unresolved":false,"context_lines":[{"line_number":552,"context_line":"    # TODO(jaypipes): Remove at end of Pike when all old-style Ironic"},{"line_number":553,"context_line":"    # allocation records will have been replaced with the new allocation"},{"line_number":554,"context_line":"    # records for the Ironic node resource_class."},{"line_number":555,"context_line":"    def _cleanup_ironic_legacy_allocations(self, cn, inv_data):"},{"line_number":556,"context_line":"        \"\"\"Helper method that corrects old-style legacy allocations for an"},{"line_number":557,"context_line":"        Ironic baremetal node resource provider to the newer style with only a"},{"line_number":558,"context_line":"        single inventory record with a resource class equal to the Ironic"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_eb38db3f","line":555,"in_reply_to":"3a461143_0a78c5c3","updated":"2017-01-27 01:43:39.000000000","message":"I added tests to make sure all the main parts are covered.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bd450e5d2024d25c29881726cc1ba4c0556089f","unresolved":false,"context_lines":[{"line_number":664,"context_line":"        )"},{"line_number":665,"context_line":"        msg \u003d _LI("},{"line_number":666,"context_line":"            \"Cleaning up old-style Ironic baremetal allocation records. \""},{"line_number":667,"context_line":"            \"Successfully created new allocation record for \""},{"line_number":668,"context_line":"            \"%(resource_class)s on baremetal node %(nodename)s against \""},{"line_number":669,"context_line":"            \"resource provider %(resource_provider)s.\""},{"line_number":670,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_6a194979","line":667,"range":{"start_line":667,"start_character":38,"end_line":667,"end_character":48},"updated":"2017-01-26 22:24:46.000000000","message":"nit: could include the consumer uuid (instance.uuid) in this message too.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8f47206bab1c47ad8a3838f9099c94a380e7b603","unresolved":false,"context_lines":[{"line_number":664,"context_line":"        )"},{"line_number":665,"context_line":"        msg \u003d _LI("},{"line_number":666,"context_line":"            \"Cleaning up old-style Ironic baremetal allocation records. \""},{"line_number":667,"context_line":"            \"Successfully created new allocation record for \""},{"line_number":668,"context_line":"            \"%(resource_class)s on baremetal node %(nodename)s against \""},{"line_number":669,"context_line":"            \"resource provider %(resource_provider)s.\""},{"line_number":670,"context_line":"        )"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_ab1b337f","line":667,"range":{"start_line":667,"start_character":38,"end_line":667,"end_character":48},"in_reply_to":"3a461143_6a194979","updated":"2017-01-27 01:43:39.000000000","message":"Done","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"a6d0cb6483b9cd0ee9e0b38eb0e322a4ad504aaa","unresolved":false,"context_lines":[{"line_number":521,"context_line":"        # attribute is None, we simply default things to the \"old\""},{"line_number":522,"context_line":"        # behaviour of using VCPU, MEMORY_MB and DISK_GB resources."},{"line_number":523,"context_line":"        bm_node_class \u003d resources.get(\u0027resource_class\u0027)"},{"line_number":524,"context_line":"        bm_node_class \u003d self._ensure_ironic_node_class(bm_node_class)"},{"line_number":525,"context_line":"        if cn.hypervisor_type !\u003d \u0027ironic\u0027 or bm_node_class is None:"},{"line_number":526,"context_line":"            self.scheduler_client.update_resource_stats(cn)"},{"line_number":527,"context_line":"            return"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_f4698126","line":524,"updated":"2017-01-27 14:51:45.000000000","message":"Nit: if we get a badly named resource class (not sure how), we keep failing on every loop. But that seems like an edge case.","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"cc3560b8ce704abb6f33d09df7ce3847e56fc6cc","unresolved":false,"context_lines":[{"line_number":529,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"},{"line_number":530,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"},{"line_number":531,"context_line":"        # indicated for the node."},{"line_number":532,"context_line":"        inv_data \u003d {"},{"line_number":533,"context_line":"            bm_node_class: {"},{"line_number":534,"context_line":"                \u0027total\u0027: 1,"},{"line_number":535,"context_line":"                \u0027reserved\u0027: 0,"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_7724a9ae","line":532,"updated":"2017-01-27 18:10:44.000000000","message":"To follow my suggested plan, I think here we need to continue to report the old inventory data, along with this additional data.\n\nAs we no longer delete the old data, we don\u0027t run the risk of hitting that InventoryInUse case, AFAIK.\n\nNow how we implement that is a different question, it feels like update_resource_stats should be modified to optionally include this extra information, should that custom resource class be present.","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"de418888f6ae418f795154a40dcb2cacf1246cf1","unresolved":false,"context_lines":[{"line_number":540,"context_line":"            }"},{"line_number":541,"context_line":"        }"},{"line_number":542,"context_line":"        try:"},{"line_number":543,"context_line":"            self.scheduler_client.set_provider_inventory("},{"line_number":544,"context_line":"                cn.uuid,"},{"line_number":545,"context_line":"                cn.hypervisor_hostname,"},{"line_number":546,"context_line":"                inv_data,"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_c4e3ed03","line":543,"updated":"2017-01-27 17:51:33.000000000","message":"This should be self.report_client.set_provider_inventory","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"a6d0cb6483b9cd0ee9e0b38eb0e322a4ad504aaa","unresolved":false,"context_lines":[{"line_number":545,"context_line":"                cn.hypervisor_hostname,"},{"line_number":546,"context_line":"                inv_data,"},{"line_number":547,"context_line":"            )"},{"line_number":548,"context_line":"        except exception.InventoryInUse:"},{"line_number":549,"context_line":"            # The Ironic baremetal node had already been allocated to an"},{"line_number":550,"context_line":"            # instance and allocation records for VCPU, MEMORY_MB and DISK_GB"},{"line_number":551,"context_line":"            # had been created against the resource provider. We need to delete"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_3d384da0","line":548,"updated":"2017-01-27 14:51:45.000000000","message":"So I am good with this, except I am not sure about when an ironic node is not assigned to an instance, I am grubbing around in here:\nhttps://github.com/openstack/nova/blob/master/nova/objects/resource_provider.py#L274","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b6f30313ce826c59f26100d4d9c213565524350f","unresolved":false,"context_lines":[{"line_number":545,"context_line":"                cn.hypervisor_hostname,"},{"line_number":546,"context_line":"                inv_data,"},{"line_number":547,"context_line":"            )"},{"line_number":548,"context_line":"        except exception.InventoryInUse:"},{"line_number":549,"context_line":"            # The Ironic baremetal node had already been allocated to an"},{"line_number":550,"context_line":"            # instance and allocation records for VCPU, MEMORY_MB and DISK_GB"},{"line_number":551,"context_line":"            # had been created against the resource provider. We need to delete"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_1d4631bf","line":548,"in_reply_to":"3a461143_3d384da0","updated":"2017-01-27 15:07:47.000000000","message":"Ah, I am now seeing how set_provider_inventory will delete the old style inventories, but only if there are no allocations, hence the need for the clean_up to add new style allocations.","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b6f30313ce826c59f26100d4d9c213565524350f","unresolved":false,"context_lines":[{"line_number":669,"context_line":"            cn.uuid,"},{"line_number":670,"context_line":"            inst.uuid,"},{"line_number":671,"context_line":"            alloc_data"},{"line_number":672,"context_line":"        )"},{"line_number":673,"context_line":"        msg \u003d _LI("},{"line_number":674,"context_line":"            \"Cleaning up old-style Ironic baremetal allocation records. \""},{"line_number":675,"context_line":"            \"Successfully created new allocation record for \""}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_7de9f57f","line":672,"updated":"2017-01-27 15:07:47.000000000","message":"Its fine having this here, but don\u0027t we now need:\nhttps://github.com/openstack/nova/blob/796ea1664a909a1d558150a15c19fbea4ef1a3e2/nova/scheduler/client/report.py#L664\nTo be ironic aware and do something similar?\n\nAdded a comment in the scheduler client where is looks like thats need.","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"1a7fcd33a05e3ea3cf9e5a963c4b5f340e4217fb","unresolved":false,"context_lines":[{"line_number":530,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"},{"line_number":531,"context_line":"        # indicated for the node."},{"line_number":532,"context_line":"        inv_data \u003d {"},{"line_number":533,"context_line":"            bm_node_class: {"},{"line_number":534,"context_line":"                \u0027total\u0027: 1,"},{"line_number":535,"context_line":"                \u0027reserved\u0027: 0,"},{"line_number":536,"context_line":"                \u0027min_unit\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a461143_fac40060","line":533,"updated":"2017-01-27 18:43:41.000000000","message":"Reapplying vote from previous patch set.","commit_id":"56c78c02fa73dffe1df21e027072589b5d1c36c1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2dc0aa3fd7a9749e73617ceb4943a44470511f6e","unresolved":false,"context_lines":[{"line_number":916,"context_line":"                self.pci_tracker.update_pci_for_instance(context,"},{"line_number":917,"context_line":"                                                         instance,"},{"line_number":918,"context_line":"                                                         sign\u003dsign)"},{"line_number":919,"context_line":"            self.scheduler_client.reportclient.update_instance_allocation("},{"line_number":920,"context_line":"                cn, instance, sign)"},{"line_number":921,"context_line":"            # new instance, update compute node resource usage:"},{"line_number":922,"context_line":"            self._update_usage(self._get_usage_dict(instance), nodename,"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a461143_e30b58d4","side":"PARENT","line":919,"range":{"start_line":919,"start_character":17,"end_line":919,"end_character":46},"updated":"2017-01-30 10:43:48.000000000","message":"Nit: totally a nit pick, but this would be a good change to do separately, introduce and use self.report_client.","commit_id":"81defe68d163dcf9528678ef5f7295b878e02255"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2dc0aa3fd7a9749e73617ceb4943a44470511f6e","unresolved":false,"context_lines":[{"line_number":523,"context_line":"        :param resources: Result of the virt driver\u0027s get_available_resource()"},{"line_number":524,"context_line":"                          call."},{"line_number":525,"context_line":"        \"\"\""},{"line_number":526,"context_line":"        # TODO(edleafe): Remove this code in Pike once the placement service"},{"line_number":527,"context_line":"        # supports Ironic. "},{"line_number":528,"context_line":"        NOT_YET \u003d True"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"        # NOTE(jaypipes): Until Pike, the node.resource_class attribute in"},{"line_number":531,"context_line":"        # the Ironic API is not required to be set (though the attribute"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a461143_e3a198f9","line":528,"range":{"start_line":526,"start_character":0,"end_line":528,"end_character":22},"updated":"2017-01-30 10:43:48.000000000","message":"I would rather we didn\u0027t merge dead code, we can keep that in gerrit history, etc, rather than merge it.","commit_id":"96f7892cca3f4ecf084f9fae1c43b8a3fd2774f1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2dc0aa3fd7a9749e73617ceb4943a44470511f6e","unresolved":false,"context_lines":[{"line_number":556,"context_line":"        # supports Ironic. "},{"line_number":557,"context_line":"        if NOT_YET:"},{"line_number":558,"context_line":"            # Yes, this is a call to a private method, but this is a stopgap to"},{"line_number":559,"context_line":"            # avoid multiple HTTP calls, and will go away shortly."},{"line_number":560,"context_line":"            old_inv \u003d self.report_client._compute_node_to_inventory_dict(cn)"},{"line_number":561,"context_line":"            inv_data.update(old_inv)"},{"line_number":562,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"3a461143_43c6ec9a","line":559,"updated":"2017-01-30 10:43:48.000000000","message":"I think we should cover a bit of the why, something like...\n\nWhile we still claim and schedule using legacy resource provider inventory information for ironic, we must keep reporting the legacy inventory information.","commit_id":"96f7892cca3f4ecf084f9fae1c43b8a3fd2774f1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2dc0aa3fd7a9749e73617ceb4943a44470511f6e","unresolved":false,"context_lines":[{"line_number":557,"context_line":"        if NOT_YET:"},{"line_number":558,"context_line":"            # Yes, this is a call to a private method, but this is a stopgap to"},{"line_number":559,"context_line":"            # avoid multiple HTTP calls, and will go away shortly."},{"line_number":560,"context_line":"            old_inv \u003d self.report_client._compute_node_to_inventory_dict(cn)"},{"line_number":561,"context_line":"            inv_data.update(old_inv)"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a461143_83eff4e7","line":560,"range":{"start_line":560,"start_character":41,"end_line":560,"end_character":72},"updated":"2017-01-30 10:43:48.000000000","message":"Its tempting to have a change before this one that moves the compute node logic to use set_provider_inventory method, and move the compute_node-\u003einventory logic into the resource tracker. But I am not sure thats going to speed us up at this point in the cycle, so lets ignore that.","commit_id":"96f7892cca3f4ecf084f9fae1c43b8a3fd2774f1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"89694c67fa4398256dfbbf944ecfffeec297e01b","unresolved":false,"context_lines":[{"line_number":557,"context_line":"        if NOT_YET:"},{"line_number":558,"context_line":"            # Yes, this is a call to a private method, but this is a stopgap to"},{"line_number":559,"context_line":"            # avoid multiple HTTP calls, and will go away shortly."},{"line_number":560,"context_line":"            old_inv \u003d self.report_client._compute_node_to_inventory_dict(cn)"},{"line_number":561,"context_line":"            inv_data.update(old_inv)"},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":25,"id":"3a461143_660bf62a","line":560,"range":{"start_line":560,"start_character":41,"end_line":560,"end_character":72},"in_reply_to":"3a461143_83eff4e7","updated":"2017-01-30 11:01:10.000000000","message":"I am seeing this error:\nAttributeError: \u0027SchedulerReportClient\u0027 object has no attribute \u0027_compute_node_to_inventory_dict\u0027\n\nhttp://logs.openstack.org/96/426296/3/check/gate-tempest-dsvm-ironic-ipa-wholedisk-agent_ipmitool-tinyipa-ubuntu-xenial-nv/fd3d15e/logs/screen-n-cpu.txt.gz#_2017-01-28_00_25_20_187","commit_id":"96f7892cca3f4ecf084f9fae1c43b8a3fd2774f1"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"2dc0aa3fd7a9749e73617ceb4943a44470511f6e","unresolved":false,"context_lines":[{"line_number":577,"context_line":"            # TODO(edleafe): Once the placement service supports Ironic, remove"},{"line_number":578,"context_line":"            # this \"if NOT_YET:\" structure, and just leave the \"else:\" part."},{"line_number":579,"context_line":"            if NOT_YET:"},{"line_number":580,"context_line":"                pass"},{"line_number":581,"context_line":"            else:"},{"line_number":582,"context_line":"                self._cleanup_ironic_legacy_allocations(cn, inv_data)"},{"line_number":583,"context_line":""}],"source_content_type":"text/x-python","patch_set":25,"id":"3a461143_a35070d5","line":580,"updated":"2017-01-30 10:43:48.000000000","message":"Maybe raise would be best here?\n\nI would rather we didn\u0027t merge dead code though. We will sure need this stuff later, but lets just move that to a follow on change that is marked as WIP.","commit_id":"96f7892cca3f4ecf084f9fae1c43b8a3fd2774f1"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"40083c8b4e53d83844af455b0e13b400439265c6","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        self.monitors \u003d monitor_handler.monitors"},{"line_number":98,"context_line":"        self.old_resources \u003d collections.defaultdict(objects.ComputeNode)"},{"line_number":99,"context_line":"        self.scheduler_client \u003d scheduler_client.SchedulerClient()"},{"line_number":100,"context_line":"        self.report_client \u003d self.scheduler_client.reportclient"},{"line_number":101,"context_line":"        self.ram_allocation_ratio \u003d CONF.ram_allocation_ratio"},{"line_number":102,"context_line":"        self.cpu_allocation_ratio \u003d CONF.cpu_allocation_ratio"},{"line_number":103,"context_line":"        self.disk_allocation_ratio \u003d CONF.disk_allocation_ratio"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a461143_4a1fd807","line":100,"updated":"2017-01-30 14:03:58.000000000","message":"nit: you don\u0027t really need to do that given the above line.","commit_id":"c04ad839422993013823a15abac557207b3e2e95"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"556b9edeb01677b6a8b49b3ef9e88b84d71bfb43","unresolved":false,"context_lines":[{"line_number":536,"context_line":"        bm_node_class \u003d resources.get(\u0027resource_class\u0027)"},{"line_number":537,"context_line":"        bm_node_class \u003d self._ensure_ironic_node_class(bm_node_class)"},{"line_number":538,"context_line":"        if cn.hypervisor_type !\u003d \u0027ironic\u0027 or bm_node_class is None:"},{"line_number":539,"context_line":"            self.report_client.update_resource_stats(cn)"},{"line_number":540,"context_line":"            return"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a461143_aa4bdc85","line":539,"updated":"2017-01-30 14:12:04.000000000","message":"This does a cn.save() that we are missing here","commit_id":"c04ad839422993013823a15abac557207b3e2e95"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"40083c8b4e53d83844af455b0e13b400439265c6","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        # behaviour of using VCPU, MEMORY_MB and DISK_GB resources."},{"line_number":536,"context_line":"        bm_node_class \u003d resources.get(\u0027resource_class\u0027)"},{"line_number":537,"context_line":"        bm_node_class \u003d self._ensure_ironic_node_class(bm_node_class)"},{"line_number":538,"context_line":"        if cn.hypervisor_type !\u003d \u0027ironic\u0027 or bm_node_class is None:"},{"line_number":539,"context_line":"            self.report_client.update_resource_stats(cn)"},{"line_number":540,"context_line":"            return"},{"line_number":541,"context_line":""},{"line_number":542,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"},{"line_number":543,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"}],"source_content_type":"text/x-python","patch_set":26,"id":"3a461143_ea96c43c","line":540,"range":{"start_line":538,"start_character":0,"end_line":540,"end_character":18},"updated":"2017-01-30 14:03:58.000000000","message":"So only if Ironic supports the resource classes, then we stop reporting the old way?\n\nIf so, what about operators using the IronicHostManager which is using custom filters ? They would then stop to have good HostStates, right?","commit_id":"c04ad839422993013823a15abac557207b3e2e95"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b654caa81df5d7d5ee121db4e8b52d686a093948","unresolved":false,"context_lines":[{"line_number":40,"context_line":"from nova.pci import request as pci_request"},{"line_number":41,"context_line":"from nova import rpc"},{"line_number":42,"context_line":"from nova.scheduler import client as scheduler_client"},{"line_number":43,"context_line":"from nova.scheduler.client import report as report_client"},{"line_number":44,"context_line":"from nova import utils"},{"line_number":45,"context_line":"from nova.virt import hardware"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_80117406","line":43,"updated":"2017-01-31 14:30:03.000000000","message":"Could we perhaps make this a different name from self.report_client?","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"361498a1af7b1697928e0e0869057ae47a2c64ee","unresolved":false,"context_lines":[{"line_number":40,"context_line":"from nova.pci import request as pci_request"},{"line_number":41,"context_line":"from nova import rpc"},{"line_number":42,"context_line":"from nova.scheduler import client as scheduler_client"},{"line_number":43,"context_line":"from nova.scheduler.client import report as report_client"},{"line_number":44,"context_line":"from nova import utils"},{"line_number":45,"context_line":"from nova.virt import hardware"},{"line_number":46,"context_line":""}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_0134a3db","line":43,"in_reply_to":"3a461143_80117406","updated":"2017-01-31 16:09:48.000000000","message":"Sure.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":10343,"name":"Jim Rollenhagen","email":"jim@jimrollenhagen.com","username":"jimrollenhagen"},"change_message_id":"a51feab650ca3259a1f339a5336366448b2ea1b4","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    cust_prefix \u003d objects.ResourceClass.CUSTOM_NAMESPACE"},{"line_number":78,"context_line":"    if not rc_name.startswith(cust_prefix):"},{"line_number":79,"context_line":"        rc_name \u003d cust_prefix + rc_name"},{"line_number":80,"context_line":"    return rc_name"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def _is_trackable_migration(migration):"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_ed66b0eb","line":80,"updated":"2017-01-31 14:44:32.000000000","message":"I had a problem in testing where e.g. \u0027foo-bar\u0027 in node.resource_class didn\u0027t work, because the placement engine rejected it as invalid. Could we possibly change any invalid characters to a \u0027_\u0027 or something here?\n\nNB: we didn\u0027t know what the accepted custom resource classes would be when we added node.resource_class to ironic\u0027s API, so it\u0027s a bit freeform right now, other than a max length of 80. We even use hyphens in testing/examples. I\u0027d hate to have to restrict it a cycle later, we can if needed, but would rather just correct it here where necessary.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"361498a1af7b1697928e0e0869057ae47a2c64ee","unresolved":false,"context_lines":[{"line_number":77,"context_line":"    cust_prefix \u003d objects.ResourceClass.CUSTOM_NAMESPACE"},{"line_number":78,"context_line":"    if not rc_name.startswith(cust_prefix):"},{"line_number":79,"context_line":"        rc_name \u003d cust_prefix + rc_name"},{"line_number":80,"context_line":"    return rc_name"},{"line_number":81,"context_line":""},{"line_number":82,"context_line":""},{"line_number":83,"context_line":"def _is_trackable_migration(migration):"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_e60a4d25","line":80,"in_reply_to":"3a461143_ed66b0eb","updated":"2017-01-31 16:09:48.000000000","message":"Sure, we can make that change, no problem.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"73c4ff5b1b3adf0d03542d2cded76635a678ccb7","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        # incorrect inventory records, so we manually call save() here."},{"line_number":536,"context_line":"        cn.save()"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        bm_node_class \u003d self._ensure_ironic_node_class(bm_node_class)"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"},{"line_number":541,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_b13a4fe5","line":538,"updated":"2017-01-31 10:20:33.000000000","message":"Should we raise or bail out here if bm_node_class is None? The \"ensure\" method doesn\u0027t really do what I expected it to (raise if it couldn\u0027t ensure)","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"361498a1af7b1697928e0e0869057ae47a2c64ee","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        # incorrect inventory records, so we manually call save() here."},{"line_number":536,"context_line":"        cn.save()"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        bm_node_class \u003d self._ensure_ironic_node_class(bm_node_class)"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"},{"line_number":541,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_a1590f37","line":538,"in_reply_to":"3a461143_8037b44b","updated":"2017-01-31 16:09:48.000000000","message":"OK, will fix. Sorry.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b654caa81df5d7d5ee121db4e8b52d686a093948","unresolved":false,"context_lines":[{"line_number":535,"context_line":"        # incorrect inventory records, so we manually call save() here."},{"line_number":536,"context_line":"        cn.save()"},{"line_number":537,"context_line":""},{"line_number":538,"context_line":"        bm_node_class \u003d self._ensure_ironic_node_class(bm_node_class)"},{"line_number":539,"context_line":""},{"line_number":540,"context_line":"        # NOTE(jaypipes): Ironic baremetal node resource providers only ever"},{"line_number":541,"context_line":"        # have a single inventory record, of quantity 1 of the resource class"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_8037b44b","line":538,"in_reply_to":"3a461143_b13a4fe5","updated":"2017-01-31 14:30:03.000000000","message":"Yeah, this appears to be wrong, again, after it was fixed in the changes around patches 17-20. There are situations in which we can have None here (as explained in the comments back then).","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"73c4ff5b1b3adf0d03542d2cded76635a678ccb7","unresolved":false,"context_lines":[{"line_number":572,"context_line":"            # resource provider to the new inventory set constructed above and"},{"line_number":573,"context_line":"            # then insert a set of allocation records that consumes the entire"},{"line_number":574,"context_line":"            # inventory."},{"line_number":575,"context_line":"            self._cleanup_ironic_legacy_allocations(cn, inv_data)"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"    # TODO(jaypipes): Remove at end of Pike when all old-style Ironic"},{"line_number":578,"context_line":"    # allocation records will have been replaced with the new allocation"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_542f5987","line":575,"updated":"2017-01-31 10:20:33.000000000","message":"So this code isn\u0027t reachable, as I understand it. We would only get here if we removed an inventory that already has allocations, but above we are only ever adding an inventory, which I believe the API will allow.\n\nNow I am no expert, this is based on my manic code reading at the end of last week. Did I read that wrongly?","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"361498a1af7b1697928e0e0869057ae47a2c64ee","unresolved":false,"context_lines":[{"line_number":572,"context_line":"            # resource provider to the new inventory set constructed above and"},{"line_number":573,"context_line":"            # then insert a set of allocation records that consumes the entire"},{"line_number":574,"context_line":"            # inventory."},{"line_number":575,"context_line":"            self._cleanup_ironic_legacy_allocations(cn, inv_data)"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"    # TODO(jaypipes): Remove at end of Pike when all old-style Ironic"},{"line_number":578,"context_line":"    # allocation records will have been replaced with the new allocation"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_e1add7e9","line":575,"in_reply_to":"3a461143_542f5987","updated":"2017-01-31 16:09:48.000000000","message":"This is indeed reachable. It will be hit for any already-provisioned Ironic baremetal node, which will have VCPU, MEMORY_MB, and DISK_GB resources allocated to an instance. Trying to set the inventory to VCPU, MEMORY_MB, DISK_GB, and $CUSTOM_RESOURCE_CLASS in this patch will result in an InventoryInUse being raised.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b654caa81df5d7d5ee121db4e8b52d686a093948","unresolved":false,"context_lines":[{"line_number":572,"context_line":"            # resource provider to the new inventory set constructed above and"},{"line_number":573,"context_line":"            # then insert a set of allocation records that consumes the entire"},{"line_number":574,"context_line":"            # inventory."},{"line_number":575,"context_line":"            self._cleanup_ironic_legacy_allocations(cn, inv_data)"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"    # TODO(jaypipes): Remove at end of Pike when all old-style Ironic"},{"line_number":578,"context_line":"    # allocation records will have been replaced with the new allocation"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_1b50950a","line":575,"in_reply_to":"3a461143_542f5987","updated":"2017-01-31 14:30:03.000000000","message":"We could also reach it if we tried to change an inventory to state that conflicted with allocations.\n\nBut yeah, this is weird. _cleanup_... is going to set the inventory _again_ after we just tried to set it to what we want it to be. What we\u0027re after is to set both types of inventory (resource class and compute node-related) and both types of allocation, yes?","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"45c1706e95010ebf9ed538b58edff962d7a7be5f","unresolved":false,"context_lines":[{"line_number":572,"context_line":"            # resource provider to the new inventory set constructed above and"},{"line_number":573,"context_line":"            # then insert a set of allocation records that consumes the entire"},{"line_number":574,"context_line":"            # inventory."},{"line_number":575,"context_line":"            self._cleanup_ironic_legacy_allocations(cn, inv_data)"},{"line_number":576,"context_line":""},{"line_number":577,"context_line":"    # TODO(jaypipes): Remove at end of Pike when all old-style Ironic"},{"line_number":578,"context_line":"    # allocation records will have been replaced with the new allocation"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_b6a68fbe","line":575,"in_reply_to":"3a461143_e1add7e9","updated":"2017-02-01 12:15:32.000000000","message":"So the way I understand it we can raise this here, when deleting a conflicting inventory:\nhttps://github.com/openstack/nova/blob/2be2ccf1ea33faf0e65b0503203ffcac2cb95ebd/nova/objects/resource_provider.py#L95\n\nBut in this case, surely to to_delete list will be empty:\nhttps://github.com/openstack/nova/blob/2be2ccf1ea33faf0e65b0503203ffcac2cb95ebd/nova/objects/resource_provider.py#L288\n\nWe would be updating VCPU, etc and adding the new custom one.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"73c4ff5b1b3adf0d03542d2cded76635a678ccb7","unresolved":false,"context_lines":[{"line_number":679,"context_line":"        # instance, creating allocation records for each resource class in the"},{"line_number":680,"context_line":"        # inventory for the baremetal node."},{"line_number":681,"context_line":"        alloc_data \u003d {"},{"line_number":682,"context_line":"            rc: rec[\u0027total\u0027] for rc, rec in inv_data.items()"},{"line_number":683,"context_line":"        }"},{"line_number":684,"context_line":"        self.report_client.create_provider_allocations("},{"line_number":685,"context_line":"            cn.uuid,"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_34764d3e","line":682,"updated":"2017-01-31 10:20:33.000000000","message":"So this is what I was expecting us to do, create allocations for all the resources.\n\nBut if this code were reachable (which I don\u0027t think it is), it would only work for *existing* instances at the time we first update the inventory.\n\nFor new instances, after the inventory is updated, they would still be doing these legacy style allocations here:\nhttps://github.com/openstack/nova/blob/master/nova/scheduler/client/report.py#L598\n\nThe way the allocations are deleted looks OK, as all allocations for the instance are released.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"361498a1af7b1697928e0e0869057ae47a2c64ee","unresolved":false,"context_lines":[{"line_number":679,"context_line":"        # instance, creating allocation records for each resource class in the"},{"line_number":680,"context_line":"        # inventory for the baremetal node."},{"line_number":681,"context_line":"        alloc_data \u003d {"},{"line_number":682,"context_line":"            rc: rec[\u0027total\u0027] for rc, rec in inv_data.items()"},{"line_number":683,"context_line":"        }"},{"line_number":684,"context_line":"        self.report_client.create_provider_allocations("},{"line_number":685,"context_line":"            cn.uuid,"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_21b43f33","line":682,"in_reply_to":"3a461143_34764d3e","updated":"2017-01-31 16:09:48.000000000","message":"It is definitely reachable. See above.\n\nI\u0027ll add a functional test somewhere to validate this.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    if not rc_name.startswith(cust_prefix):"},{"line_number":79,"context_line":"        rc_name \u003d cust_prefix + rc_name"},{"line_number":80,"context_line":"    # Replace some punctuation characters with underscores"},{"line_number":81,"context_line":"    rc_name \u003d re.sub(\u0027[^0-9a-zA-Z]+\u0027, \u0027_\u0027, rc_name)"},{"line_number":82,"context_line":"    return rc_name"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_20441948","line":81,"updated":"2017-02-01 11:43:25.000000000","message":"nit: a-z is redundant here because of the upper() above","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6434b27e8ddb5e18f9713be7e8e9820ffa9e4566","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    if not rc_name.startswith(cust_prefix):"},{"line_number":79,"context_line":"        rc_name \u003d cust_prefix + rc_name"},{"line_number":80,"context_line":"    # Replace some punctuation characters with underscores"},{"line_number":81,"context_line":"    rc_name \u003d re.sub(\u0027[^0-9a-zA-Z]+\u0027, \u0027_\u0027, rc_name)"},{"line_number":82,"context_line":"    return rc_name"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_76dfc7d5","line":81,"in_reply_to":"3a461143_20441948","updated":"2017-02-01 12:47:16.000000000","message":"+1","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"c127bfd736cba32baaeafdea34440adb2f6814a7","unresolved":false,"context_lines":[{"line_number":78,"context_line":"    if not rc_name.startswith(cust_prefix):"},{"line_number":79,"context_line":"        rc_name \u003d cust_prefix + rc_name"},{"line_number":80,"context_line":"    # Replace some punctuation characters with underscores"},{"line_number":81,"context_line":"    rc_name \u003d re.sub(\u0027[^0-9a-zA-Z]+\u0027, \u0027_\u0027, rc_name)"},{"line_number":82,"context_line":"    return rc_name"},{"line_number":83,"context_line":""},{"line_number":84,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_d6631140","line":81,"in_reply_to":"3a461143_76dfc7d5","updated":"2017-02-01 16:51:17.000000000","message":"So if a name like \"This is \u0026^%\u0026^$$%^*\u0026 bonkers!!!\" is passed, it will change it to \"CUSTOM_THIS_IS_BONKERS_\". Is that the intention? To replace multiple non-alphas to a single underscore?","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6434b27e8ddb5e18f9713be7e8e9820ffa9e4566","unresolved":false,"context_lines":[{"line_number":554,"context_line":"            cn.uuid,"},{"line_number":555,"context_line":"            cn.hypervisor_hostname,"},{"line_number":556,"context_line":"            inv_data,"},{"line_number":557,"context_line":"        )"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    def _handle_ironic_allocations(self, cn, instance):"},{"line_number":560,"context_line":"        \"\"\"Helper method that deletes existing allocations for an Ironic"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_8c8d072d","line":557,"updated":"2017-02-01 12:47:16.000000000","message":"Do we not need somewhere to update existing allocations?","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[{"line_number":582,"context_line":""},{"line_number":583,"context_line":"        cur_allocs \u003d self.report_client.get_allocations(cn.uuid)"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"        if len(cur_allocs) \u003d\u003d 4:"},{"line_number":586,"context_line":"            # The correction has already been made..."},{"line_number":587,"context_line":"            return"},{"line_number":588,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_209979c4","line":585,"updated":"2017-02-01 11:43:25.000000000","message":"It\u0027s okay, I guess, but this breaks if/when the default \"old style\" allocations change?","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6434b27e8ddb5e18f9713be7e8e9820ffa9e4566","unresolved":false,"context_lines":[{"line_number":582,"context_line":""},{"line_number":583,"context_line":"        cur_allocs \u003d self.report_client.get_allocations(cn.uuid)"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"        if len(cur_allocs) \u003d\u003d 4:"},{"line_number":586,"context_line":"            # The correction has already been made..."},{"line_number":587,"context_line":"            return"},{"line_number":588,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_9606f383","line":585,"in_reply_to":"3a461143_209979c4","updated":"2017-02-01 12:47:16.000000000","message":"What about len(cur_allocs) \u003d\u003d len(inv_data)?","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6434b27e8ddb5e18f9713be7e8e9820ffa9e4566","unresolved":false,"context_lines":[{"line_number":600,"context_line":""},{"line_number":601,"context_line":"        # OK, first things first, let\u0027s remove the existing allocation records"},{"line_number":602,"context_line":"        # for VCPU, MEMORY_MB, DISK_GB, etc."},{"line_number":603,"context_line":"        self.report_client.update_instance_allocation(cn, instance, -1)"},{"line_number":604,"context_line":"        msg \u003d _LI("},{"line_number":605,"context_line":"            \"Successfully deleted existing allocations for baremetal node \""},{"line_number":606,"context_line":"            \"%(nodename)s and consumer ID %(consumer_id)s against resource \""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_0ca2f79a","line":603,"updated":"2017-02-01 12:47:16.000000000","message":"It looks like this only gets run when its a new instance, so not sure if this is needed for that case? I guess it should work when there are no existing allocations?","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"2792154563b251df5ffe4bb1bea58e1492515b9b","unresolved":false,"context_lines":[{"line_number":600,"context_line":""},{"line_number":601,"context_line":"        # OK, first things first, let\u0027s remove the existing allocation records"},{"line_number":602,"context_line":"        # for VCPU, MEMORY_MB, DISK_GB, etc."},{"line_number":603,"context_line":"        self.report_client.update_instance_allocation(cn, instance, -1)"},{"line_number":604,"context_line":"        msg \u003d _LI("},{"line_number":605,"context_line":"            \"Successfully deleted existing allocations for baremetal node \""},{"line_number":606,"context_line":"            \"%(nodename)s and consumer ID %(consumer_id)s against resource \""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_73e34006","line":603,"in_reply_to":"3a461143_0ca2f79a","updated":"2017-02-01 23:33:50.000000000","message":"Well, \"new\" in the sense that this is an untracked instance, so it\u0027s *possible* that it may have had allocations previously. So this is probably overkill, and may end up being a call we can remove.","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"6434b27e8ddb5e18f9713be7e8e9820ffa9e4566","unresolved":false,"context_lines":[{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        # And now add the appropriate inventory record for the new-style Ironic"},{"line_number":617,"context_line":"        # resource class"},{"line_number":618,"context_line":"        self.report_client.set_provider_inventory("},{"line_number":619,"context_line":"            cn.uuid,"},{"line_number":620,"context_line":"            cn.hypervisor_hostname,"},{"line_number":621,"context_line":"            inv_data,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_f65bb783","line":618,"updated":"2017-02-01 12:47:16.000000000","message":"Is this to just avoid races or something?","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"a333afff04ac5813c8cad82ddf2f9a71538d94f5","unresolved":false,"context_lines":[{"line_number":550,"context_line":"            bm_node_class,"},{"line_number":551,"context_line":"            cn,"},{"line_number":552,"context_line":"        )"},{"line_number":553,"context_line":"        self.report_client.set_provider_inventory("},{"line_number":554,"context_line":"            cn.uuid,"},{"line_number":555,"context_line":"            cn.hypervisor_hostname,"},{"line_number":556,"context_line":"            inv_data,"}],"source_content_type":"text/x-python","patch_set":30,"id":"3a461143_6278a9f9","line":553,"updated":"2017-02-02 17:51:40.000000000","message":"I am still not sure how we updates existing allocations in this version of the patch.\n\nAt a guess, I think next time you reboot nova-compute we might actually re-assert all the allocations?\n\nCould we not do something like this here:\n\n   cur_allocs \u003d self.report_client.get_allocations(cn.uuid)\n   if len(cur_allocs) !\u003d len(inv_data):\n       inst_list \u003d objects.InstanceList.get_by_host_and_node(\n            ctx, self.host, cn.hypervisor_hostname\n       if (inst_list) \u003d\u003d 1:\n           _handle_iroinc_allocations(cn, inst_list[0])","commit_id":"75f2cb542393b788eec26dc9bb513222d5426e6a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b1a76abf5e323dec56d06020691963e96688f5dc","unresolved":false,"context_lines":[{"line_number":550,"context_line":"            bm_node_class,"},{"line_number":551,"context_line":"            cn,"},{"line_number":552,"context_line":"        )"},{"line_number":553,"context_line":"        self.report_client.set_provider_inventory("},{"line_number":554,"context_line":"            cn.uuid,"},{"line_number":555,"context_line":"            cn.hypervisor_hostname,"},{"line_number":556,"context_line":"            inv_data,"}],"source_content_type":"text/x-python","patch_set":30,"id":"3a461143_e201f93a","line":553,"in_reply_to":"3a461143_6278a9f9","updated":"2017-02-02 17:53:27.000000000","message":"oops, probably should be get inventory, rather than allocations, as len(cur_allocs) \u003d\u003d 0 is a valid case really. But hopefully this expresses my concern better?","commit_id":"75f2cb542393b788eec26dc9bb513222d5426e6a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6c23c74a0898e249f87bf2b14c70268d680a7738","unresolved":false,"context_lines":[{"line_number":550,"context_line":"            bm_node_class,"},{"line_number":551,"context_line":"            cn,"},{"line_number":552,"context_line":"        )"},{"line_number":553,"context_line":"        self.report_client.set_provider_inventory("},{"line_number":554,"context_line":"            cn.uuid,"},{"line_number":555,"context_line":"            cn.hypervisor_hostname,"},{"line_number":556,"context_line":"            inv_data,"}],"source_content_type":"text/x-python","patch_set":30,"id":"1a430d35_583c9593","line":553,"in_reply_to":"3a461143_e201f93a","updated":"2017-02-03 18:12:03.000000000","message":"Allocations don\u0027t really come into play here. Are you looking at the method below?","commit_id":"75f2cb542393b788eec26dc9bb513222d5426e6a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"a333afff04ac5813c8cad82ddf2f9a71538d94f5","unresolved":false,"context_lines":[{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        # And now add the appropriate inventory record for the new-style Ironic"},{"line_number":617,"context_line":"        # resource class"},{"line_number":618,"context_line":"        self.report_client.set_provider_inventory("},{"line_number":619,"context_line":"            cn.uuid,"},{"line_number":620,"context_line":"            cn.hypervisor_hostname,"},{"line_number":621,"context_line":"            inv_data,"}],"source_content_type":"text/x-python","patch_set":30,"id":"3a461143_e2d019fa","line":618,"updated":"2017-02-02 17:51:40.000000000","message":"It seems odd we update the inventory here, is this just to stop us racing the first periodic update of the inventory?","commit_id":"75f2cb542393b788eec26dc9bb513222d5426e6a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"199e745ddcf9c0a744e2014eae07d84ce37f5731","unresolved":false,"context_lines":[{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        # And now add the appropriate inventory record for the new-style Ironic"},{"line_number":617,"context_line":"        # resource class"},{"line_number":618,"context_line":"        self.report_client.set_provider_inventory("},{"line_number":619,"context_line":"            cn.uuid,"},{"line_number":620,"context_line":"            cn.hypervisor_hostname,"},{"line_number":621,"context_line":"            inv_data,"}],"source_content_type":"text/x-python","patch_set":30,"id":"1a430d35_382b4484","line":618,"in_reply_to":"1a430d35_f8c8e176","updated":"2017-02-03 19:43:16.000000000","message":"So I get this is called on init_host, and every periodic task, so we should update all the existing records this way now. coolness.\n\n\nLooking at this code though:\nhttps://github.com/openstack/nova/blob/cab5dbfac7513d2cef1073787e49f6d063ec8fa7/nova/compute/resource_tracker.py#L575\n\nWe should always have updated the inventory before we update the allocations.\n\nIf we didn\u0027t do it that way, we would always have failed to update the instance allocations.\n\nI really don\u0027t like the extra inventory update in here, it feels very out of place.\n\nI could well be missing something though. I am not RT expert.","commit_id":"75f2cb542393b788eec26dc9bb513222d5426e6a"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"6c23c74a0898e249f87bf2b14c70268d680a7738","unresolved":false,"context_lines":[{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        # And now add the appropriate inventory record for the new-style Ironic"},{"line_number":617,"context_line":"        # resource class"},{"line_number":618,"context_line":"        self.report_client.set_provider_inventory("},{"line_number":619,"context_line":"            cn.uuid,"},{"line_number":620,"context_line":"            cn.hypervisor_hostname,"},{"line_number":621,"context_line":"            inv_data,"}],"source_content_type":"text/x-python","patch_set":30,"id":"1a430d35_f8c8e176","line":618,"in_reply_to":"3a461143_e2d019fa","updated":"2017-02-03 18:12:03.000000000","message":"The only way we got here is if a) this is a new instance, and b) the inventory count didn\u0027t match the allocations. IOW, this only has either \"old-style\" (likely) or new-style (very unlikely, but possible) inventory and/or allocations. So this clears out all the old, and rebuilds inventory and allocations to include old and new style inventory, and fully allocates it all.","commit_id":"75f2cb542393b788eec26dc9bb513222d5426e6a"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"99a032ea95e61f78e1b51fa498445ef637a74c39","unresolved":false,"context_lines":[{"line_number":554,"context_line":"            cn.uuid,"},{"line_number":555,"context_line":"            cn.hypervisor_hostname,"},{"line_number":556,"context_line":"            inv_data,"},{"line_number":557,"context_line":"        )"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    def _handle_ironic_allocations(self, cn, instance):"},{"line_number":560,"context_line":"        \"\"\"Helper method that deletes existing allocations for an Ironic"}],"source_content_type":"text/x-python","patch_set":31,"id":"1a430d35_783a2c38","line":557,"updated":"2017-02-03 19:57:54.000000000","message":"This code will have corrected the inventory for us before the code below tries to do it again.","commit_id":"5f777edbbc798450e749c3b2728a519b6907cfa5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2ed201914d72e1b34b649803c96899118205be72","unresolved":false,"context_lines":[{"line_number":554,"context_line":"            cn.uuid,"},{"line_number":555,"context_line":"            cn.hypervisor_hostname,"},{"line_number":556,"context_line":"            inv_data,"},{"line_number":557,"context_line":"        )"},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"    def _handle_ironic_allocations(self, cn, instance):"},{"line_number":560,"context_line":"        \"\"\"Helper method that deletes existing allocations for an Ironic"}],"source_content_type":"text/x-python","patch_set":31,"id":"1a430d35_f94c1972","line":557,"in_reply_to":"1a430d35_783a2c38","updated":"2017-02-06 19:07:54.000000000","message":"The code below only will be executed if an instance is allocated to an Ironic baremetal instance AND the allocations already existing for the node did not include the new-style custom resource class. Also, it\u0027s worth pointing out that set_provider_inventory() is a NOOP if the inventory doesn\u0027t change.","commit_id":"5f777edbbc798450e749c3b2728a519b6907cfa5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"99a032ea95e61f78e1b51fa498445ef637a74c39","unresolved":false,"context_lines":[{"line_number":600,"context_line":""},{"line_number":601,"context_line":"        # OK, first things first, let\u0027s remove the existing allocation records"},{"line_number":602,"context_line":"        # for VCPU, MEMORY_MB, DISK_GB, etc."},{"line_number":603,"context_line":"        self.report_client.update_instance_allocation(cn, instance, -1)"},{"line_number":604,"context_line":"        msg \u003d _LI("},{"line_number":605,"context_line":"            \"Successfully deleted existing allocations for baremetal node \""},{"line_number":606,"context_line":"            \"%(nodename)s and consumer ID %(consumer_id)s against resource \""}],"source_content_type":"text/x-python","patch_set":31,"id":"1a430d35_b823b404","line":603,"updated":"2017-02-03 19:57:54.000000000","message":"We should add a note that we can drop this code next cycle, I believe. Its only needed in case we are doing an update of an instance, not just a build instance thing.","commit_id":"5f777edbbc798450e749c3b2728a519b6907cfa5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2ed201914d72e1b34b649803c96899118205be72","unresolved":false,"context_lines":[{"line_number":600,"context_line":""},{"line_number":601,"context_line":"        # OK, first things first, let\u0027s remove the existing allocation records"},{"line_number":602,"context_line":"        # for VCPU, MEMORY_MB, DISK_GB, etc."},{"line_number":603,"context_line":"        self.report_client.update_instance_allocation(cn, instance, -1)"},{"line_number":604,"context_line":"        msg \u003d _LI("},{"line_number":605,"context_line":"            \"Successfully deleted existing allocations for baremetal node \""},{"line_number":606,"context_line":"            \"%(nodename)s and consumer ID %(consumer_id)s against resource \""}],"source_content_type":"text/x-python","patch_set":31,"id":"1a430d35_3975c197","line":603,"in_reply_to":"1a430d35_b823b404","updated":"2017-02-06 19:07:54.000000000","message":"Done.","commit_id":"5f777edbbc798450e749c3b2728a519b6907cfa5"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"99a032ea95e61f78e1b51fa498445ef637a74c39","unresolved":false,"context_lines":[{"line_number":613,"context_line":"        }"},{"line_number":614,"context_line":"        LOG.info(msg, msg_args)"},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        # And now add the appropriate inventory record for the new-style Ironic"},{"line_number":617,"context_line":"        # resource class"},{"line_number":618,"context_line":"        self.report_client.set_provider_inventory("},{"line_number":619,"context_line":"            cn.uuid,"},{"line_number":620,"context_line":"            cn.hypervisor_hostname,"},{"line_number":621,"context_line":"            inv_data,"},{"line_number":622,"context_line":"        )"},{"line_number":623,"context_line":"        msg \u003d _LI("},{"line_number":624,"context_line":"            \"Successfully set inventory to %(inv_data)s on \""},{"line_number":625,"context_line":"            \"baremetal node %(nodename)s against resource provider \""},{"line_number":626,"context_line":"            \"%(resource_provider)s.\""},{"line_number":627,"context_line":"        )"},{"line_number":628,"context_line":"        msg_args \u003d {"},{"line_number":629,"context_line":"            \u0027inv_data\u0027: inv_data,"},{"line_number":630,"context_line":"            \u0027nodename\u0027: cn.hypervisor_hostname,"},{"line_number":631,"context_line":"            \u0027resource_provider\u0027: cn.uuid,"},{"line_number":632,"context_line":"        }"},{"line_number":633,"context_line":"        LOG.info(msg, msg_args)"},{"line_number":634,"context_line":""},{"line_number":635,"context_line":"        # Finally, consume all the inventory records with the original"},{"line_number":636,"context_line":"        # instance, creating allocation records for each resource class in the"}],"source_content_type":"text/x-python","patch_set":31,"id":"1a430d35_782b0c31","line":633,"range":{"start_line":616,"start_character":8,"end_line":633,"end_character":31},"updated":"2017-02-03 19:57:54.000000000","message":"I am almost on board with this now.\n\nI don\u0027t believe we need this bit though. The inventory is always updated before you update the instance allocations.\n\nIts only a nit, but its really wasteful to keep doing this every time a new instance is built.","commit_id":"5f777edbbc798450e749c3b2728a519b6907cfa5"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"2ed201914d72e1b34b649803c96899118205be72","unresolved":false,"context_lines":[{"line_number":613,"context_line":"        }"},{"line_number":614,"context_line":"        LOG.info(msg, msg_args)"},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"        # And now add the appropriate inventory record for the new-style Ironic"},{"line_number":617,"context_line":"        # resource class"},{"line_number":618,"context_line":"        self.report_client.set_provider_inventory("},{"line_number":619,"context_line":"            cn.uuid,"},{"line_number":620,"context_line":"            cn.hypervisor_hostname,"},{"line_number":621,"context_line":"            inv_data,"},{"line_number":622,"context_line":"        )"},{"line_number":623,"context_line":"        msg \u003d _LI("},{"line_number":624,"context_line":"            \"Successfully set inventory to %(inv_data)s on \""},{"line_number":625,"context_line":"            \"baremetal node %(nodename)s against resource provider \""},{"line_number":626,"context_line":"            \"%(resource_provider)s.\""},{"line_number":627,"context_line":"        )"},{"line_number":628,"context_line":"        msg_args \u003d {"},{"line_number":629,"context_line":"            \u0027inv_data\u0027: inv_data,"},{"line_number":630,"context_line":"            \u0027nodename\u0027: cn.hypervisor_hostname,"},{"line_number":631,"context_line":"            \u0027resource_provider\u0027: cn.uuid,"},{"line_number":632,"context_line":"        }"},{"line_number":633,"context_line":"        LOG.info(msg, msg_args)"},{"line_number":634,"context_line":""},{"line_number":635,"context_line":"        # Finally, consume all the inventory records with the original"},{"line_number":636,"context_line":"        # instance, creating allocation records for each resource class in the"}],"source_content_type":"text/x-python","patch_set":31,"id":"1a430d35_1969e58b","line":633,"range":{"start_line":616,"start_character":8,"end_line":633,"end_character":31},"in_reply_to":"1a430d35_782b0c31","updated":"2017-02-06 19:07:54.000000000","message":"This is a NOOP if the inventory doesn\u0027t change:\n\nhttps://github.com/openstack/nova/blob/master/nova/scheduler/client/report.py#L467\n\n(well, not technically a NOOP since we isue a GET, but it\u0027s not a continued PUT request...)","commit_id":"5f777edbbc798450e749c3b2728a519b6907cfa5"}],"nova/exception.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"fa5f97e6743fd63f7ba19dd1749a20f2428884e7","unresolved":false,"context_lines":[{"line_number":2098,"context_line":"                \"Please retry your update\")"},{"line_number":2099,"context_line":""},{"line_number":2100,"context_line":""},{"line_number":2101,"context_line":"class InvalidResourceClass(Invalid):"},{"line_number":2102,"context_line":"    msg_fmt \u003d _(\"Invalid resource class %(resource_class)s.\")"},{"line_number":2103,"context_line":""},{"line_number":2104,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"ba5201f7_205f41e6","line":2101,"updated":"2017-01-04 15:35:07.000000000","message":"I\u0027m surprised we didn\u0027t already have one of these, but I guess that\u0027s because we do the custom validation at the HTTP layer, not the object layer.","commit_id":"6e8c43e3fd75a67ddca96815fa1c7e82d93e0f92"}],"nova/scheduler/client/report.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"0859b5c74e8a9430e054ec29cb844a52a99392a3","unresolved":false,"context_lines":[{"line_number":175,"context_line":"            additional_headers\u003dheaders,"},{"line_number":176,"context_line":"        )"},{"line_number":177,"context_line":"        # TODO(sdague): use this to disable fully when we don\u0027t find"},{"line_number":178,"context_line":"        # the endpoint."},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def get(self, url):"},{"line_number":181,"context_line":"        return self._client.get("}],"source_content_type":"text/x-python","patch_set":17,"id":"7a3c09a3_07ba4c0a","line":178,"updated":"2017-01-16 20:20:24.000000000","message":"Is this todo associated with anything?","commit_id":"a546a114fc4c38337f64cabd329eca303e3ca59f"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":172,"context_line":"        self._warn_count \u003d 0"},{"line_number":173,"context_line":"        headers \u003d {"},{"line_number":174,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027,"},{"line_number":175,"context_line":"        }"},{"line_number":176,"context_line":"        self._client \u003d session.Session("},{"line_number":177,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_6de33506","line":174,"range":{"start_line":174,"start_character":48,"end_line":174,"end_character":54},"updated":"2017-01-26 16:41:27.000000000","message":"Is this a rebase failure? We don\u0027t want to be requesting \u0027latest\u0027 from the client side.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e9054ea4b240de0172a5fec41439909b2f08e02","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":172,"context_line":"        self._warn_count \u003d 0"},{"line_number":173,"context_line":"        headers \u003d {"},{"line_number":174,"context_line":"            \u0027OpenStack-API-Version\u0027: \u0027placement latest\u0027,"},{"line_number":175,"context_line":"        }"},{"line_number":176,"context_line":"        self._client \u003d session.Session("},{"line_number":177,"context_line":"            auth\u003dauth_plugin,"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_d88f8521","line":174,"range":{"start_line":174,"start_character":48,"end_line":174,"end_character":54},"in_reply_to":"3a461143_6de33506","updated":"2017-01-26 18:12:55.000000000","message":"That\u0027s been in since PS 8. I\u0027ll remove it.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":244,"context_line":"            }"},{"line_number":245,"context_line":"            LOG.error(msg, args)"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def get_or_create_resource_class(self, name):"},{"line_number":248,"context_line":"        \"\"\"Queries the placement API for a resource class supplied resource"},{"line_number":249,"context_line":"        class string name. If the resource class does not exist, creates it."},{"line_number":250,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_0db551ed","line":247,"range":{"start_line":247,"start_character":8,"end_line":247,"end_character":36},"updated":"2017-01-26 16:41:27.000000000","message":"This is making a GET (and POST) call but isn\u0027t decorated with @safe_connect.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e9054ea4b240de0172a5fec41439909b2f08e02","unresolved":false,"context_lines":[{"line_number":244,"context_line":"            }"},{"line_number":245,"context_line":"            LOG.error(msg, args)"},{"line_number":246,"context_line":""},{"line_number":247,"context_line":"    def get_or_create_resource_class(self, name):"},{"line_number":248,"context_line":"        \"\"\"Queries the placement API for a resource class supplied resource"},{"line_number":249,"context_line":"        class string name. If the resource class does not exist, creates it."},{"line_number":250,"context_line":""}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_f915239b","line":247,"range":{"start_line":247,"start_character":8,"end_line":247,"end_character":36},"in_reply_to":"3a461143_0db551ed","updated":"2017-01-26 18:12:55.000000000","message":"Done","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":252,"context_line":""},{"line_number":253,"context_line":"        :param name: String name of the resource class to check/create."},{"line_number":254,"context_line":"        \"\"\""},{"line_number":255,"context_line":"        resp \u003d self.get(\"/resource_classes/%s\" % name)"},{"line_number":256,"context_line":"        if resp.status_code \u003d\u003d 200:"},{"line_number":257,"context_line":"            return name"},{"line_number":258,"context_line":"        elif resp.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_cd8fc921","line":255,"updated":"2017-01-26 16:41:27.000000000","message":"Should be passing version\u003d\u00271.2\u0027 to the get() method. Then we can avoid the \u0027latest\u0027 microversion in the init.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e9054ea4b240de0172a5fec41439909b2f08e02","unresolved":false,"context_lines":[{"line_number":252,"context_line":""},{"line_number":253,"context_line":"        :param name: String name of the resource class to check/create."},{"line_number":254,"context_line":"        \"\"\""},{"line_number":255,"context_line":"        resp \u003d self.get(\"/resource_classes/%s\" % name)"},{"line_number":256,"context_line":"        if resp.status_code \u003d\u003d 200:"},{"line_number":257,"context_line":"            return name"},{"line_number":258,"context_line":"        elif resp.status_code \u003d\u003d 404:"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_59271712","line":255,"in_reply_to":"3a461143_cd8fc921","updated":"2017-01-26 18:12:55.000000000","message":"Done","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        :returns: None on successful creation."},{"line_number":277,"context_line":"        :raises: `exception.ResourceClassInvalid` upon error."},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        :param name: String name of the resource class to create."},{"line_number":280,"context_line":"        \"\"\""},{"line_number":281,"context_line":"        url \u003d \"/resource_classes\""},{"line_number":282,"context_line":"        payload \u003d {"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_adeefdb1","line":279,"updated":"2017-01-26 16:41:27.000000000","message":"nit: param usually goes between the description and the returns/raises stuff.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e9054ea4b240de0172a5fec41439909b2f08e02","unresolved":false,"context_lines":[{"line_number":276,"context_line":"        :returns: None on successful creation."},{"line_number":277,"context_line":"        :raises: `exception.ResourceClassInvalid` upon error."},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        :param name: String name of the resource class to create."},{"line_number":280,"context_line":"        \"\"\""},{"line_number":281,"context_line":"        url \u003d \"/resource_classes\""},{"line_number":282,"context_line":"        payload \u003d {"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_b91c7bc2","line":279,"in_reply_to":"3a461143_adeefdb1","updated":"2017-01-26 18:12:55.000000000","message":"Done","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"962b0a335c8ecd4fd6b856583a9ba051e5510970","unresolved":false,"context_lines":[{"line_number":282,"context_line":"        payload \u003d {"},{"line_number":283,"context_line":"            \u0027name\u0027: name,"},{"line_number":284,"context_line":"        }"},{"line_number":285,"context_line":"        resp \u003d self.post(url, payload)"},{"line_number":286,"context_line":"        if resp.status_code \u003d\u003d 201:"},{"line_number":287,"context_line":"            msg \u003d _LI(\"Created resource class record via placement API \""},{"line_number":288,"context_line":"                      \"for resource class %s.\")"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_4d03d942","line":285,"updated":"2017-01-26 16:41:27.000000000","message":"I think we\u0027re going to want to plumb the 1.2 microversion into the post() method like we have for get() so we don\u0027t have to rely on \u0027latest\u0027 in the init.","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"7e9054ea4b240de0172a5fec41439909b2f08e02","unresolved":false,"context_lines":[{"line_number":282,"context_line":"        payload \u003d {"},{"line_number":283,"context_line":"            \u0027name\u0027: name,"},{"line_number":284,"context_line":"        }"},{"line_number":285,"context_line":"        resp \u003d self.post(url, payload)"},{"line_number":286,"context_line":"        if resp.status_code \u003d\u003d 201:"},{"line_number":287,"context_line":"            msg \u003d _LI(\"Created resource class record via placement API \""},{"line_number":288,"context_line":"                      \"for resource class %s.\")"}],"source_content_type":"text/x-python","patch_set":20,"id":"3a461143_2bf4b2f0","line":285,"in_reply_to":"3a461143_4d03d942","updated":"2017-01-26 18:12:55.000000000","message":"Added to both post() and put().","commit_id":"013dd62b3d81974a5765b70be0a776af6c3f22fd"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bd450e5d2024d25c29881726cc1ba4c0556089f","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        self._client \u003d session.Session(auth\u003dauth_plugin)"},{"line_number":172,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":173,"context_line":"        self._warn_count \u003d 0"},{"line_number":174,"context_line":"        # TODO(sdague): use this to disable fully when we don\u0027t find"},{"line_number":175,"context_line":"        # the endpoint."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def get(self, url, version\u003dNone):"},{"line_number":178,"context_line":"        kwargs \u003d {}"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_bf2e11f8","line":175,"range":{"start_line":174,"start_character":8,"end_line":175,"end_character":23},"updated":"2017-01-26 22:24:46.000000000","message":"We don\u0027t need this - rebase issue?","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8f47206bab1c47ad8a3838f9099c94a380e7b603","unresolved":false,"context_lines":[{"line_number":171,"context_line":"        self._client \u003d session.Session(auth\u003dauth_plugin)"},{"line_number":172,"context_line":"        # NOTE(danms): Keep track of how naggy we\u0027ve been"},{"line_number":173,"context_line":"        self._warn_count \u003d 0"},{"line_number":174,"context_line":"        # TODO(sdague): use this to disable fully when we don\u0027t find"},{"line_number":175,"context_line":"        # the endpoint."},{"line_number":176,"context_line":""},{"line_number":177,"context_line":"    def get(self, url, version\u003dNone):"},{"line_number":178,"context_line":"        kwargs \u003d {}"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_0b0d273e","line":175,"range":{"start_line":174,"start_character":8,"end_line":175,"end_character":23},"in_reply_to":"3a461143_bf2e11f8","updated":"2017-01-27 01:43:39.000000000","message":"Done","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bd450e5d2024d25c29881726cc1ba4c0556089f","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            url, json\u003ddata,"},{"line_number":205,"context_line":"            endpoint_filter\u003dself.ks_filter, raise_exc\u003dFalse, **kwargs)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def put(self, url, data, version\u003dNone):"},{"line_number":208,"context_line":"        kwargs \u003d {}"},{"line_number":209,"context_line":"        if version is not None:"},{"line_number":210,"context_line":"            # TODO(mriedem): Perform some version discovery at some point."},{"line_number":211,"context_line":"            kwargs \u003d {"},{"line_number":212,"context_line":"                \u0027headers\u0027: {"},{"line_number":213,"context_line":"                    \u0027OpenStack-API-Version\u0027: \u0027placement %s\u0027 % version"},{"line_number":214,"context_line":"                },"},{"line_number":215,"context_line":"            }"},{"line_number":216,"context_line":"        # NOTE(sdague): using json\u003d instead of data\u003d sets the"},{"line_number":217,"context_line":"        # media type to application/json for us. Placement API is"},{"line_number":218,"context_line":"        # more sensitive to this than other APIs in the OpenStack"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_25d93284","line":215,"range":{"start_line":207,"start_character":4,"end_line":215,"end_character":13},"updated":"2017-01-26 22:24:46.000000000","message":"not really necessary for this change...","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8f47206bab1c47ad8a3838f9099c94a380e7b603","unresolved":false,"context_lines":[{"line_number":204,"context_line":"            url, json\u003ddata,"},{"line_number":205,"context_line":"            endpoint_filter\u003dself.ks_filter, raise_exc\u003dFalse, **kwargs)"},{"line_number":206,"context_line":""},{"line_number":207,"context_line":"    def put(self, url, data, version\u003dNone):"},{"line_number":208,"context_line":"        kwargs \u003d {}"},{"line_number":209,"context_line":"        if version is not None:"},{"line_number":210,"context_line":"            # TODO(mriedem): Perform some version discovery at some point."},{"line_number":211,"context_line":"            kwargs \u003d {"},{"line_number":212,"context_line":"                \u0027headers\u0027: {"},{"line_number":213,"context_line":"                    \u0027OpenStack-API-Version\u0027: \u0027placement %s\u0027 % version"},{"line_number":214,"context_line":"                },"},{"line_number":215,"context_line":"            }"},{"line_number":216,"context_line":"        # NOTE(sdague): using json\u003d instead of data\u003d sets the"},{"line_number":217,"context_line":"        # media type to application/json for us. Placement API is"},{"line_number":218,"context_line":"        # more sensitive to this than other APIs in the OpenStack"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_6b022b0d","line":215,"range":{"start_line":207,"start_character":4,"end_line":215,"end_character":13},"in_reply_to":"3a461143_25d93284","updated":"2017-01-27 01:43:39.000000000","message":"True, but it\u0027s better to follow the pattern throughout the methods.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bd450e5d2024d25c29881726cc1ba4c0556089f","unresolved":false,"context_lines":[{"line_number":796,"context_line":"        self._ensure_resource_provider(rp_uuid, rp_name)"},{"line_number":797,"context_line":"        self._update_inventory(rp_uuid, inv_data)"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"    def create_provider_allocations(self, rp_uuid, consumer_uuid, alloc_data):"},{"line_number":800,"context_line":"        \"\"\"Used to manually create allocation records against a resource"},{"line_number":801,"context_line":"        provider."},{"line_number":802,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_65e33a34","line":799,"updated":"2017-01-26 22:24:46.000000000","message":"Is this tested anywhere?","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8f47206bab1c47ad8a3838f9099c94a380e7b603","unresolved":false,"context_lines":[{"line_number":796,"context_line":"        self._ensure_resource_provider(rp_uuid, rp_name)"},{"line_number":797,"context_line":"        self._update_inventory(rp_uuid, inv_data)"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"    def create_provider_allocations(self, rp_uuid, consumer_uuid, alloc_data):"},{"line_number":800,"context_line":"        \"\"\"Used to manually create allocation records against a resource"},{"line_number":801,"context_line":"        provider."},{"line_number":802,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_bd9536e5","line":799,"in_reply_to":"3a461143_65e33a34","updated":"2017-01-27 01:43:39.000000000","message":"Not that I can see. Since this is just a pass-through to _put_allocations, I added some tests for that method.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"56243d299ad644a35499e99b2c8dc5358bac5d2e","unresolved":false,"context_lines":[{"line_number":796,"context_line":"        self._ensure_resource_provider(rp_uuid, rp_name)"},{"line_number":797,"context_line":"        self._update_inventory(rp_uuid, inv_data)"},{"line_number":798,"context_line":""},{"line_number":799,"context_line":"    def create_provider_allocations(self, rp_uuid, consumer_uuid, alloc_data):"},{"line_number":800,"context_line":"        \"\"\"Used to manually create allocation records against a resource"},{"line_number":801,"context_line":"        provider."},{"line_number":802,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_4c78222c","line":799,"in_reply_to":"3a461143_bd9536e5","updated":"2017-01-27 03:45:36.000000000","message":"I think we already have some tests for _put_allocations, but OK.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"b6f30313ce826c59f26100d4d9c213565524350f","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        DISK_GB: disk,"},{"line_number":137,"context_line":"    }"},{"line_number":138,"context_line":"    # Remove any zero allocations."},{"line_number":139,"context_line":"    return {key: val for key, val in alloc_dict.items() if val}"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"def _extract_inventory_in_use(body):"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_bd8a7dbd","line":139,"updated":"2017-01-27 15:07:47.000000000","message":"Doesn\u0027t this now need to be ironic aware?","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"892cfbc8595ea059a02454dab9b30fd5b617c104","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        DISK_GB: disk,"},{"line_number":137,"context_line":"    }"},{"line_number":138,"context_line":"    # Remove any zero allocations."},{"line_number":139,"context_line":"    return {key: val for key, val in alloc_dict.items() if val}"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"def _extract_inventory_in_use(body):"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_80ff1866","line":139,"in_reply_to":"3a461143_4000d001","updated":"2017-01-27 15:20:37.000000000","message":"All I could see what this:\nhttps://github.com/openstack/nova/blob/e1a4d0618df1836d3fcd04ebe3597275b7deb361/nova/compute/resource_tracker.py#L919\n\nThe bit I am missing is where we create the new ironic resource_class for instances we create.\n\nIt seems like we would fail with resource class not found here, if that resource_class was set up in ironic.","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"6c3a07b615fedd9fefb633b67a555a3c1bf0462f","unresolved":false,"context_lines":[{"line_number":136,"context_line":"        DISK_GB: disk,"},{"line_number":137,"context_line":"    }"},{"line_number":138,"context_line":"    # Remove any zero allocations."},{"line_number":139,"context_line":"    return {key: val for key, val in alloc_dict.items() if val}"},{"line_number":140,"context_line":""},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"def _extract_inventory_in_use(body):"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_4000d001","line":139,"in_reply_to":"3a461143_bd8a7dbd","updated":"2017-01-27 15:10:08.000000000","message":"I don\u0027t believe this is called in the case of Ironic now *unless* the node.resource_class on the Ironic side isn\u0027t set. So that\u0027s the thing to keep in mind about this patch - none of the fancy new code gets hit unless the node.resource_class is set, which it isn\u0027t in any of our CI testing.","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"7007e04544749f58c5798eb5144a32283d3e0b19","unresolved":false,"context_lines":[{"line_number":193,"context_line":"                \u0027headers\u0027: {"},{"line_number":194,"context_line":"                    \u0027OpenStack-API-Version\u0027: \u0027placement %s\u0027 % version"},{"line_number":195,"context_line":"                },"},{"line_number":196,"context_line":"            }"},{"line_number":197,"context_line":"        # NOTE(sdague): using json\u003d instead of data\u003d sets the"},{"line_number":198,"context_line":"        # media type to application/json for us. Placement API is"},{"line_number":199,"context_line":"        # more sensitive to this than other APIs in the OpenStack"}],"source_content_type":"text/x-python","patch_set":23,"id":"3a461143_5dbb630e","line":196,"updated":"2017-01-27 11:03:43.000000000","message":"We should clean up the duplication related to this stuff at some point (not now).","commit_id":"b6339a876a440831903445bd4b10afb732e91335"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"aa51861818961a4081ffcc4ba6bf245b7da2ea17","unresolved":false,"context_lines":[{"line_number":800,"context_line":"        :param inv_data: A dict, keyed by resource class, of inventory"},{"line_number":801,"context_line":"                         information for each resource provided."},{"line_number":802,"context_line":"        \"\"\""},{"line_number":803,"context_line":"        self._ensure_resource_provider(rp_uuid, rp_name)"},{"line_number":804,"context_line":"        self._update_inventory(rp_uuid, inv_data)"},{"line_number":805,"context_line":""},{"line_number":806,"context_line":"    def create_provider_allocations(self, rp_uuid, consumer_uuid, alloc_data):"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_b5add0ea","line":803,"updated":"2017-01-31 13:48:44.000000000","message":"Just a question for better understanding of this.\n\nIf I read the code correctly, this will create resource provider not belonging to any aggregate. Is scheduler already able to do resource provider filtering based on availability zone requested?","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"7b35b3a1018dc49b912ad70823c2a601aa0c2126","unresolved":false,"context_lines":[{"line_number":800,"context_line":"        :param inv_data: A dict, keyed by resource class, of inventory"},{"line_number":801,"context_line":"                         information for each resource provided."},{"line_number":802,"context_line":"        \"\"\""},{"line_number":803,"context_line":"        self._ensure_resource_provider(rp_uuid, rp_name)"},{"line_number":804,"context_line":"        self._update_inventory(rp_uuid, inv_data)"},{"line_number":805,"context_line":""},{"line_number":806,"context_line":"    def create_provider_allocations(self, rp_uuid, consumer_uuid, alloc_data):"}],"source_content_type":"text/x-python","patch_set":28,"id":"3a461143_f5ecb8bc","line":803,"in_reply_to":"3a461143_b5add0ea","updated":"2017-01-31 13:56:54.000000000","message":"Hi @vdrok! The availability zone filtering is done on a second pass within the Nova scheduler. These qualitative aspects of the request spec will eventually be handled by the placement API, but not until at earliest Pike.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"c127bfd736cba32baaeafdea34440adb2f6814a7","unresolved":false,"context_lines":[{"line_number":558,"context_line":"            \u0027resource_provider_generation\u0027: cur_rp_gen,"},{"line_number":559,"context_line":"            \u0027inventories\u0027: inv_data,"},{"line_number":560,"context_line":"        }"},{"line_number":561,"context_line":""},{"line_number":562,"context_line":"        url \u003d \u0027/resource_providers/%s/inventories\u0027 % rp_uuid"},{"line_number":563,"context_line":"        result \u003d self.put(url, payload)"},{"line_number":564,"context_line":"        if result.status_code \u003d\u003d 409:"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_8947ae4a","line":561,"updated":"2017-02-01 16:51:17.000000000","message":"nit: unrelated whitespace change","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"}],"nova/tests/functional/api/openstack/placement/fixtures.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"class IronicFixture(APIFixture):"},{"line_number":142,"context_line":"    \"\"\"An APIFixture that is set up to test Ironic nodes.\"\"\""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def start_fixture(self):"},{"line_number":145,"context_line":"        super(IronicFixture, self).start_fixture()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_0028fd31","line":142,"updated":"2017-02-01 11:43:25.000000000","message":"I think this fixture should be deleted, it\u0027s not testing anything that isn\u0027t tested elsewhere and isn\u0027t relevant to this change.","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"c127bfd736cba32baaeafdea34440adb2f6814a7","unresolved":false,"context_lines":[{"line_number":139,"context_line":""},{"line_number":140,"context_line":""},{"line_number":141,"context_line":"class IronicFixture(APIFixture):"},{"line_number":142,"context_line":"    \"\"\"An APIFixture that is set up to test Ironic nodes.\"\"\""},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"    def start_fixture(self):"},{"line_number":145,"context_line":"        super(IronicFixture, self).start_fixture()"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_e9f11203","line":142,"in_reply_to":"3a461143_0028fd31","updated":"2017-02-01 16:51:17.000000000","message":"Agree. It was meant to form the basis of a series of tests, but since they aren\u0027t being developed in this change, we can remove it.","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"}],"nova/tests/functional/api/openstack/placement/gabbits/ironic-inventory.yaml":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b654caa81df5d7d5ee121db4e8b52d686a093948","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":28,"id":"3a461143_7b28b933","updated":"2017-01-31 14:30:03.000000000","message":"I don\u0027t think a gabbi test is what we need or want here. We need to be testing the resource tracker, which none of this will hit.","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"b654caa81df5d7d5ee121db4e8b52d686a093948","unresolved":false,"context_lines":[{"line_number":13,"context_line":"      $.inventories.`len`: 4"},{"line_number":14,"context_line":"      $.inventories.DISK_GB.total: 2048"},{"line_number":15,"context_line":"      $.inventories.DISK_GB.reserved: 0"},{"line_number":16,"context_line":"      # Don\u0027t know how to make this dynamic for the class name..."},{"line_number":17,"context_line":"      $.inventories.CUSTOM_IRONIC_TEST.total: 1"},{"line_number":18,"context_line":"      $.inventories.CUSTOM_IRONIC_TEST.step_size: 1"},{"line_number":19,"context_line":"      $.inventories.CUSTOM_IRONIC_TEST.min_unit: 1"}],"source_content_type":"text/x-yaml","patch_set":28,"id":"3a461143_3b0b91d7","line":16,"updated":"2017-01-31 14:30:03.000000000","message":"LHS template variable substitution in jsonpath isn\u0027t something gabbi can do yet: https://github.com/cdent/gabbi/issues/170","commit_id":"855e994a1c8b9a2117f8332c12c6e66c4404f8db"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":29,"id":"3a461143_a02e4940","updated":"2017-02-01 11:43:25.000000000","message":"I think this should be deleted, it\u0027s not testing anything that isn\u0027t tested elsewhere and isn\u0027t relevant to this change.","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"c127bfd736cba32baaeafdea34440adb2f6814a7","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":29,"id":"3a461143_e9c832ab","in_reply_to":"3a461143_a02e4940","updated":"2017-02-01 16:51:17.000000000","message":"+1, for the reasons noted in the fixture.","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"}],"nova/tests/functional/compute/test_resource_tracker.py":[{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[{"line_number":150,"context_line":"        self.rt.report_client \u003d self.report_client"},{"line_number":151,"context_line":"        # TODO(cdent): Port required here to deal with a bug"},{"line_number":152,"context_line":"        # in wsgi-intercept:"},{"line_number":153,"context_line":"        # https://github.com/cdent/wsgi-intercept/issues/41"},{"line_number":154,"context_line":"        self.url \u003d \u0027http://localhost:80/placement\u0027"},{"line_number":155,"context_line":"        self.create_fixtures()"},{"line_number":156,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_20d419ea","line":153,"updated":"2017-02-01 11:43:25.000000000","message":"That bug has been fixed and the version in test-requirements has it, so it\u0027s okay to remove the port and the todo if inclined.","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[{"line_number":177,"context_line":"            instance.obj_set_defaults()"},{"line_number":178,"context_line":"            instance.create()"},{"line_number":179,"context_line":""},{"line_number":180,"context_line":"    def placement_get_inventory(self, rp_uuid):"},{"line_number":181,"context_line":"        url \u003d \u0027/resource_providers/%s/inventories\u0027 % rp_uuid"},{"line_number":182,"context_line":"        resp \u003d self.report_client.get(url)"},{"line_number":183,"context_line":"        if resp.status_code \u003d\u003d 200:"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_406be51d","line":180,"updated":"2017-02-01 11:43:25.000000000","message":"Just out of curiosity why did you decide to do these instead of stealing from the report client itself? Is it because it would have required using private methods?","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[{"line_number":291,"context_line":"            # inventory and allocations reset for the first compute node that"},{"line_number":292,"context_line":"            # had an instance on it. The new inventory and allocation records"},{"line_number":293,"context_line":"            # will be for VCPU, MEMORY_MB, DISK_GB, and also a new record for"},{"line_number":294,"context_line":"            # the custom resource class of the Ironic node."},{"line_number":295,"context_line":"            self.driver_mock.get_available_resource.return_value \u003d {"},{"line_number":296,"context_line":"                \u0027hypervisor_hostname\u0027: cn1_obj.hypervisor_hostname,"},{"line_number":297,"context_line":"                \u0027hypervisor_type\u0027: \u0027ironic\u0027,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_a065691e","line":294,"updated":"2017-02-01 11:43:25.000000000","message":"Should there also be a test for a completely new ironic node that has the resource class set?\n\nThat is, are we covering the case of a new ocata deployment with a new ironic that is aware of custom resource classes?","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"2792154563b251df5ffe4bb1bea58e1492515b9b","unresolved":false,"context_lines":[{"line_number":291,"context_line":"            # inventory and allocations reset for the first compute node that"},{"line_number":292,"context_line":"            # had an instance on it. The new inventory and allocation records"},{"line_number":293,"context_line":"            # will be for VCPU, MEMORY_MB, DISK_GB, and also a new record for"},{"line_number":294,"context_line":"            # the custom resource class of the Ironic node."},{"line_number":295,"context_line":"            self.driver_mock.get_available_resource.return_value \u003d {"},{"line_number":296,"context_line":"                \u0027hypervisor_hostname\u0027: cn1_obj.hypervisor_hostname,"},{"line_number":297,"context_line":"                \u0027hypervisor_type\u0027: \u0027ironic\u0027,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_c54a6b55","line":294,"in_reply_to":"3a461143_a065691e","updated":"2017-02-01 23:33:50.000000000","message":"I think that this covers the case, as the RT will handle the adding of ironic allocation/inventory identically. The only difference I see is that the clearing of existing stuff would be a noop for a completely new node.","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[{"line_number":303,"context_line":"                \u0027local_gb\u0027: cn1_obj.local_gb,"},{"line_number":304,"context_line":"                \u0027local_gb_used\u0027: cn1_obj.local_gb_used,"},{"line_number":305,"context_line":"                \u0027numa_topology\u0027: None,"},{"line_number":306,"context_line":"                # Deliberately named to trigger normalization..."},{"line_number":307,"context_line":"                \u0027resource_class\u0027: \u0027small-iron\u0027,"},{"line_number":308,"context_line":"            }"},{"line_number":309,"context_line":"            self.rt.update_available_resource(self.ctx, cn1_nodename)"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_00eabd73","line":306,"updated":"2017-02-01 11:43:25.000000000","message":"+1","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"}],"nova/tests/unit/compute/test_resource_tracker.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bd450e5d2024d25c29881726cc1ba4c0556089f","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"        # placement API expects for a custom resource class name"},{"line_number":1158,"context_line":"        new_rc_name \u003d \u0027CUSTOM_FOO\u0027"},{"line_number":1159,"context_line":"        self.rt._ensure_ironic_node_class(rc_name)"},{"line_number":1160,"context_line":"        self.assertEqual(\u0027CUSTOM_FOO\u0027, new_rc_name)"},{"line_number":1161,"context_line":"        g_or_c_mock \u003d self.sched_client_mock.get_or_create_resource_class"},{"line_number":1162,"context_line":"        g_or_c_mock.assert_called_once_with(new_rc_name)"},{"line_number":1163,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_0a036543","line":1160,"range":{"start_line":1160,"start_character":8,"end_line":1160,"end_character":51},"updated":"2017-01-26 22:24:46.000000000","message":"This is pointless because new_rc_name was never changed, I assume this was meant to trap the value from the _ensure_ironic_node_class call and compare the results.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8f47206bab1c47ad8a3838f9099c94a380e7b603","unresolved":false,"context_lines":[{"line_number":1157,"context_line":"        # placement API expects for a custom resource class name"},{"line_number":1158,"context_line":"        new_rc_name \u003d \u0027CUSTOM_FOO\u0027"},{"line_number":1159,"context_line":"        self.rt._ensure_ironic_node_class(rc_name)"},{"line_number":1160,"context_line":"        self.assertEqual(\u0027CUSTOM_FOO\u0027, new_rc_name)"},{"line_number":1161,"context_line":"        g_or_c_mock \u003d self.sched_client_mock.get_or_create_resource_class"},{"line_number":1162,"context_line":"        g_or_c_mock.assert_called_once_with(new_rc_name)"},{"line_number":1163,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_13d559b8","line":1160,"range":{"start_line":1160,"start_character":8,"end_line":1160,"end_character":51},"in_reply_to":"3a461143_0a036543","updated":"2017-01-27 01:43:39.000000000","message":"Yeah, this isn\u0027t well-structured. I\u0027m going to refactor out the name normalization and test that separately.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[{"line_number":1253,"context_line":"        compute_node \u003d _COMPUTE_NODE_FIXTURES[0].obj_clone()"},{"line_number":1254,"context_line":"        compute_node.hypervisor_type \u003d \u0027ironic\u0027"},{"line_number":1255,"context_line":"        self.rt._handle_ironic_allocations(compute_node, inst)"},{"line_number":1256,"context_line":"        self.assertFalse(uis.called)"},{"line_number":1257,"context_line":"        expected_alloc_data \u003d {"},{"line_number":1258,"context_line":"            mock.sentinel.node_rc: 1,"},{"line_number":1259,"context_line":"            \u0027VCPU\u0027: compute_node.vcpus,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_9bd29e5a","line":1256,"updated":"2017-02-01 11:43:25.000000000","message":"this is failing, not clear why","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cc02a547726bc173bc4c7f8e32e06cbb7a4f1dd6","unresolved":false,"context_lines":[{"line_number":1253,"context_line":"        compute_node \u003d _COMPUTE_NODE_FIXTURES[0].obj_clone()"},{"line_number":1254,"context_line":"        compute_node.hypervisor_type \u003d \u0027ironic\u0027"},{"line_number":1255,"context_line":"        self.rt._handle_ironic_allocations(compute_node, inst)"},{"line_number":1256,"context_line":"        self.assertFalse(uis.called)"},{"line_number":1257,"context_line":"        expected_alloc_data \u003d {"},{"line_number":1258,"context_line":"            mock.sentinel.node_rc: 1,"},{"line_number":1259,"context_line":"            \u0027VCPU\u0027: compute_node.vcpus,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_76d507e3","line":1256,"in_reply_to":"3a461143_9bd29e5a","updated":"2017-02-01 12:20:10.000000000","message":"From looking at the code I think test is just wrong. This should be assertTrue because the code says \"if this instance has resource_class and the existing allocations are not exactly 4, reset them\"\n\nand the reset process calls update_instance_allocation","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"cc02a547726bc173bc4c7f8e32e06cbb7a4f1dd6","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"        self.rt._handle_ironic_allocations(compute_node, inst)"},{"line_number":1256,"context_line":"        self.assertFalse(uis.called)"},{"line_number":1257,"context_line":"        expected_alloc_data \u003d {"},{"line_number":1258,"context_line":"            mock.sentinel.node_rc: 1,"},{"line_number":1259,"context_line":"            \u0027VCPU\u0027: compute_node.vcpus,"},{"line_number":1260,"context_line":"            \u0027MEMORY_MB\u0027: compute_node.memory_mb,"},{"line_number":1261,"context_line":"            \u0027DISK_GB\u0027: compute_node.local_gb,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_b6092f97","line":1258,"updated":"2017-02-01 12:20:10.000000000","message":"This should be \u0027CUSTOM_TEST\u0027","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"c127bfd736cba32baaeafdea34440adb2f6814a7","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"        self.rt._handle_ironic_allocations(compute_node, inst)"},{"line_number":1256,"context_line":"        self.assertFalse(uis.called)"},{"line_number":1257,"context_line":"        expected_alloc_data \u003d {"},{"line_number":1258,"context_line":"            mock.sentinel.node_rc: 1,"},{"line_number":1259,"context_line":"            \u0027VCPU\u0027: compute_node.vcpus,"},{"line_number":1260,"context_line":"            \u0027MEMORY_MB\u0027: compute_node.memory_mb,"},{"line_number":1261,"context_line":"            \u0027DISK_GB\u0027: compute_node.local_gb,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_ec7a0077","line":1258,"in_reply_to":"3a461143_b6092f97","updated":"2017-02-01 16:51:17.000000000","message":"I think it would be cleaner and more consistent to change line 1247 to mock.sentinel.node_rc","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"2792154563b251df5ffe4bb1bea58e1492515b9b","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"        self.rt._handle_ironic_allocations(compute_node, inst)"},{"line_number":1256,"context_line":"        self.assertFalse(uis.called)"},{"line_number":1257,"context_line":"        expected_alloc_data \u003d {"},{"line_number":1258,"context_line":"            mock.sentinel.node_rc: 1,"},{"line_number":1259,"context_line":"            \u0027VCPU\u0027: compute_node.vcpus,"},{"line_number":1260,"context_line":"            \u0027MEMORY_MB\u0027: compute_node.memory_mb,"},{"line_number":1261,"context_line":"            \u0027DISK_GB\u0027: compute_node.local_gb,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_85aea3e5","line":1258,"in_reply_to":"3a461143_c7727db0","updated":"2017-02-01 23:33:50.000000000","message":"yep, the upper() would fail. I\u0027ll switch it on 1258","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"e070d4db26efecc9318c9e81ca949443339a7bf6","unresolved":false,"context_lines":[{"line_number":1255,"context_line":"        self.rt._handle_ironic_allocations(compute_node, inst)"},{"line_number":1256,"context_line":"        self.assertFalse(uis.called)"},{"line_number":1257,"context_line":"        expected_alloc_data \u003d {"},{"line_number":1258,"context_line":"            mock.sentinel.node_rc: 1,"},{"line_number":1259,"context_line":"            \u0027VCPU\u0027: compute_node.vcpus,"},{"line_number":1260,"context_line":"            \u0027MEMORY_MB\u0027: compute_node.memory_mb,"},{"line_number":1261,"context_line":"            \u0027DISK_GB\u0027: compute_node.local_gb,"}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_c7727db0","line":1258,"in_reply_to":"3a461143_ec7a0077","updated":"2017-02-01 17:00:53.000000000","message":"That won\u0027t work Ed, as the mock.sentinel needs to pass through the normalization routines, and doesn\u0027t support the upper() method.\n\ncould certainly make sense to assign resource_class \u003d \u0027CUSTOM_TEST\u0027 above and then use it in 1247 and 1258","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"52ab625f520bf18d758f86ecc7ce0385484676f9","unresolved":false,"context_lines":[{"line_number":1272,"context_line":"        compute_node \u003d _COMPUTE_NODE_FIXTURES[0].obj_clone()"},{"line_number":1273,"context_line":"        compute_node.hypervisor_type \u003d \u0027ironic\u0027"},{"line_number":1274,"context_line":"        self.rt._handle_ironic_allocations(compute_node, inst)"},{"line_number":1275,"context_line":"        uis.assert_called_once_with(compute_node, inst, -1)"},{"line_number":1276,"context_line":"        self.assertFalse(cpa.called)"},{"line_number":1277,"context_line":""},{"line_number":1278,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_5bbd9600","line":1275,"updated":"2017-02-01 11:43:25.000000000","message":"this is failing, with the wrong sign (1 instead of -1), haven\u0027t yet had a change to investigate more closely","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"},{"author":{"_account_id":11564,"name":"Chris Dent","email":"cdent@anticdent.org","username":"chdent"},"change_message_id":"1a08ae04419a4cb2691080c9713530ddcc8c962e","unresolved":false,"context_lines":[{"line_number":1272,"context_line":"        compute_node \u003d _COMPUTE_NODE_FIXTURES[0].obj_clone()"},{"line_number":1273,"context_line":"        compute_node.hypervisor_type \u003d \u0027ironic\u0027"},{"line_number":1274,"context_line":"        self.rt._handle_ironic_allocations(compute_node, inst)"},{"line_number":1275,"context_line":"        uis.assert_called_once_with(compute_node, inst, -1)"},{"line_number":1276,"context_line":"        self.assertFalse(cpa.called)"},{"line_number":1277,"context_line":""},{"line_number":1278,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a461143_76b3474d","line":1275,"in_reply_to":"3a461143_5bbd9600","updated":"2017-02-01 12:07:53.000000000","message":"Since the resource_class is not being set then the bm_node_class is None in _handle_ironic_allocations so the call to update_instance_allocation will be a 1, the \"normal\" call to update allocations without resource class.\n\nSo the fix here is switch the -1 to 1 and perhaps assert ironic_node_to_inventory dict was not called?","commit_id":"f51a3aee33c590fa60ae293ff6f84ca8a899d33d"}],"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":"9bd450e5d2024d25c29881726cc1ba4c0556089f","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        report.SchedulerReportClient()"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        load_auth_mock.assert_called_once_with(CONF, \u0027placement\u0027)"},{"line_number":125,"context_line":"        ks_sess_mock.assert_called_once_with("},{"line_number":126,"context_line":"            auth\u003dload_auth_mock.return_value,"},{"line_number":127,"context_line":"        )"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"class SchedulerReportClientTestCase(test.NoDBTestCase):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_4a300d02","line":127,"range":{"start_line":125,"start_character":8,"end_line":127,"end_character":9},"updated":"2017-01-26 22:24:46.000000000","message":"nit: didn\u0027t need to change this","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"56243d299ad644a35499e99b2c8dc5358bac5d2e","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        report.SchedulerReportClient()"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        load_auth_mock.assert_called_once_with(CONF, \u0027placement\u0027)"},{"line_number":125,"context_line":"        ks_sess_mock.assert_called_once_with("},{"line_number":126,"context_line":"            auth\u003dload_auth_mock.return_value,"},{"line_number":127,"context_line":"        )"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"class SchedulerReportClientTestCase(test.NoDBTestCase):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_8c720a48","line":127,"range":{"start_line":125,"start_character":8,"end_line":127,"end_character":9},"in_reply_to":"3a461143_13ec798e","updated":"2017-01-27 03:45:36.000000000","message":"I think it was probably just wrapped when the microversion was passed, and when that was removed we didn\u0027t need it anymore.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8f47206bab1c47ad8a3838f9099c94a380e7b603","unresolved":false,"context_lines":[{"line_number":122,"context_line":"        report.SchedulerReportClient()"},{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        load_auth_mock.assert_called_once_with(CONF, \u0027placement\u0027)"},{"line_number":125,"context_line":"        ks_sess_mock.assert_called_once_with("},{"line_number":126,"context_line":"            auth\u003dload_auth_mock.return_value,"},{"line_number":127,"context_line":"        )"},{"line_number":128,"context_line":""},{"line_number":129,"context_line":""},{"line_number":130,"context_line":"class SchedulerReportClientTestCase(test.NoDBTestCase):"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_13ec798e","line":127,"range":{"start_line":125,"start_character":8,"end_line":127,"end_character":9},"in_reply_to":"3a461143_4a300d02","updated":"2017-01-27 01:43:39.000000000","message":"Well, you know Jay and his love of C formatting...","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"9bd450e5d2024d25c29881726cc1ba4c0556089f","unresolved":false,"context_lines":[{"line_number":556,"context_line":"            mock_post, mock_get):"},{"line_number":557,"context_line":"        mock_get.return_value.status_code \u003d 200"},{"line_number":558,"context_line":"        mock_get.return_value.json.return_value \u003d {"},{"line_number":559,"context_line":"            \u0027name\u0027: {"},{"line_number":560,"context_line":"                \u0027VCPU\u0027: {\u0027total\u0027: 16},"},{"line_number":561,"context_line":"                \u0027MEMORY_MB\u0027: {\u0027total\u0027: 1024},"},{"line_number":562,"context_line":"                \u0027DISK_GB\u0027: {\u0027total\u0027: 10},"},{"line_number":563,"context_line":"            }"},{"line_number":564,"context_line":"        }"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"        rc_name \u003d \u0027CUSTOM_FOO\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_655eda13","line":563,"range":{"start_line":559,"start_character":12,"end_line":563,"end_character":13},"updated":"2017-01-26 22:24:46.000000000","message":"This isn\u0027t what a GET on /resources_classes looks like. It\u0027d be name and links, and name would be CUSTOM_FOO.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"},{"author":{"_account_id":1063,"name":"Ed Leafe","email":"ed@leafe.com","username":"ed-leafe"},"change_message_id":"8f47206bab1c47ad8a3838f9099c94a380e7b603","unresolved":false,"context_lines":[{"line_number":556,"context_line":"            mock_post, mock_get):"},{"line_number":557,"context_line":"        mock_get.return_value.status_code \u003d 200"},{"line_number":558,"context_line":"        mock_get.return_value.json.return_value \u003d {"},{"line_number":559,"context_line":"            \u0027name\u0027: {"},{"line_number":560,"context_line":"                \u0027VCPU\u0027: {\u0027total\u0027: 16},"},{"line_number":561,"context_line":"                \u0027MEMORY_MB\u0027: {\u0027total\u0027: 1024},"},{"line_number":562,"context_line":"                \u0027DISK_GB\u0027: {\u0027total\u0027: 10},"},{"line_number":563,"context_line":"            }"},{"line_number":564,"context_line":"        }"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"        rc_name \u003d \u0027CUSTOM_FOO\u0027"}],"source_content_type":"text/x-python","patch_set":21,"id":"3a461143_133f19d7","line":563,"range":{"start_line":559,"start_character":12,"end_line":563,"end_character":13},"in_reply_to":"3a461143_655eda13","updated":"2017-01-27 01:43:39.000000000","message":"Yeah, this looks like a copy/paste fail.","commit_id":"8b372a3ef8dbafca7915be1502e50a9cbdb65b2e"}]}
