)]}'
{"nova/tests/functional/db/test_allocation_candidates.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            },"},{"line_number":53,"context_line":"        )"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _mk_rp(self, name):"},{"line_number":56,"context_line":"        rp \u003d rp_obj.ResourceProvider(self.ctx, name\u003dname,"},{"line_number":57,"context_line":"                                     uuid\u003dgetattr(uuids, name))"},{"line_number":58,"context_line":"        rp.create()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_4583c105","line":55,"range":{"start_line":55,"start_character":9,"end_line":55,"end_character":11},"updated":"2017-11-09 17:39:58.000000000","message":"is _create_provider() just too long?","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":52,"context_line":"            },"},{"line_number":53,"context_line":"        )"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def _mk_rp(self, name):"},{"line_number":56,"context_line":"        rp \u003d rp_obj.ResourceProvider(self.ctx, name\u003dname,"},{"line_number":57,"context_line":"                                     uuid\u003dgetattr(uuids, name))"},{"line_number":58,"context_line":"        rp.create()"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_9b1356b9","line":55,"range":{"start_line":55,"start_character":9,"end_line":55,"end_character":11},"in_reply_to":"1f485f77_4583c105","updated":"2017-11-09 22:33:01.000000000","message":"This from the guy who favors two-letter variable names?\n\nDone.","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        rp.create()"},{"line_number":59,"context_line":"        return rp"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _add_inv(self, rp, rc, total, **kwargs):"},{"line_number":62,"context_line":"        kwargs.setdefault(\u0027max_unit\u0027, total)"},{"line_number":63,"context_line":"        inv \u003d rp_obj.Inventory(self.ctx, resource_provider\u003drp,"},{"line_number":64,"context_line":"                               resource_class\u003drc, total\u003dtotal, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_8513f9b8","line":61,"range":{"start_line":61,"start_character":9,"end_line":61,"end_character":16},"updated":"2017-11-09 17:39:58.000000000","message":"how about _add_inventory()? Also, can be a module-level function, since you can replace self.ctx with rp.context.","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":58,"context_line":"        rp.create()"},{"line_number":59,"context_line":"        return rp"},{"line_number":60,"context_line":""},{"line_number":61,"context_line":"    def _add_inv(self, rp, rc, total, **kwargs):"},{"line_number":62,"context_line":"        kwargs.setdefault(\u0027max_unit\u0027, total)"},{"line_number":63,"context_line":"        inv \u003d rp_obj.Inventory(self.ctx, resource_provider\u003drp,"},{"line_number":64,"context_line":"                               resource_class\u003drc, total\u003dtotal, **kwargs)"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_7b189ad2","line":61,"range":{"start_line":61,"start_character":9,"end_line":61,"end_character":16},"in_reply_to":"1f485f77_8513f9b8","updated":"2017-11-09 22:33:01.000000000","message":"Done","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        inv.obj_set_defaults()"},{"line_number":66,"context_line":"        rp.add_inventory(inv)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def _add_alloc(self, rp, rc, used):"},{"line_number":69,"context_line":"        # NOTE(efried): Always use a random consumer UUID - we don\u0027t want to"},{"line_number":70,"context_line":"        # override any existing allocations from the test case."},{"line_number":71,"context_line":"        rp_obj.AllocationList("}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_6518fdd2","line":68,"range":{"start_line":68,"start_character":9,"end_line":68,"end_character":18},"updated":"2017-11-09 17:39:58.000000000","message":"how about _allocate_from_provider()? Also, can be a module-level function since you can replace self.ctx with rp.context","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":65,"context_line":"        inv.obj_set_defaults()"},{"line_number":66,"context_line":"        rp.add_inventory(inv)"},{"line_number":67,"context_line":""},{"line_number":68,"context_line":"    def _add_alloc(self, rp, rc, used):"},{"line_number":69,"context_line":"        # NOTE(efried): Always use a random consumer UUID - we don\u0027t want to"},{"line_number":70,"context_line":"        # override any existing allocations from the test case."},{"line_number":71,"context_line":"        rp_obj.AllocationList("}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_bb1df2be","line":68,"range":{"start_line":68,"start_character":9,"end_line":68,"end_character":18},"in_reply_to":"1f485f77_6518fdd2","updated":"2017-11-09 22:33:01.000000000","message":"Not actually used until further down the series - I\u0027ll remove it here and do as you suggest when it comes in.","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":75,"context_line":"                    consumer_id\u003duuidutils.generate_uuid(), used\u003dused)]"},{"line_number":76,"context_line":"        ).create_all()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _set_traits(self, rp, *traits):"},{"line_number":79,"context_line":"        tlist \u003d []"},{"line_number":80,"context_line":"        for tname in traits:"},{"line_number":81,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_8561b93c","line":78,"updated":"2017-11-09 17:39:58.000000000","message":"Can be a module-level function since you can replace self.ctx with rp.context","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":75,"context_line":"                    consumer_id\u003duuidutils.generate_uuid(), used\u003dused)]"},{"line_number":76,"context_line":"        ).create_all()"},{"line_number":77,"context_line":""},{"line_number":78,"context_line":"    def _set_traits(self, rp, *traits):"},{"line_number":79,"context_line":"        tlist \u003d []"},{"line_number":80,"context_line":"        for tname in traits:"},{"line_number":81,"context_line":"            try:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_bb4bb2ae","line":78,"in_reply_to":"1f485f77_8561b93c","updated":"2017-11-09 22:33:01.000000000","message":"Done","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            tlist.append(trait)"},{"line_number":87,"context_line":"        rp.set_traits(rp_obj.TraitList(objects\u003dtlist))"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    @staticmethod"},{"line_number":90,"context_line":"    def _rp_uuid_set(objs):"},{"line_number":91,"context_line":"        \"\"\"Return the set of resource_provider.uuid from an iterable."},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_45e621eb","line":89,"range":{"start_line":89,"start_character":4,"end_line":89,"end_character":17},"updated":"2017-11-09 17:39:58.000000000","message":"honestly, I don\u0027t know why we use @staticmethods for this kind of thing. If it was in the module scope, it\u0027s shorter to call anyway...\n\n some_rp_uuids \u003d _rp_uuid_set(...)\n\ninstead of:\n\n some_rp_uuids \u003d self._rp_uuid_set(...)\n\nI\u0027d just as sooner put it in the module scope. Easier to move a module-level function to a test helper module anyway that can be used by other test cases.","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":86,"context_line":"            tlist.append(trait)"},{"line_number":87,"context_line":"        rp.set_traits(rp_obj.TraitList(objects\u003dtlist))"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    @staticmethod"},{"line_number":90,"context_line":"    def _rp_uuid_set(objs):"},{"line_number":91,"context_line":"        \"\"\"Return the set of resource_provider.uuid from an iterable."},{"line_number":92,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_5bd03eca","line":89,"range":{"start_line":89,"start_character":4,"end_line":89,"end_character":17},"in_reply_to":"1f485f77_45e621eb","updated":"2017-11-09 22:33:01.000000000","message":"Done","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        rp.set_traits(rp_obj.TraitList(objects\u003dtlist))"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    @staticmethod"},{"line_number":90,"context_line":"    def _rp_uuid_set(objs):"},{"line_number":91,"context_line":"        \"\"\"Return the set of resource_provider.uuid from an iterable."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        :param objs: Iterable of any object with a resource_provider attribute"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_2539e540","line":90,"range":{"start_line":90,"start_character":8,"end_line":90,"end_character":20},"updated":"2017-11-09 17:39:58.000000000","message":"how about _provider_uuids_from_iterable()","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":87,"context_line":"        rp.set_traits(rp_obj.TraitList(objects\u003dtlist))"},{"line_number":88,"context_line":""},{"line_number":89,"context_line":"    @staticmethod"},{"line_number":90,"context_line":"    def _rp_uuid_set(objs):"},{"line_number":91,"context_line":"        \"\"\"Return the set of resource_provider.uuid from an iterable."},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"        :param objs: Iterable of any object with a resource_provider attribute"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_3bd582ba","line":90,"range":{"start_line":90,"start_character":8,"end_line":90,"end_character":20},"in_reply_to":"1f485f77_2539e540","updated":"2017-11-09 22:33:01.000000000","message":"Done","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                     (e.g. an AllocationRequest.resource_requests or an"},{"line_number":95,"context_line":"                     AllocationCandidates.provider_summaries)."},{"line_number":96,"context_line":"        \"\"\""},{"line_number":97,"context_line":"        return {obj.resource_provider.uuid for obj in objs}"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _extract_ar_rp_uuid_sets(self, alloc_cands):"},{"line_number":100,"context_line":"        \"\"\"Extract RP UUIDs from alloc candidates in a predictable way."}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_a573954d","line":97,"range":{"start_line":97,"start_character":15,"end_line":97,"end_character":16},"updated":"2017-11-09 17:39:58.000000000","message":"for those of us with terrible old eyes, please make this set() instead of {} notation, which is easily confused with dict notation.","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":94,"context_line":"                     (e.g. an AllocationRequest.resource_requests or an"},{"line_number":95,"context_line":"                     AllocationCandidates.provider_summaries)."},{"line_number":96,"context_line":"        \"\"\""},{"line_number":97,"context_line":"        return {obj.resource_provider.uuid for obj in objs}"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _extract_ar_rp_uuid_sets(self, alloc_cands):"},{"line_number":100,"context_line":"        \"\"\"Extract RP UUIDs from alloc candidates in a predictable way."}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_bbe05298","line":97,"range":{"start_line":97,"start_character":15,"end_line":97,"end_character":16},"in_reply_to":"1f485f77_a573954d","updated":"2017-11-09 22:33:01.000000000","message":"Done","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        \"\"\""},{"line_number":97,"context_line":"        return {obj.resource_provider.uuid for obj in objs}"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _extract_ar_rp_uuid_sets(self, alloc_cands):"},{"line_number":100,"context_line":"        \"\"\"Extract RP UUIDs from alloc candidates in a predictable way."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        Use to compare expected results of AllocationCandidates.get_by_filters."}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_45986169","line":99,"range":{"start_line":99,"start_character":8,"end_line":99,"end_character":32},"updated":"2017-11-09 17:39:58.000000000","message":"how about \"_provider_uuids_from_candidates\"? Also, can/should be a module-level function...","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":96,"context_line":"        \"\"\""},{"line_number":97,"context_line":"        return {obj.resource_provider.uuid for obj in objs}"},{"line_number":98,"context_line":""},{"line_number":99,"context_line":"    def _extract_ar_rp_uuid_sets(self, alloc_cands):"},{"line_number":100,"context_line":"        \"\"\"Extract RP UUIDs from alloc candidates in a predictable way."},{"line_number":101,"context_line":""},{"line_number":102,"context_line":"        Use to compare expected results of AllocationCandidates.get_by_filters."}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_bbf9724e","line":99,"range":{"start_line":99,"start_character":8,"end_line":99,"end_character":32},"in_reply_to":"1f485f77_45986169","updated":"2017-11-09 22:33:01.000000000","message":"Actually, decided to get rid of this and switch all inspection of allocation_requests over to the more explicit/comprehensible/readable thing we were looking at this morning.","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        Returns a sorted list of sets of resource provider UUIDs given an"},{"line_number":104,"context_line":"        AllocationCandidates object, of the form:"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            [{uuid, ...}, {uuid, ...}]"},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        ret \u003d []"},{"line_number":109,"context_line":"        for ar in alloc_cands.allocation_requests:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_45b181e1","line":106,"range":{"start_line":106,"start_character":26,"end_line":106,"end_character":27},"updated":"2017-11-09 17:39:58.000000000","message":"set()","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":103,"context_line":"        Returns a sorted list of sets of resource provider UUIDs given an"},{"line_number":104,"context_line":"        AllocationCandidates object, of the form:"},{"line_number":105,"context_line":""},{"line_number":106,"context_line":"            [{uuid, ...}, {uuid, ...}]"},{"line_number":107,"context_line":"        \"\"\""},{"line_number":108,"context_line":"        ret \u003d []"},{"line_number":109,"context_line":"        for ar in alloc_cands.allocation_requests:"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_fbffea31","line":106,"range":{"start_line":106,"start_character":26,"end_line":106,"end_character":27},"in_reply_to":"1f485f77_45b181e1","updated":"2017-11-09 22:33:01.000000000","message":"Done","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            ret.append(self._rp_uuid_set(ar.resource_requests))"},{"line_number":111,"context_line":"        return sorted(ret)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def _find_summary_for_provider(self, p_sums, rp_uuid):"},{"line_number":114,"context_line":"        for summary in p_sums:"},{"line_number":115,"context_line":"            if summary.resource_provider.uuid \u003d\u003d rp_uuid:"},{"line_number":116,"context_line":"                return summary"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _find_summary_for_resource(self, p_sum, rc_name):"},{"line_number":119,"context_line":"        for resource in p_sum.resources:"},{"line_number":120,"context_line":"            if resource.resource_class \u003d\u003d rc_name:"},{"line_number":121,"context_line":"                return resource"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _find_requests_for_provider(self, reqs, rp_uuid):"},{"line_number":124,"context_line":"        res \u003d []"},{"line_number":125,"context_line":"        for ar in reqs:"},{"line_number":126,"context_line":"            for rr in ar.resource_requests:"},{"line_number":127,"context_line":"                if rr.resource_provider.uuid \u003d\u003d rp_uuid:"},{"line_number":128,"context_line":"                    res.append(rr)"},{"line_number":129,"context_line":"        return res"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def _find_request_for_resource(self, res_reqs, rc_name):"},{"line_number":132,"context_line":"        for rr in res_reqs:"},{"line_number":133,"context_line":"            if rr.resource_class \u003d\u003d rc_name:"},{"line_number":134,"context_line":"                return rr"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def test_all_local(self):"},{"line_number":137,"context_line":"        \"\"\"Create some resource providers that can satisfy the request for"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_852ad9e4","line":134,"range":{"start_line":113,"start_character":0,"end_line":134,"end_character":25},"updated":"2017-11-09 17:39:58.000000000","message":"All these could be moved to the module scope as well, frankly.","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":110,"context_line":"            ret.append(self._rp_uuid_set(ar.resource_requests))"},{"line_number":111,"context_line":"        return sorted(ret)"},{"line_number":112,"context_line":""},{"line_number":113,"context_line":"    def _find_summary_for_provider(self, p_sums, rp_uuid):"},{"line_number":114,"context_line":"        for summary in p_sums:"},{"line_number":115,"context_line":"            if summary.resource_provider.uuid \u003d\u003d rp_uuid:"},{"line_number":116,"context_line":"                return summary"},{"line_number":117,"context_line":""},{"line_number":118,"context_line":"    def _find_summary_for_resource(self, p_sum, rc_name):"},{"line_number":119,"context_line":"        for resource in p_sum.resources:"},{"line_number":120,"context_line":"            if resource.resource_class \u003d\u003d rc_name:"},{"line_number":121,"context_line":"                return resource"},{"line_number":122,"context_line":""},{"line_number":123,"context_line":"    def _find_requests_for_provider(self, reqs, rp_uuid):"},{"line_number":124,"context_line":"        res \u003d []"},{"line_number":125,"context_line":"        for ar in reqs:"},{"line_number":126,"context_line":"            for rr in ar.resource_requests:"},{"line_number":127,"context_line":"                if rr.resource_provider.uuid \u003d\u003d rp_uuid:"},{"line_number":128,"context_line":"                    res.append(rr)"},{"line_number":129,"context_line":"        return res"},{"line_number":130,"context_line":""},{"line_number":131,"context_line":"    def _find_request_for_resource(self, res_reqs, rc_name):"},{"line_number":132,"context_line":"        for rr in res_reqs:"},{"line_number":133,"context_line":"            if rr.resource_class \u003d\u003d rc_name:"},{"line_number":134,"context_line":"                return rr"},{"line_number":135,"context_line":""},{"line_number":136,"context_line":"    def test_all_local(self):"},{"line_number":137,"context_line":"        \"\"\"Create some resource providers that can satisfy the request for"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_56b5b5ed","line":134,"range":{"start_line":113,"start_character":0,"end_line":134,"end_character":25},"in_reply_to":"1f485f77_852ad9e4","updated":"2017-11-09 22:33:01.000000000","message":"Done.  (First two removed because no longer needed after porting _validate_allocation_requests)","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"0675b439107f8f559d9acd19de33c908e1f63b1b","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        # Ask for the alternative placement possibilities and verify each"},{"line_number":155,"context_line":"        # provider is returned"},{"line_number":156,"context_line":"        p_alts \u003d self._get_allocation_candidates()"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        # Verify the provider summary information indicates 0 usage and"},{"line_number":159,"context_line":"        # capacity calculated from above inventory numbers for both compute"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_45d061ca","line":156,"range":{"start_line":156,"start_character":8,"end_line":156,"end_character":14},"updated":"2017-11-09 17:39:58.000000000","message":"eventually (not in this patch though), we\u0027ll want to replace the variables named p_alts with alloc_cands or similar. p_alts is a vestigial tail from when we referred to the AllocationCandidates thing as \"provider alternates\"","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"9307bfb2396c4bc277cebf6047c04c83c3c39f85","unresolved":false,"context_lines":[{"line_number":153,"context_line":""},{"line_number":154,"context_line":"        # Ask for the alternative placement possibilities and verify each"},{"line_number":155,"context_line":"        # provider is returned"},{"line_number":156,"context_line":"        p_alts \u003d self._get_allocation_candidates()"},{"line_number":157,"context_line":""},{"line_number":158,"context_line":"        # Verify the provider summary information indicates 0 usage and"},{"line_number":159,"context_line":"        # capacity calculated from above inventory numbers for both compute"}],"source_content_type":"text/x-python","patch_set":2,"id":"1f485f77_d6c88575","line":156,"range":{"start_line":156,"start_character":8,"end_line":156,"end_character":14},"in_reply_to":"1f485f77_45d061ca","updated":"2017-11-09 22:33:01.000000000","message":"Might as well do it here.  Done.","commit_id":"a68cddbc9706f093d12ea0da56fc5b66cdf9c1a9"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"04c60c508d4c99d102383485646c99aa9db46367","unresolved":false,"context_lines":[{"line_number":138,"context_line":"        expected.sort()"},{"line_number":139,"context_line":""},{"line_number":140,"context_line":"        # Now we ought to be able to compare them"},{"line_number":141,"context_line":"        self.assertEqual(expected, observed)"},{"line_number":142,"context_line":""},{"line_number":143,"context_line":"    def test_all_local(self):"},{"line_number":144,"context_line":"        \"\"\"Create some resource providers that can satisfy the request for"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_144f2bbe","line":141,"updated":"2017-11-10 14:12:35.000000000","message":"Bravo. Excellent little helper method.","commit_id":"01bee2e32c245416616cc632ecf39cfbb565b809"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"04c60c508d4c99d102383485646c99aa9db46367","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        p_sums \u003d alloc_cands.provider_summaries"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        self.assertEqual(set([uuids.cn1, uuids.cn2]),"},{"line_number":173,"context_line":"                         _provider_uuids_from_iterable(p_sums))"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        cn1_p_sum \u003d _find_summary_for_provider(p_sums, uuids.cn1)"},{"line_number":176,"context_line":"        self.assertIsNotNone(cn1_p_sum)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_94e9db81","line":173,"updated":"2017-11-10 14:12:35.000000000","message":"Potential improvement for a future patch... you could have a assert_provider_uuids_equal() method that accepted an iterable of expected UUIDs and a provider summaries list or allocation requests list. That way, the above (oft-repeated) call would look like this:\n\n self.assert_provider_uuids_equal([uuids.cn1, uuids.cn2], p_sums)","commit_id":"01bee2e32c245416616cc632ecf39cfbb565b809"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"6543a653cc20cefb559ed8195a60c3ffc6cc3198","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        p_sums \u003d alloc_cands.provider_summaries"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        self.assertEqual(set([uuids.cn1, uuids.cn2]),"},{"line_number":173,"context_line":"                         _provider_uuids_from_iterable(p_sums))"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        cn1_p_sum \u003d _find_summary_for_provider(p_sums, uuids.cn1)"},{"line_number":176,"context_line":"        self.assertIsNotNone(cn1_p_sum)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_f42a4f8e","line":173,"in_reply_to":"1f485f77_94e9db81","updated":"2017-11-10 14:19:42.000000000","message":"I was thinking of going all the way to a _validate_provider_summaries that would take in a nice readable nested structure of the same ilk as _validate_allocation_requests.  A call to that would replace everything from here to L196.","commit_id":"01bee2e32c245416616cc632ecf39cfbb565b809"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0076e00a3cae18197ae32ec49bec86d14f62f1a9","unresolved":false,"context_lines":[{"line_number":170,"context_line":"        p_sums \u003d alloc_cands.provider_summaries"},{"line_number":171,"context_line":""},{"line_number":172,"context_line":"        self.assertEqual(set([uuids.cn1, uuids.cn2]),"},{"line_number":173,"context_line":"                         _provider_uuids_from_iterable(p_sums))"},{"line_number":174,"context_line":""},{"line_number":175,"context_line":"        cn1_p_sum \u003d _find_summary_for_provider(p_sums, uuids.cn1)"},{"line_number":176,"context_line":"        self.assertIsNotNone(cn1_p_sum)"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_62620a41","line":173,"in_reply_to":"1f485f77_f42a4f8e","updated":"2017-11-13 05:16:44.000000000","message":"yea, I like the line 204 way.","commit_id":"01bee2e32c245416616cc632ecf39cfbb565b809"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"0076e00a3cae18197ae32ec49bec86d14f62f1a9","unresolved":false,"context_lines":[{"line_number":208,"context_line":"            [(\u0027cn2\u0027, fields.ResourceClass.VCPU, 1),"},{"line_number":209,"context_line":"             (\u0027cn2\u0027, fields.ResourceClass.MEMORY_MB, 64),"},{"line_number":210,"context_line":"             (\u0027cn2\u0027, fields.ResourceClass.DISK_GB, 1500)],"},{"line_number":211,"context_line":"        ]"},{"line_number":212,"context_line":"        self._validate_allocation_requests(expected, alloc_cands)"},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"    def test_local_with_shared_disk(self):"}],"source_content_type":"text/x-python","patch_set":3,"id":"1f485f77_e26cba37","line":211,"updated":"2017-11-13 05:16:44.000000000","message":"yea, this is more readable.","commit_id":"01bee2e32c245416616cc632ecf39cfbb565b809"}]}
