)]}'
{"neutron/db/ipam_backend_mixin.py":[{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"c0c654fe829d15256ade00d49b79f9d3c55c0e91","unresolved":false,"context_lines":[{"line_number":609,"context_line":"        query \u003d self._query_subnets_on_network(context, network_id)"},{"line_number":610,"context_line":"        query \u003d self._query_filter_service_subnets(query, service_type)"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"        def host_is_set(host):"},{"line_number":613,"context_line":"            # This seems redundant, but its not. Host is unset if its None, \u0027\u0027,"},{"line_number":614,"context_line":"            # or ATTR_NOT_SPECIFIED due to differences in host binding"},{"line_number":615,"context_line":"            # implementations."}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_37108701","line":612,"range":{"start_line":612,"start_character":12,"end_line":612,"end_character":23},"updated":"2016-08-26 20:56:19.000000000","message":"This is meant to be a question to be answered with True or False.... Consider naming it \u0027is_host_set\u0027","commit_id":"f9b51d44189db8884bbdb828e135454e21bcd01c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"368f118d2c61f0a725dbdbbea8cdbfe78c659384","unresolved":false,"context_lines":[{"line_number":609,"context_line":"        query \u003d self._query_subnets_on_network(context, network_id)"},{"line_number":610,"context_line":"        query \u003d self._query_filter_service_subnets(query, service_type)"},{"line_number":611,"context_line":""},{"line_number":612,"context_line":"        def host_is_set(host):"},{"line_number":613,"context_line":"            # This seems redundant, but its not. Host is unset if its None, \u0027\u0027,"},{"line_number":614,"context_line":"            # or ATTR_NOT_SPECIFIED due to differences in host binding"},{"line_number":615,"context_line":"            # implementations."}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_283bc1d2","line":612,"range":{"start_line":612,"start_character":12,"end_line":612,"end_character":23},"in_reply_to":"fa7ab95a_37108701","updated":"2016-08-26 22:38:12.000000000","message":"You\u0027re right. Will do if I need another patch set.","commit_id":"f9b51d44189db8884bbdb828e135454e21bcd01c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"c0c654fe829d15256ade00d49b79f9d3c55c0e91","unresolved":false,"context_lines":[{"line_number":615,"context_line":"            # implementations."},{"line_number":616,"context_line":"            return host and validators.is_attr_set(host)"},{"line_number":617,"context_line":""},{"line_number":618,"context_line":"        def make_subnet_dict_list(subnets):"},{"line_number":619,"context_line":"            \"\"\"Prioritize the subnet list. Raise appropriate error if empty\"\"\""},{"line_number":620,"context_line":"            subnets \u003d [self._make_subnet_dict(subnet, context\u003dcontext)"},{"line_number":621,"context_line":"                       for subnet in subnets]"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_3af4eef0","line":618,"updated":"2016-08-26 20:56:19.000000000","message":"I especially liked this method! It makes the search for the exceptions crystal clear. I was having trouble with that aspect in the previous implementation","commit_id":"f9b51d44189db8884bbdb828e135454e21bcd01c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"c0c654fe829d15256ade00d49b79f9d3c55c0e91","unresolved":false,"context_lines":[{"line_number":628,"context_line":"            # Why no subnets? Determine why to produce the right error."},{"line_number":629,"context_line":"            query \u003d self._query_subnets_on_network(context, network_id)"},{"line_number":630,"context_line":""},{"line_number":631,"context_line":"            if host_is_set(host):"},{"line_number":632,"context_line":"                # Empty because host isn\u0027t mapped to a segment with a subnet?"},{"line_number":633,"context_line":"                subnets \u003d query.filter(models_v2.Subnet.segment_id.isnot(None))"},{"line_number":634,"context_line":"                if subnets.limit(1).count() !\u003d 0:"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_77cf6f7f","line":631,"range":{"start_line":631,"start_character":15,"end_line":631,"end_character":26},"updated":"2016-08-26 20:56:19.000000000","message":"See comment to L612","commit_id":"f9b51d44189db8884bbdb828e135454e21bcd01c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"ad48bafdc947da7022e507df1ece1f22ecb6185c","unresolved":false,"context_lines":[{"line_number":631,"context_line":"            if host_is_set(host):"},{"line_number":632,"context_line":"                # Empty because host isn\u0027t mapped to a segment with a subnet?"},{"line_number":633,"context_line":"                subnets \u003d query.filter(models_v2.Subnet.segment_id.isnot(None))"},{"line_number":634,"context_line":"                if subnets.limit(1).count() !\u003d 0:"},{"line_number":635,"context_line":"                    # It is a routed network but no subnets found for host"},{"line_number":636,"context_line":"                    raise segment_exc.HostNotConnectedToAnySegment("},{"line_number":637,"context_line":"                        host\u003dhost, network_id\u003dnetwork_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_a150d55f","line":634,"updated":"2016-08-26 20:13:03.000000000","message":"I would just change the variable name used here to something else (s_query?) since it\u0027s shadowing subnets from L620, even though it isn\u0027t used below.","commit_id":"f9b51d44189db8884bbdb828e135454e21bcd01c"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"1511b540fc589cf4900c188cf8d45b06b4cb2b2e","unresolved":false,"context_lines":[{"line_number":631,"context_line":"            if host_is_set(host):"},{"line_number":632,"context_line":"                # Empty because host isn\u0027t mapped to a segment with a subnet?"},{"line_number":633,"context_line":"                subnets \u003d query.filter(models_v2.Subnet.segment_id.isnot(None))"},{"line_number":634,"context_line":"                if subnets.limit(1).count() !\u003d 0:"},{"line_number":635,"context_line":"                    # It is a routed network but no subnets found for host"},{"line_number":636,"context_line":"                    raise segment_exc.HostNotConnectedToAnySegment("},{"line_number":637,"context_line":"                        host\u003dhost, network_id\u003dnetwork_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_e4e10b9c","line":634,"in_reply_to":"fa7ab95a_a150d55f","updated":"2016-08-26 20:27:50.000000000","message":"I actually had something like that but then noticed that the line would have to wrap with the name I was using. s_query is the same length so maybe that will work. If I have to spin, I\u0027ll change it.","commit_id":"f9b51d44189db8884bbdb828e135454e21bcd01c"},{"author":{"_account_id":1131,"name":"Brian Haley","email":"haleyb.dev@gmail.com","username":"brian-haley"},"change_message_id":"2b96c9724f19b57f497cd6a9a148478929e7f085","unresolved":false,"context_lines":[{"line_number":631,"context_line":"            if host_is_set(host):"},{"line_number":632,"context_line":"                # Empty because host isn\u0027t mapped to a segment with a subnet?"},{"line_number":633,"context_line":"                subnets \u003d query.filter(models_v2.Subnet.segment_id.isnot(None))"},{"line_number":634,"context_line":"                if subnets.limit(1).count() !\u003d 0:"},{"line_number":635,"context_line":"                    # It is a routed network but no subnets found for host"},{"line_number":636,"context_line":"                    raise segment_exc.HostNotConnectedToAnySegment("},{"line_number":637,"context_line":"                        host\u003dhost, network_id\u003dnetwork_id)"}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_a408e32e","line":634,"in_reply_to":"fa7ab95a_e4e10b9c","updated":"2016-08-26 20:32:00.000000000","message":"Ok, sounds like a plan.","commit_id":"f9b51d44189db8884bbdb828e135454e21bcd01c"},{"author":{"_account_id":4694,"name":"Miguel Lavalle","email":"miguel@mlavalle.com","username":"minsel"},"change_message_id":"c0c654fe829d15256ade00d49b79f9d3c55c0e91","unresolved":false,"context_lines":[{"line_number":650,"context_line":"            raise ipam_exceptions.IpAddressGenerationFailureNoMatchingSubnet()"},{"line_number":651,"context_line":""},{"line_number":652,"context_line":"        # Select candidate subnets and return them"},{"line_number":653,"context_line":"        if not host_is_set(host):"},{"line_number":654,"context_line":"            # If the host isn\u0027t known, we can\u0027t allocate on a routed network."},{"line_number":655,"context_line":"            # So, exclude any subnets attached to segments."},{"line_number":656,"context_line":"            return make_subnet_dict_list("}],"source_content_type":"text/x-python","patch_set":1,"id":"fa7ab95a_d7c4bb60","line":653,"range":{"start_line":653,"start_character":15,"end_line":653,"end_character":26},"updated":"2016-08-26 20:56:19.000000000","message":"See comment to L612","commit_id":"f9b51d44189db8884bbdb828e135454e21bcd01c"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"d91712b435b4979aae4e6f891e8a43ba0d5a5560","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        return query.from_self(models_v2.Subnet)"},{"line_number":578,"context_line":""},{"line_number":579,"context_line":"    @staticmethod"},{"line_number":580,"context_line":"    def _query_filter_by_segment_host_mapping(query, host):"},{"line_number":581,"context_line":"        Subnet \u003d models_v2.Subnet"},{"line_number":582,"context_line":"        SegmentHostMapping \u003d segment_svc_db.SegmentHostMapping"},{"line_number":583,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_a6a260fa","line":580,"updated":"2016-09-01 23:23:34.000000000","message":"These methods that accept \u0027query\u0027 as a parameter are hard to reason about, because you have to look at how / where the method is called to understand what exactly is \u0027query\u0027. Typically DB methods are nice and simple when they look like \u0027_query_subnets_on_network\u0027 even if the content of the method is much more complex, since the method accepts primitive arguments and returns a query. The patch doesn\u0027t really change the existence of these kind of methods, so no reason to delay this patch, but just food for thought...\n\nMethods that accept a query are also much harder to target with a unit test.","commit_id":"5c0efda6cee690a2f1d90c87938fdf36223b19ce"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"d91712b435b4979aae4e6f891e8a43ba0d5a5560","unresolved":false,"context_lines":[{"line_number":637,"context_line":""},{"line_number":638,"context_line":"            if not query.limit(1).count():"},{"line_number":639,"context_line":"                # Network has *no* subnets of any kind. This isn\u0027t an error."},{"line_number":640,"context_line":"                return []"},{"line_number":641,"context_line":""},{"line_number":642,"context_line":"            # Does filtering ineligible service subnets makes the list empty?"},{"line_number":643,"context_line":"            query \u003d self._query_filter_service_subnets(query, service_type)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_46fef4ae","line":640,"updated":"2016-09-01 23:23:34.000000000","message":"This code path used to return None (LOC 581 before the change). Is this change of return value wanted?","commit_id":"5c0efda6cee690a2f1d90c87938fdf36223b19ce"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"71c4f0e8f64aa19342360bec5dd10813f4399687","unresolved":false,"context_lines":[{"line_number":637,"context_line":""},{"line_number":638,"context_line":"            if not query.limit(1).count():"},{"line_number":639,"context_line":"                # Network has *no* subnets of any kind. This isn\u0027t an error."},{"line_number":640,"context_line":"                return []"},{"line_number":641,"context_line":""},{"line_number":642,"context_line":"            # Does filtering ineligible service subnets makes the list empty?"},{"line_number":643,"context_line":"            query \u003d self._query_filter_service_subnets(query, service_type)"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_464994b6","line":640,"in_reply_to":"fa7ab95a_46fef4ae","updated":"2016-09-01 23:41:17.000000000","message":"None was returned from _check_service_subnets but then [] would have been returned from _ipam_get_subnets even in the old code.","commit_id":"5c0efda6cee690a2f1d90c87938fdf36223b19ce"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"d91712b435b4979aae4e6f891e8a43ba0d5a5560","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            if query.limit(1).count():"},{"line_number":645,"context_line":"                # No, must be a deferred IP port because there are matching"},{"line_number":646,"context_line":"                # subnets. Happens on routed networks when host isn\u0027t known."},{"line_number":647,"context_line":"                return []"},{"line_number":648,"context_line":""},{"line_number":649,"context_line":"            raise ipam_exceptions.IpAddressGenerationFailureNoMatchingSubnet()"},{"line_number":650,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_c6284436","line":647,"updated":"2016-09-01 23:23:34.000000000","message":"Same comment.","commit_id":"5c0efda6cee690a2f1d90c87938fdf36223b19ce"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"71c4f0e8f64aa19342360bec5dd10813f4399687","unresolved":false,"context_lines":[{"line_number":644,"context_line":"            if query.limit(1).count():"},{"line_number":645,"context_line":"                # No, must be a deferred IP port because there are matching"},{"line_number":646,"context_line":"                # subnets. Happens on routed networks when host isn\u0027t known."},{"line_number":647,"context_line":"                return []"},{"line_number":648,"context_line":""},{"line_number":649,"context_line":"            raise ipam_exceptions.IpAddressGenerationFailureNoMatchingSubnet()"},{"line_number":650,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_86cd5c33","line":647,"in_reply_to":"fa7ab95a_c6284436","updated":"2016-09-01 23:41:17.000000000","message":"ditto","commit_id":"5c0efda6cee690a2f1d90c87938fdf36223b19ce"},{"author":{"_account_id":8873,"name":"Assaf Muller","email":"amuller@redhat.com","username":"amuller"},"change_message_id":"d91712b435b4979aae4e6f891e8a43ba0d5a5560","unresolved":false,"context_lines":[{"line_number":652,"context_line":"        if not is_host_set(host):"},{"line_number":653,"context_line":"            # If the host isn\u0027t known, we can\u0027t allocate on a routed network."},{"line_number":654,"context_line":"            # So, exclude any subnets attached to segments."},{"line_number":655,"context_line":"            return make_subnet_dict_list("},{"line_number":656,"context_line":"                self._query_exclude_subnets_on_segments(query))"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        # The host is known. Consider both routed and non-routed networks"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_c6e924b9","line":655,"updated":"2016-09-01 23:23:34.000000000","message":"It\u0027s confusing that is the host is not set you still run make_subnet_dict_list. It means that you run some code that you didn\u0027t run before, including checking if the host was set again. That\u0027s obviously not a performance issue, just seems like the code is still not arranged ideally somehow.","commit_id":"5c0efda6cee690a2f1d90c87938fdf36223b19ce"},{"author":{"_account_id":7448,"name":"Carl Baldwin","email":"carl@ecbaldwin.net","username":"carl-baldwin"},"change_message_id":"71c4f0e8f64aa19342360bec5dd10813f4399687","unresolved":false,"context_lines":[{"line_number":652,"context_line":"        if not is_host_set(host):"},{"line_number":653,"context_line":"            # If the host isn\u0027t known, we can\u0027t allocate on a routed network."},{"line_number":654,"context_line":"            # So, exclude any subnets attached to segments."},{"line_number":655,"context_line":"            return make_subnet_dict_list("},{"line_number":656,"context_line":"                self._query_exclude_subnets_on_segments(query))"},{"line_number":657,"context_line":""},{"line_number":658,"context_line":"        # The host is known. Consider both routed and non-routed networks"}],"source_content_type":"text/x-python","patch_set":6,"id":"fa7ab95a_060b0c2b","line":655,"in_reply_to":"fa7ab95a_c6e924b9","updated":"2016-09-01 23:41:17.000000000","message":"I\u0027m kind of already working on this based on feedback directly from armax","commit_id":"5c0efda6cee690a2f1d90c87938fdf36223b19ce"}]}
