)]}'
{"nova/scheduler/client/report.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"44be0f819c66ca7f0516bfda931f301024c1be7a","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        DISK_GB: disk,"},{"line_number":160,"context_line":"    }"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    # Pull out any resource overrides, which are in the format"},{"line_number":163,"context_line":"    # \"resources:FOO\" and generate a dict of FOO\u003dvalue candidates"},{"line_number":164,"context_line":"    # for overriding the resources in the allocation."},{"line_number":165,"context_line":"    overrides \u003d {k.split(\u0027:\u0027, 1)[1]: v for k, v in"},{"line_number":166,"context_line":"                 instance.flavor.extra_specs.items()"},{"line_number":167,"context_line":"                 if k.startswith(\u0027resources:\u0027)}"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    # Any resource overrides which are properly namespaced as custom,"},{"line_number":170,"context_line":"    # or are standard resource class values override the alloc_dict"},{"line_number":171,"context_line":"    # already constructed from the base flavor values above. Since"},{"line_number":172,"context_line":"    # extra_specs are string values and resource counts are always"},{"line_number":173,"context_line":"    # integers, we convert them here too for any that we find."},{"line_number":174,"context_line":"    overrides \u003d {k: int(v) for k, v in overrides.items()"},{"line_number":175,"context_line":"            if (k.startswith(objects.ResourceClass.CUSTOM_NAMESPACE) or"},{"line_number":176,"context_line":"                k in fields.ResourceClass.STANDARD)}"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    alloc_dict.update(overrides)"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_f19c16c1","side":"PARENT","line":176,"range":{"start_line":162,"start_character":4,"end_line":176,"end_character":52},"updated":"2017-08-04 00:09:21.000000000","message":"So this was actually already handled in the existing _process_extra_specs code in scheduler utils? Because it certainly looked different.","commit_id":"79c376ec162a0049523f196b3fd10a1585cff1da"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"eec95612a28cf531ce24beb3bc7631f6faec7f89","unresolved":false,"context_lines":[{"line_number":159,"context_line":"        DISK_GB: disk,"},{"line_number":160,"context_line":"    }"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":"    # Pull out any resource overrides, which are in the format"},{"line_number":163,"context_line":"    # \"resources:FOO\" and generate a dict of FOO\u003dvalue candidates"},{"line_number":164,"context_line":"    # for overriding the resources in the allocation."},{"line_number":165,"context_line":"    overrides \u003d {k.split(\u0027:\u0027, 1)[1]: v for k, v in"},{"line_number":166,"context_line":"                 instance.flavor.extra_specs.items()"},{"line_number":167,"context_line":"                 if k.startswith(\u0027resources:\u0027)}"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":"    # Any resource overrides which are properly namespaced as custom,"},{"line_number":170,"context_line":"    # or are standard resource class values override the alloc_dict"},{"line_number":171,"context_line":"    # already constructed from the base flavor values above. Since"},{"line_number":172,"context_line":"    # extra_specs are string values and resource counts are always"},{"line_number":173,"context_line":"    # integers, we convert them here too for any that we find."},{"line_number":174,"context_line":"    overrides \u003d {k: int(v) for k, v in overrides.items()"},{"line_number":175,"context_line":"            if (k.startswith(objects.ResourceClass.CUSTOM_NAMESPACE) or"},{"line_number":176,"context_line":"                k in fields.ResourceClass.STANDARD)}"},{"line_number":177,"context_line":""},{"line_number":178,"context_line":"    alloc_dict.update(overrides)"},{"line_number":179,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_d3b46482","side":"PARENT","line":176,"range":{"start_line":162,"start_character":4,"end_line":176,"end_character":52},"in_reply_to":"df3967d1_f19c16c1","updated":"2017-08-04 15:19:04.000000000","message":"It\u0027s different but functionally the same. The _process_extra_specs() logs some warnings but otherwise filters out the same items in extra specs for resources and verifies positive integer amounts are used.","commit_id":"79c376ec162a0049523f196b3fd10a1585cff1da"}],"nova/scheduler/utils.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5a14bbd031bf47f3b670e51736f6c1b0dc8b16ec","unresolved":false,"context_lines":[{"line_number":154,"context_line":"    resources \u003d {"},{"line_number":155,"context_line":"        fields.ResourceClass.VCPU: flavor.vcpus,"},{"line_number":156,"context_line":"        fields.ResourceClass.MEMORY_MB: flavor.memory_mb,"},{"line_number":157,"context_line":"        fields.ResourceClass.DISK_GB: (flavor.root_gb +"},{"line_number":158,"context_line":"                                       flavor.ephemeral_gb +"},{"line_number":159,"context_line":"                                       flavor.swap / 1024),"},{"line_number":160,"context_line":"    }"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_b1bd7cd9","line":157,"range":{"start_line":157,"start_character":29,"end_line":157,"end_character":36},"updated":"2017-08-03 15:30:55.000000000","message":"Does the caller have to account for boot from volume then?\n\nThinking about this:\n\nhttps://github.com/openstack/nova/blob/9d1db10f842286fb59b9316987e075fd8758107d/nova/scheduler/client/report.py#L154","commit_id":"68743a9db49b320e67a2714d2ad3b93eec57d829"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5a14bbd031bf47f3b670e51736f6c1b0dc8b16ec","unresolved":false,"context_lines":[{"line_number":156,"context_line":"        fields.ResourceClass.MEMORY_MB: flavor.memory_mb,"},{"line_number":157,"context_line":"        fields.ResourceClass.DISK_GB: (flavor.root_gb +"},{"line_number":158,"context_line":"                                       flavor.ephemeral_gb +"},{"line_number":159,"context_line":"                                       flavor.swap / 1024),"},{"line_number":160,"context_line":"    }"},{"line_number":161,"context_line":"    _process_extra_specs(flavor.extra_specs, resources)"},{"line_number":162,"context_line":"    return resources"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_31750c65","line":159,"range":{"start_line":159,"start_character":39,"end_line":159,"end_character":57},"updated":"2017-08-03 15:30:55.000000000","message":"Should we re-use convert_mb_to_ceil_gb here like in the scheduler report client for dealing with swap MB?","commit_id":"68743a9db49b320e67a2714d2ad3b93eec57d829"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"44be0f819c66ca7f0516bfda931f301024c1be7a","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        fields.ResourceClass.MEMORY_MB: flavor.memory_mb,"},{"line_number":163,"context_line":"        fields.ResourceClass.DISK_GB: disk,"},{"line_number":164,"context_line":"    }"},{"line_number":165,"context_line":"    _process_extra_specs(flavor.extra_specs, resources)"},{"line_number":166,"context_line":"    return resources"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_51964295","line":165,"updated":"2017-08-04 00:09:21.000000000","message":"Do we want a check like on L209?\n\nif \"extra_specs\" in flavor:","commit_id":"6ac21c1eb5647188eab8c2a32a42036ef654ce79"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"9cca8f9342e3801f593d002afe6124e66da1432f","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        fields.ResourceClass.MEMORY_MB: flavor.memory_mb,"},{"line_number":163,"context_line":"        fields.ResourceClass.DISK_GB: disk,"},{"line_number":164,"context_line":"    }"},{"line_number":165,"context_line":"    _process_extra_specs(flavor.extra_specs, resources)"},{"line_number":166,"context_line":"    return resources"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_6e4eeb38","line":165,"in_reply_to":"df3967d1_51964295","updated":"2017-08-04 15:26:55.000000000","message":"Done","commit_id":"6ac21c1eb5647188eab8c2a32a42036ef654ce79"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"a007d6d44433c196a6dd2d9d45407b9baca7db06","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        fields.ResourceClass.MEMORY_MB: flavor.memory_mb,"},{"line_number":163,"context_line":"        fields.ResourceClass.DISK_GB: disk,"},{"line_number":164,"context_line":"    }"},{"line_number":165,"context_line":"    _process_extra_specs(flavor.extra_specs, resources)"},{"line_number":166,"context_line":"    return resources"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_cdfcc171","line":165,"in_reply_to":"df3967d1_51964295","updated":"2017-08-04 14:13:44.000000000","message":"Well, we want to lazy-load it if it\u0027s not there for a real flavor. However, I guess this is intended to be called on an instance flavor, and if it\u0027s not set we can\u0027t lazy-load it. So yeah, I guess the best thing would be to be cautious there and maybe log a warning or something.","commit_id":"6ac21c1eb5647188eab8c2a32a42036ef654ce79"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"eec95612a28cf531ce24beb3bc7631f6faec7f89","unresolved":false,"context_lines":[{"line_number":162,"context_line":"        fields.ResourceClass.MEMORY_MB: flavor.memory_mb,"},{"line_number":163,"context_line":"        fields.ResourceClass.DISK_GB: disk,"},{"line_number":164,"context_line":"    }"},{"line_number":165,"context_line":"    _process_extra_specs(flavor.extra_specs, resources)"},{"line_number":166,"context_line":"    return resources"},{"line_number":167,"context_line":""},{"line_number":168,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_53651445","line":165,"in_reply_to":"df3967d1_cdfcc171","updated":"2017-08-04 15:19:04.000000000","message":"k, fixing up.","commit_id":"6ac21c1eb5647188eab8c2a32a42036ef654ce79"}],"nova/tests/unit/scheduler/test_utils.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5a14bbd031bf47f3b670e51736f6c1b0dc8b16ec","unresolved":false,"context_lines":[{"line_number":189,"context_line":"            \u0027VCPU\u0027: 1, \u0027MEMORY_MB\u0027: 1024,"},{"line_number":190,"context_line":"        }"},{"line_number":191,"context_line":"        new_resources \u003d {"},{"line_number":192,"context_line":"            \u0027VCPU\u0027: 2, \u0027MEMORY_MB\u0027: 2048,"},{"line_number":193,"context_line":"        }"},{"line_number":194,"context_line":"        doubled \u003d {"},{"line_number":195,"context_line":"            \u0027VCPU\u0027: 3, \u0027MEMORY_MB\u0027: 3072,"}],"source_content_type":"text/x-python","patch_set":1,"id":"df3967d1_91bef8b1","line":192,"range":{"start_line":192,"start_character":12,"end_line":192,"end_character":41},"updated":"2017-08-03 15:30:55.000000000","message":"Throw a new CUSTOM_FOO in here to make sure keys in new are accounted for when they aren\u0027t in original.","commit_id":"68743a9db49b320e67a2714d2ad3b93eec57d829"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"220efc8228c8214cef911bfe7718727758a6dc08","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            \u0027VCPU\u0027: 1, \u0027MEMORY_MB\u0027: 1024,"},{"line_number":213,"context_line":"        }"},{"line_number":214,"context_line":"        new_resources \u003d {"},{"line_number":215,"context_line":"            \u0027VCPU\u0027: 2, \u0027MEMORY_MB\u0027: 2048,"},{"line_number":216,"context_line":"        }"},{"line_number":217,"context_line":"        doubled \u003d {"},{"line_number":218,"context_line":"            \u0027VCPU\u0027: 3, \u0027MEMORY_MB\u0027: 3072,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_b16d6ecd","line":215,"range":{"start_line":215,"start_character":12,"end_line":215,"end_character":41},"updated":"2017-08-04 00:02:15.000000000","message":"Throw a new CUSTOM_FOO in here to make sure keys in new are accounted for when they aren\u0027t in original.","commit_id":"6ac21c1eb5647188eab8c2a32a42036ef654ce79"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"eec95612a28cf531ce24beb3bc7631f6faec7f89","unresolved":false,"context_lines":[{"line_number":212,"context_line":"            \u0027VCPU\u0027: 1, \u0027MEMORY_MB\u0027: 1024,"},{"line_number":213,"context_line":"        }"},{"line_number":214,"context_line":"        new_resources \u003d {"},{"line_number":215,"context_line":"            \u0027VCPU\u0027: 2, \u0027MEMORY_MB\u0027: 2048,"},{"line_number":216,"context_line":"        }"},{"line_number":217,"context_line":"        doubled \u003d {"},{"line_number":218,"context_line":"            \u0027VCPU\u0027: 3, \u0027MEMORY_MB\u0027: 3072,"}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_b3afa028","line":215,"range":{"start_line":215,"start_character":12,"end_line":215,"end_character":41},"in_reply_to":"df3967d1_b16d6ecd","updated":"2017-08-04 15:19:04.000000000","message":"Done","commit_id":"6ac21c1eb5647188eab8c2a32a42036ef654ce79"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"44be0f819c66ca7f0516bfda931f301024c1be7a","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        saved_orig \u003d dict(resources)"},{"line_number":221,"context_line":"        utils.merge_resources(resources, new_resources)"},{"line_number":222,"context_line":"        self.assertEqual(doubled, resources)"},{"line_number":223,"context_line":"        utils.merge_resources(resources, saved_orig, -1)"},{"line_number":224,"context_line":"        self.assertEqual(new_resources, resources)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_b13e8e88","line":224,"range":{"start_line":223,"start_character":8,"end_line":224,"end_character":50},"updated":"2017-08-04 00:09:21.000000000","message":"This was confusing, had to read it a few times. resources is modified in the first call so resources are doubled, and then in this call they are subtracted, so back down to new_resources. You don\u0027t need to change anything, besides maybe adding some comments about what is going on to make the test easier to follow.","commit_id":"6ac21c1eb5647188eab8c2a32a42036ef654ce79"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"eec95612a28cf531ce24beb3bc7631f6faec7f89","unresolved":false,"context_lines":[{"line_number":220,"context_line":"        saved_orig \u003d dict(resources)"},{"line_number":221,"context_line":"        utils.merge_resources(resources, new_resources)"},{"line_number":222,"context_line":"        self.assertEqual(doubled, resources)"},{"line_number":223,"context_line":"        utils.merge_resources(resources, saved_orig, -1)"},{"line_number":224,"context_line":"        self.assertEqual(new_resources, resources)"}],"source_content_type":"text/x-python","patch_set":4,"id":"df3967d1_5366342c","line":224,"range":{"start_line":223,"start_character":8,"end_line":224,"end_character":50},"in_reply_to":"df3967d1_b13e8e88","updated":"2017-08-04 15:19:04.000000000","message":"Done","commit_id":"6ac21c1eb5647188eab8c2a32a42036ef654ce79"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"e247cbe7ba1fa9fda63e2acb8dc4253444bc9e2c","unresolved":false,"context_lines":[{"line_number":209,"context_line":""},{"line_number":210,"context_line":"    def test_merge_resources(self):"},{"line_number":211,"context_line":"        resources \u003d {"},{"line_number":212,"context_line":"            \u0027VCPU\u0027: 1, \u0027MEMORY_MB\u0027: 1024, \u0027CUSTOM_FOO\u0027: 1,"},{"line_number":213,"context_line":"        }"},{"line_number":214,"context_line":"        new_resources \u003d {"},{"line_number":215,"context_line":"            \u0027VCPU\u0027: 2, \u0027MEMORY_MB\u0027: 2048, \u0027CUSTOM_FOO\u0027: 1,"}],"source_content_type":"text/x-python","patch_set":5,"id":"df3967d1_255b6187","line":212,"range":{"start_line":212,"start_character":42,"end_line":212,"end_character":58},"updated":"2017-08-04 16:14:01.000000000","message":"Sorry, remove this. What I meant was, we start with something but then when we resize, for example, we\u0027re using a flavor that has some new stuff in it, so add a new resource class in new_resources for that wrinkle. cdent pointed this out in my change: https://review.openstack.org/#/c/490085/5/nova/scheduler/client/report.py@232","commit_id":"87dbb666a9e34f4027ff055ae9532d15137e0a3f"}]}
