)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ab8ed5fed6bad60d1f232d34f1cba01638465ff6","unresolved":false,"context_lines":[{"line_number":11,"context_line":""},{"line_number":12,"context_line":"In this patch, we *just* implement it to be backward compatible with how"},{"line_number":13,"context_line":"the resource tracker populates the compute node resource provider"},{"line_number":14,"context_line":"inventory based on get_available_resource. Future patches will bring"},{"line_number":15,"context_line":"sanity to such values as allocation_ratio, min_unit, and reserved."},{"line_number":16,"context_line":"Future patches (as part of larger efforts) will also handle providers"},{"line_number":17,"context_line":"and/or inventories for SR-IOV, devices, etc."},{"line_number":18,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"3f79a3b5_02af0b9d","line":15,"range":{"start_line":14,"start_character":42,"end_line":15,"end_character":41},"updated":"2018-10-26 13:02:37.000000000","message":"heh. I\u0027m not sure there will ever be sanity for allocation_ratio being set by the virt driver automatically instead of programmatically via the placement API.\n\nExcept maybe for things like dedicated PCPU, passthrough devices or Ironic resource classes which should never, ever have anything other than 1.0 values.","commit_id":"193fac951141052008fa3402ae64a32d60c8fc5f"}],"nova/tests/unit/virt/powervm/test_driver.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"39e8790de194d3bf0af6264f93b1d86824693cd9","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            }"},{"line_number":181,"context_line":"            ptree \u003d provider_tree.ProviderTree()"},{"line_number":182,"context_line":"            ptree.new_root(\u0027compute_host\u0027, uuids.cn)"},{"line_number":183,"context_line":"            # Let the caller muck with these"},{"line_number":184,"context_line":"            yield ptree, exp_inv"},{"line_number":185,"context_line":"            self.drv.update_provider_tree(ptree, \u0027compute_host\u0027)"},{"line_number":186,"context_line":"            self.assertEqual(exp_inv, ptree.data(\u0027compute_host\u0027).inventory)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_24c31e59","line":183,"updated":"2018-08-15 15:13:10.000000000","message":"this really isn\u0027t an advisable way to do unit tests, IMHO. it creates a much bigger surface area for bugs to appear versus just mocking the small, specific surface area you wish to test.\n\nData internal to the driver should not be yield\u0027d out of a context manager like this to be \"mucked with\".","commit_id":"33780a3d9f5eb8c282a8c61dfef342fcf04c899b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"96a74fc1428955b4aa4483bce7abc07c6a5e639d","unresolved":false,"context_lines":[{"line_number":180,"context_line":"            }"},{"line_number":181,"context_line":"            ptree \u003d provider_tree.ProviderTree()"},{"line_number":182,"context_line":"            ptree.new_root(\u0027compute_host\u0027, uuids.cn)"},{"line_number":183,"context_line":"            # Let the caller muck with these"},{"line_number":184,"context_line":"            yield ptree, exp_inv"},{"line_number":185,"context_line":"            self.drv.update_provider_tree(ptree, \u0027compute_host\u0027)"},{"line_number":186,"context_line":"            self.assertEqual(exp_inv, ptree.data(\u0027compute_host\u0027).inventory)"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_4ace6363","line":183,"in_reply_to":"3f79a3b5_24c31e59","updated":"2018-08-15 16:12:08.000000000","message":"It\u0027s not driver data, it\u0027s test data: the ProviderTree to be passed into the method, and the inventory dict we expect to find on the compute node provider in the end.\n\nEvery test was going to have to do *almost* the same thing, and this was the easiest* way to DRY.\n\nMaybe this is the wrong time to tell you I did this elsewhere. I suspect you\u0027re going to find it soon...\n\n*Okay, maybe not the easiest, but resulting in most DRYing.","commit_id":"33780a3d9f5eb8c282a8c61dfef342fcf04c899b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"39e8790de194d3bf0af6264f93b1d86824693cd9","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        # Overrides inventory already on the provider; leaves other providers"},{"line_number":214,"context_line":"        # and aggregates/traits alone."},{"line_number":215,"context_line":"        with self._update_provider_tree() as (ptree, _):"},{"line_number":216,"context_line":"            ptree.update_inventory(\u0027compute_host\u0027, {"},{"line_number":217,"context_line":"                # these should get blown away"},{"line_number":218,"context_line":"                \u0027VCPU\u0027: {"},{"line_number":219,"context_line":"                    \u0027total\u0027: 16,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_a49ace5e","line":216,"updated":"2018-08-15 15:13:10.000000000","message":"why not just pass in the ProviderTree object to self.drv.update_provider_tree() instead of being overly clever with yielding mocks from a context manager you create above...","commit_id":"33780a3d9f5eb8c282a8c61dfef342fcf04c899b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"96a74fc1428955b4aa4483bce7abc07c6a5e639d","unresolved":false,"context_lines":[{"line_number":213,"context_line":"        # Overrides inventory already on the provider; leaves other providers"},{"line_number":214,"context_line":"        # and aggregates/traits alone."},{"line_number":215,"context_line":"        with self._update_provider_tree() as (ptree, _):"},{"line_number":216,"context_line":"            ptree.update_inventory(\u0027compute_host\u0027, {"},{"line_number":217,"context_line":"                # these should get blown away"},{"line_number":218,"context_line":"                \u0027VCPU\u0027: {"},{"line_number":219,"context_line":"                    \u0027total\u0027: 16,"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_8afebb68","line":216,"in_reply_to":"3f79a3b5_a49ace5e","updated":"2018-08-15 16:12:08.000000000","message":"Because then I would have had to repeat the initialization of the ProviderTree in every test. This way saves a whole 2LOC per test. (Okay, so that part was maybe overkill for the helper :P  I thought the initialization was going to be bigger.)","commit_id":"33780a3d9f5eb8c282a8c61dfef342fcf04c899b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ab8ed5fed6bad60d1f232d34f1cba01638465ff6","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            ptree \u003d provider_tree.ProviderTree()"},{"line_number":182,"context_line":"            ptree.new_root(\u0027compute_host\u0027, uuids.cn)"},{"line_number":183,"context_line":"            # Let the caller muck with these"},{"line_number":184,"context_line":"            yield ptree, exp_inv"},{"line_number":185,"context_line":"            self.drv.update_provider_tree(ptree, \u0027compute_host\u0027)"},{"line_number":186,"context_line":"            self.assertEqual(exp_inv, ptree.data(\u0027compute_host\u0027).inventory)"},{"line_number":187,"context_line":"            mock_bhrfm.assert_called_once_with(\u0027host_wrapper\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_a26bb751","line":184,"updated":"2018-10-26 13:02:37.000000000","message":"lol, I am trying my best not to complain about this yield-fixtures-in-test-methods approach :)","commit_id":"193fac951141052008fa3402ae64a32d60c8fc5f"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d9e90b9e92c7728cdaa2ff022016d4a6467752e9","unresolved":false,"context_lines":[{"line_number":181,"context_line":"            ptree \u003d provider_tree.ProviderTree()"},{"line_number":182,"context_line":"            ptree.new_root(\u0027compute_host\u0027, uuids.cn)"},{"line_number":183,"context_line":"            # Let the caller muck with these"},{"line_number":184,"context_line":"            yield ptree, exp_inv"},{"line_number":185,"context_line":"            self.drv.update_provider_tree(ptree, \u0027compute_host\u0027)"},{"line_number":186,"context_line":"            self.assertEqual(exp_inv, ptree.data(\u0027compute_host\u0027).inventory)"},{"line_number":187,"context_line":"            mock_bhrfm.assert_called_once_with(\u0027host_wrapper\u0027)"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_24fb30bf","line":184,"in_reply_to":"3f79a3b5_a26bb751","updated":"2018-10-26 16:05:18.000000000","message":"Yeah, we talked about that before [1], and you basically said you\u0027d let me get away with it because it\u0027s in the PowerVM virt driver; but I had simultaneously done it in another patch somewhere else (don\u0027t remember where) and you made me change it there :P\n\n[1] https://review.openstack.org/#/c/468560/3/nova/tests/unit/virt/powervm/test_driver.py@216","commit_id":"193fac951141052008fa3402ae64a32d60c8fc5f"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ab8ed5fed6bad60d1f232d34f1cba01638465ff6","unresolved":false,"context_lines":[{"line_number":210,"context_line":"            exp_inv[\u0027DISK_GB\u0027][\u0027reserved\u0027] \u003d 6"},{"line_number":211,"context_line":""},{"line_number":212,"context_line":"    def test_update_provider_tree_complex_ptree(self):"},{"line_number":213,"context_line":"        # Overrides inventory already on the provider; leaves other providers"},{"line_number":214,"context_line":"        # and aggregates/traits alone."},{"line_number":215,"context_line":"        with self._update_provider_tree() as (ptree, _):"},{"line_number":216,"context_line":"            ptree.update_inventory(\u0027compute_host\u0027, {"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_a2a0978f","line":213,"range":{"start_line":213,"start_character":45,"end_line":213,"end_character":53},"updated":"2018-10-26 13:02:37.000000000","message":"s/provider/compute node root provider/","commit_id":"193fac951141052008fa3402ae64a32d60c8fc5f"}],"nova/virt/powervm/driver.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"4b6c298b09cee946bc6d9d20e66fae83e5afb44d","unresolved":false,"context_lines":[{"line_number":123,"context_line":""},{"line_number":124,"context_line":"        return [self.host_wrapper.mtms.mtms_str]"},{"line_number":125,"context_line":""},{"line_number":126,"context_line":"    def get_available_resource(self, nodename):"},{"line_number":127,"context_line":"        \"\"\"Retrieve resource information."},{"line_number":128,"context_line":""},{"line_number":129,"context_line":"        This method is called when nova-compute launches, and as part of a"},{"line_number":130,"context_line":"        periodic task."},{"line_number":131,"context_line":""},{"line_number":132,"context_line":"        :param nodename: Node from which the caller wants to get resources."},{"line_number":133,"context_line":"                         A driver that manages only one node can safely ignore"},{"line_number":134,"context_line":"                         this."},{"line_number":135,"context_line":"        :return: Dictionary describing resources."},{"line_number":136,"context_line":"        \"\"\""},{"line_number":137,"context_line":"        # Do this here so it refreshes each time this method is called."},{"line_number":138,"context_line":"        self.host_wrapper \u003d pvm_ms.System.get(self.adapter)[0]"},{"line_number":139,"context_line":"        # Get host information"},{"line_number":140,"context_line":"        data \u003d pvm_host.build_host_resource_from_ms(self.host_wrapper)"},{"line_number":141,"context_line":""},{"line_number":142,"context_line":"        # Add the disk information"},{"line_number":143,"context_line":"        data[\"local_gb\"] \u003d self.disk_dvr.capacity"},{"line_number":144,"context_line":"        data[\"local_gb_used\"] \u003d self.disk_dvr.capacity_used"},{"line_number":145,"context_line":""},{"line_number":146,"context_line":"        return data"},{"line_number":147,"context_line":""},{"line_number":148,"context_line":"    def get_inventory(self, nodename):"},{"line_number":149,"context_line":"        \"\"\"Return a dict, keyed by resource class, of inventory information for"}],"source_content_type":"text/x-python","patch_set":1,"id":"ff0f0b1f_674c4e76","line":146,"range":{"start_line":126,"start_character":0,"end_line":146,"end_character":19},"updated":"2017-05-26 22:05:16.000000000","message":"Can get_available_resource and pvm_host.build_host_resource_from_ms be removed?\n\nDo we no longer need any of the other fields (https://github.com/openstack/nova/blob/master/nova/virt/powervm/host.py#L55-L64)?","commit_id":"63178027becbe7fb8b3db549cbf9619f2648c8bb"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"39e8790de194d3bf0af6264f93b1d86824693cd9","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        mem_reserved \u003d CONF.reserved_host_memory_mb"},{"line_number":202,"context_line":"        disk_alloc_ratio \u003d CONF.disk_allocation_ratio or 1.0"},{"line_number":203,"context_line":"        disk_reserved \u003d compute_utils.convert_mb_to_ceil_gb("},{"line_number":204,"context_line":"            CONF.reserved_host_disk_mb)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        inventory \u003d {"},{"line_number":207,"context_line":"            rc_fields.ResourceClass.VCPU: {"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_e4f52658","line":204,"updated":"2018-08-15 15:13:10.000000000","message":"Note for future Eric... a Nova host aggregate can (unfortunately) have an allocation ratio associated with CPU, RAM and disk. Obviously, placement aggregates don\u0027t have this kind of data associated with them (they don\u0027t have any metadata at all, as you know).\n\nAt some point in the future, there will be a drive to unscramble the Nova host aggregate allocation ratio stuff, and this might end up overwriting the result of that. Just FYI.","commit_id":"33780a3d9f5eb8c282a8c61dfef342fcf04c899b"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"ea3fd49d80a301fcb6792f74f28edd54d1457b97","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        mem_reserved \u003d CONF.reserved_host_memory_mb"},{"line_number":202,"context_line":"        disk_alloc_ratio \u003d CONF.disk_allocation_ratio or 1.0"},{"line_number":203,"context_line":"        disk_reserved \u003d compute_utils.convert_mb_to_ceil_gb("},{"line_number":204,"context_line":"            CONF.reserved_host_disk_mb)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        inventory \u003d {"},{"line_number":207,"context_line":"            rc_fields.ResourceClass.VCPU: {"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_97eb3f11","line":204,"in_reply_to":"3f79a3b5_2a70c707","updated":"2018-08-15 16:55:29.000000000","message":"Oh, I\u0027m not saying it wouldn\u0027t break the unit tests. Just noting that it will be a giant ball of mess that each virt driver is going to need to untangle and be aware of as we fix the aggregate metadata allocation ratio stuff...","commit_id":"33780a3d9f5eb8c282a8c61dfef342fcf04c899b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"96a74fc1428955b4aa4483bce7abc07c6a5e639d","unresolved":false,"context_lines":[{"line_number":201,"context_line":"        mem_reserved \u003d CONF.reserved_host_memory_mb"},{"line_number":202,"context_line":"        disk_alloc_ratio \u003d CONF.disk_allocation_ratio or 1.0"},{"line_number":203,"context_line":"        disk_reserved \u003d compute_utils.convert_mb_to_ceil_gb("},{"line_number":204,"context_line":"            CONF.reserved_host_disk_mb)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        inventory \u003d {"},{"line_number":207,"context_line":"            rc_fields.ResourceClass.VCPU: {"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f79a3b5_2a70c707","line":204,"in_reply_to":"3f79a3b5_e4f52658","updated":"2018-08-15 16:12:08.000000000","message":"Good to know.\n\nI\u0027m having trouble understanding how that work would get done without breaking the unit tests for this, and therefore prompting this to be updated accordingly. But will keep my eyes open, thanks.","commit_id":"33780a3d9f5eb8c282a8c61dfef342fcf04c899b"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"86b3c58af15d9cb9207c722dbd45ad8436516bfc","unresolved":false,"context_lines":[{"line_number":200,"context_line":"        mem_alloc_ratio \u003d CONF.ram_allocation_ratio or 1.5"},{"line_number":201,"context_line":"        mem_reserved \u003d CONF.reserved_host_memory_mb"},{"line_number":202,"context_line":"        disk_alloc_ratio \u003d CONF.disk_allocation_ratio or 1.0"},{"line_number":203,"context_line":"        disk_reserved \u003d compute_utils.convert_mb_to_ceil_gb("},{"line_number":204,"context_line":"            CONF.reserved_host_disk_mb)"},{"line_number":205,"context_line":""},{"line_number":206,"context_line":"        inventory \u003d {"},{"line_number":207,"context_line":"            rc_fields.ResourceClass.VCPU: {"}],"source_content_type":"text/x-python","patch_set":4,"id":"3f79a3b5_dc0f8f29","line":204,"range":{"start_line":203,"start_character":0,"end_line":204,"end_character":39},"updated":"2018-10-29 22:14:29.000000000","message":"self._get_reserved_host_disk_gb_from_config() once [1] merges.\n\n[1] https://review.openstack.org/#/c/613126/","commit_id":"193fac951141052008fa3402ae64a32d60c8fc5f"}]}
