)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d52bf0ba61642fd066b1e3f95697f32fed92d5f3","unresolved":false,"context_lines":[{"line_number":1,"context_line":"Parent:     94ccf844 (Add ProviderSummaryList object)"},{"line_number":2,"context_line":"Author:     He Jie Xu \u003chejie.xu@intel.com\u003e"},{"line_number":3,"context_line":"AuthorDate: 2017-10-23 13:27:42 +0800"},{"line_number":4,"context_line":"Commit:     He Jie Xu \u003chejie.xu@intel.com\u003e"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3f4b6375_018764b7","line":1,"updated":"2017-10-24 19:44:54.000000000","message":"It would be helpful if this commit message (and the one in the previous change in the series) explained a bit more of the strategy.  Jay and I won\u0027t be the only ones confused about how this is going to be used, and you don\u0027t want to rely on subsequent reviewers (and especially folks coming back and looking at this commit after it merges) having to go back and read the review comment history.","commit_id":"546ffab19a26d298e6e467e33591f0aefc060e50"}],"nova/objects/resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d52bf0ba61642fd066b1e3f95697f32fed92d5f3","unresolved":false,"context_lines":[{"line_number":2456,"context_line":"        super(ProviderSummaryList, self).__init__(*args, **kwargs)"},{"line_number":2457,"context_line":"        self.providers_by_id \u003d {}"},{"line_number":2458,"context_line":"        self.shared_providers_by_rc_id \u003d {}"},{"line_number":2459,"context_line":"        # TODO(alex_xu): the \"root providers\" isn\u0027t right name"},{"line_number":2460,"context_line":"        self.root_providers_by_rp_id \u003d {}"},{"line_number":2461,"context_line":""},{"line_number":2462,"context_line":"    def get_shared_providers_by_rc_id(self):"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_9e63b142","line":2459,"range":{"start_line":2459,"start_character":29,"end_line":2459,"end_character":45},"updated":"2017-10-24 19:44:54.000000000","message":"Help us come up with a better name: https://doodle.com/poll/9fkqidtfzwh7y9tr","commit_id":"546ffab19a26d298e6e467e33591f0aefc060e50"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d52bf0ba61642fd066b1e3f95697f32fed92d5f3","unresolved":false,"context_lines":[{"line_number":2459,"context_line":"        # TODO(alex_xu): the \"root providers\" isn\u0027t right name"},{"line_number":2460,"context_line":"        self.root_providers_by_rp_id \u003d {}"},{"line_number":2461,"context_line":""},{"line_number":2462,"context_line":"    def get_shared_providers_by_rc_id(self):"},{"line_number":2463,"context_line":"        return self.shared_providers_by_rc_id"},{"line_number":2464,"context_line":""},{"line_number":2465,"context_line":"    def get_root_providers_by_rp_id(self):"},{"line_number":2466,"context_line":"        return self.root_providers_by_rp_id"},{"line_number":2467,"context_line":""},{"line_number":2468,"context_line":"    @classmethod"},{"line_number":2469,"context_line":"    def get_all_with_any_resource_and_trait(cls, context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_1efb4179","line":2466,"range":{"start_line":2462,"start_character":0,"end_line":2466,"end_character":43},"updated":"2017-10-24 19:44:54.000000000","message":"Why?\n\nIf you\u0027re going to have these, may as well also have one for providers_by_id.\n\nBut I don\u0027t see a need for that; just access all three directly.","commit_id":"546ffab19a26d298e6e467e33591f0aefc060e50"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d52bf0ba61642fd066b1e3f95697f32fed92d5f3","unresolved":false,"context_lines":[{"line_number":2467,"context_line":""},{"line_number":2468,"context_line":"    @classmethod"},{"line_number":2469,"context_line":"    def get_all_with_any_resource_and_trait(cls, context,"},{"line_number":2470,"context_line":"                                            resources, required\u003dNone):"},{"line_number":2471,"context_line":"        \"\"\"This method return a list of summary of providers which have any"},{"line_number":2472,"context_line":"        requested resource, also have any required trait."},{"line_number":2473,"context_line":"        \"\"\""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_212940e5","line":2470,"range":{"start_line":2470,"start_character":55,"end_line":2470,"end_character":68},"updated":"2017-10-24 19:44:54.000000000","message":"This is still not used (and still shouldn\u0027t be - see comment here in previous change set).","commit_id":"546ffab19a26d298e6e467e33591f0aefc060e50"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d52bf0ba61642fd066b1e3f95697f32fed92d5f3","unresolved":false,"context_lines":[{"line_number":2498,"context_line":"                t.id \u003d _id"},{"line_number":2499,"context_line":"                t.name \u003d name"},{"line_number":2500,"context_line":"                p_summary.traits.append(t)"},{"line_number":2501,"context_line":"                sharing_provider \u003d name \u003d\u003d \u0027MISC_SHARE_VIA_AGGREGATE\u0027"},{"line_number":2502,"context_line":""},{"line_number":2503,"context_line":"            for rc_id, total, used in provider_usages_by_id[rp_id]:"},{"line_number":2504,"context_line":"                p_resource \u003d ProviderSummaryResource(context)"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_61b3b80b","line":2501,"range":{"start_line":2501,"start_character":16,"end_line":2501,"end_character":69},"updated":"2017-10-24 19:44:54.000000000","message":"Nope, this only works if MISC_SHARES_VIA_AGGREGATE is the *last* trait.  You need\n\n if name \u003d\u003d \u0027MISC_SHARES_VIA_AGGREGATE\u0027:\n     sharing_provider \u003d True\n\nor if you just gotta do it in one line:\n\n sharing_provider \u003d sharing_provider or name \u003d\u003d \u0027MISC_SHARES_VIA_AGGREGATE\u0027\n\n(Also check the spelling: s/SHARE/SHARES/)","commit_id":"546ffab19a26d298e6e467e33591f0aefc060e50"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d52bf0ba61642fd066b1e3f95697f32fed92d5f3","unresolved":false,"context_lines":[{"line_number":2507,"context_line":"                p_resource.capacity \u003d total"},{"line_number":2508,"context_line":"                p_resource.used \u003d used if used is not None else 0"},{"line_number":2509,"context_line":"                p_summary.resources.append(p_resource)"},{"line_number":2510,"context_line":"                shared_rc_ids.append(rc_id)"},{"line_number":2511,"context_line":""},{"line_number":2512,"context_line":"            providers_by_id[rp_id] \u003d p_summary"},{"line_number":2513,"context_line":"            if sharing_provider:"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_e1744838","line":2510,"range":{"start_line":2510,"start_character":16,"end_line":2510,"end_character":43},"updated":"2017-10-24 19:44:54.000000000","message":"if sharing_provider?","commit_id":"546ffab19a26d298e6e467e33591f0aefc060e50"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"452996712f959ee0ea3ac490896d9f707638c61a","unresolved":false,"context_lines":[{"line_number":2530,"context_line":"    def __init__(self, *args, **kwargs):"},{"line_number":2531,"context_line":"        super(ProviderSummaryList, self).__init__(*args, **kwargs)"},{"line_number":2532,"context_line":"        self.providers_by_id \u003d {}"},{"line_number":2533,"context_line":"        self.shared_providers_by_rc_id \u003d {}"},{"line_number":2534,"context_line":"        # TODO(alex_xu): the \"root providers\" isn\u0027t right name"},{"line_number":2535,"context_line":"        self.root_providers_by_rp_id \u003d {}"},{"line_number":2536,"context_line":""},{"line_number":2537,"context_line":"    def get_shared_providers_by_rc_id(self):"},{"line_number":2538,"context_line":"        return self.shared_providers_by_rc_id"}],"source_content_type":"text/x-python","patch_set":3,"id":"3f4b6375_df332a61","line":2535,"range":{"start_line":2533,"start_character":7,"end_line":2535,"end_character":41},"updated":"2017-10-26 13:35:01.000000000","message":"One of thing I want to try is that I didn\u0027t want to use the Versioned object at here, just use a normal python object with some data struct for \n getting better performance on the query of RP by id.","commit_id":"7b68eefc7b59f9806a64e863058096e5d00e20f1"}],"nova/tests/unit/objects/test_resource_provider.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d52bf0ba61642fd066b1e3f95697f32fed92d5f3","unresolved":false,"context_lines":[{"line_number":403,"context_line":"        mock_get_usages.return_value \u003d fake_usages_records"},{"line_number":404,"context_line":""},{"line_number":405,"context_line":"        # TODO(alex_xu): separate testcase for request with resources only and"},{"line_number":406,"context_line":"        # request both with resources and traits."},{"line_number":407,"context_line":"        res \u003d (resource_provider.ProviderSummaryList."},{"line_number":408,"context_line":"            get_all_with_any_resource_and_trait("},{"line_number":409,"context_line":"                self.context,"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_c1702c0b","line":406,"range":{"start_line":406,"start_character":28,"end_line":406,"end_character":49},"updated":"2017-10-24 19:44:54.000000000","message":"nah","commit_id":"546ffab19a26d298e6e467e33591f0aefc060e50"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d52bf0ba61642fd066b1e3f95697f32fed92d5f3","unresolved":false,"context_lines":[{"line_number":408,"context_line":"            get_all_with_any_resource_and_trait("},{"line_number":409,"context_line":"                self.context,"},{"line_number":410,"context_line":"                self.requested_resources,"},{"line_number":411,"context_line":"                [\u0027CUSTOM_TRAIT_A\u0027, \u0027CUSTOM_TRAIT_B\u0027,"},{"line_number":412,"context_line":"                 \u0027MISC_SHARES_VIA_AGGREGATE\u0027]))"},{"line_number":413,"context_line":""},{"line_number":414,"context_line":"        self.assertEqual(2, len(res))"},{"line_number":415,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_a17ad0ed","line":412,"range":{"start_line":411,"start_character":16,"end_line":412,"end_character":45},"updated":"2017-10-24 19:44:54.000000000","message":"Strike.","commit_id":"546ffab19a26d298e6e467e33591f0aefc060e50"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d52bf0ba61642fd066b1e3f95697f32fed92d5f3","unresolved":false,"context_lines":[{"line_number":444,"context_line":"                    set([\u0027CUSTOM_TRAIT_A\u0027, \u0027MISC_SHARES_VIA_AGGREGATE\u0027]),"},{"line_number":445,"context_line":"                    set([str(t.name) for t in r.traits]))"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"        self.assertEqual({}, res.get_shared_providers_by_rc_id())"},{"line_number":448,"context_line":"        self.assertEqual(res.providers_by_id,"},{"line_number":449,"context_line":"                         res.get_root_providers_by_rp_id())"}],"source_content_type":"text/x-python","patch_set":2,"id":"3f4b6375_41ec3c8e","line":449,"range":{"start_line":447,"start_character":0,"end_line":449,"end_character":59},"updated":"2017-10-24 19:44:54.000000000","message":"This isn\u0027t right.  The first one should only have RP 1 in it and the second should only have RP 0 in it.  If you correct the spelling of MISC_SHARES_VIA_AGGREGATE in the source, it\u0027ll work - but you should embed that trait in the middle of the trait list for the RP to prove the other bug I highlighted.","commit_id":"546ffab19a26d298e6e467e33591f0aefc060e50"}]}
