)]}'
{"quantum/db/db_base_plugin_v2.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":763,"context_line":"        # Treat gw as IPset as well"},{"line_number":764,"context_line":"        if gateway_ip:"},{"line_number":765,"context_line":"            ip_ranges.append(gateway_ip)"},{"line_number":766,"context_line":"            ip_sets.append(netaddr.IPSet([gateway_ip]))"},{"line_number":767,"context_line":"        # Use integer cursors as an efficient way for implementing"},{"line_number":768,"context_line":"        # comparison and avoiding comparing the same pair twice"},{"line_number":769,"context_line":"        for l_cursor in range(len(ip_sets)):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FEF8%3D","side":"PARENT","line":766,"updated":"2013-02-08 11:26:18.000000000","message":"How is this affecting the logic?\nI need to think more about it, but something it\u0027s still not totally clear to me. More details in the general review comment.","commit_id":"311437f0437d1408e23e25c1a4864575dc3cacf9"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":825,"context_line":"            pools \u003d subnet[\u0027allocation_pools\u0027]"},{"line_number":826,"context_line":"            self._validate_allocation_pools(pools,"},{"line_number":827,"context_line":"                                            subnet[\u0027gateway_ip\u0027],"},{"line_number":828,"context_line":"                                            subnet[\u0027cidr\u0027])"},{"line_number":829,"context_line":"            return pools"},{"line_number":830,"context_line":""},{"line_number":831,"context_line":"    def _validate_shared_update(self, context, id, original, updated):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FEGI%3D","side":"PARENT","line":828,"updated":"2013-02-08 11:26:18.000000000","message":"I have the impression that removing these lines will not allow us to validate the pool when it\u0027s been specified by the user.\n\nOr am I not reading your code right?","commit_id":"311437f0437d1408e23e25c1a4864575dc3cacf9"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"607c0d9b633f03fb94de8e1b492b946329fedab9","unresolved":false,"context_lines":[{"line_number":990,"context_line":"        # If \u0027s\u0027 dict does not have \u0027ip_version\u0027 field in an API call"},{"line_number":991,"context_line":"        # (e.g., update_subnet()), you need to set \u0027ip_version\u0027 field"},{"line_number":992,"context_line":"        # before calling this method."},{"line_number":993,"context_line":""},{"line_number":994,"context_line":"        ip_ver \u003d s[\u0027ip_version\u0027]"},{"line_number":995,"context_line":""},{"line_number":996,"context_line":"        if \u0027cidr\u0027 in s:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FE1w%3D","line":993,"updated":"2013-02-07 21:51:23.000000000","message":"nit:related change?","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"352da3325ef29d81968794236e34cf613a88ed9e","unresolved":false,"context_lines":[{"line_number":990,"context_line":"        # If \u0027s\u0027 dict does not have \u0027ip_version\u0027 field in an API call"},{"line_number":991,"context_line":"        # (e.g., update_subnet()), you need to set \u0027ip_version\u0027 field"},{"line_number":992,"context_line":"        # before calling this method."},{"line_number":993,"context_line":""},{"line_number":994,"context_line":"        ip_ver \u003d s[\u0027ip_version\u0027]"},{"line_number":995,"context_line":""},{"line_number":996,"context_line":"        if \u0027cidr\u0027 in s:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2B%2B%2BQ%3D","line":993,"in_reply_to":"AAAAM3%2F%2FE1w%3D","updated":"2013-02-12 15:52:17.000000000","message":"Done","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"607c0d9b633f03fb94de8e1b492b946329fedab9","unresolved":false,"context_lines":[{"line_number":997,"context_line":"            self._validate_ip_version(ip_ver, s[\u0027cidr\u0027], \u0027cidr\u0027)"},{"line_number":998,"context_line":""},{"line_number":999,"context_line":"        if attributes.is_attr_set(s.get(\u0027allocation_pools\u0027)):"},{"line_number":1000,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027], s[\u0027cidr\u0027])"},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"        if attributes.is_attr_set(s.get(\u0027gateway_ip\u0027)):"},{"line_number":1003,"context_line":"            self._validate_ip_version(ip_ver, s[\u0027gateway_ip\u0027], \u0027gateway_ip\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FE1c%3D","line":1000,"updated":"2013-02-07 21:51:23.000000000","message":"IMO, we should also evaluate the case if the attributes.is_attr_set(s.get(\u0027gateway_ip\u0027)) is true in the _validate_allocation_pools","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"352da3325ef29d81968794236e34cf613a88ed9e","unresolved":false,"context_lines":[{"line_number":997,"context_line":"            self._validate_ip_version(ip_ver, s[\u0027cidr\u0027], \u0027cidr\u0027)"},{"line_number":998,"context_line":""},{"line_number":999,"context_line":"        if attributes.is_attr_set(s.get(\u0027allocation_pools\u0027)):"},{"line_number":1000,"context_line":"            self._validate_allocation_pools(s[\u0027allocation_pools\u0027], s[\u0027cidr\u0027])"},{"line_number":1001,"context_line":""},{"line_number":1002,"context_line":"        if attributes.is_attr_set(s.get(\u0027gateway_ip\u0027)):"},{"line_number":1003,"context_line":"            self._validate_ip_version(ip_ver, s[\u0027gateway_ip\u0027], \u0027gateway_ip\u0027)"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2B%2B%2BY%3D","line":1000,"in_reply_to":"AAAAM3%2F%2FE1c%3D","updated":"2013-02-12 15:52:17.000000000","message":"I\u0027ve removed _validate_allocation_pools out of _validate_subnet since allocation_pool can\u0027t change while updating the subnet. I\u0027ve put it in create_subnet.","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"607c0d9b633f03fb94de8e1b492b946329fedab9","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"                not QuantumDbPluginV2._check_subnet_ip(s[\u0027cidr\u0027],"},{"line_number":1006,"context_line":"                                                       s[\u0027gateway_ip\u0027])):"},{"line_number":1007,"context_line":"                error_message \u003d _(\"Gateway is not valid on subnet\")"},{"line_number":1008,"context_line":"                raise q_exc.InvalidInput(error_message\u003derror_message)"},{"line_number":1009,"context_line":"            if attributes.is_attr_set(s.get(\u0027allocation_pools\u0027)):"},{"line_number":1010,"context_line":"                for allocation_pool in s[\u0027allocation_pools\u0027]:"},{"line_number":1011,"context_line":"                    pool_range \u003d netaddr.IPRange("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FE2Y%3D","line":1008,"updated":"2013-02-07 21:51:23.000000000","message":"It is better to split L1009 - L1017 as method for redability","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"352da3325ef29d81968794236e34cf613a88ed9e","unresolved":false,"context_lines":[{"line_number":1005,"context_line":"                not QuantumDbPluginV2._check_subnet_ip(s[\u0027cidr\u0027],"},{"line_number":1006,"context_line":"                                                       s[\u0027gateway_ip\u0027])):"},{"line_number":1007,"context_line":"                error_message \u003d _(\"Gateway is not valid on subnet\")"},{"line_number":1008,"context_line":"                raise q_exc.InvalidInput(error_message\u003derror_message)"},{"line_number":1009,"context_line":"            if attributes.is_attr_set(s.get(\u0027allocation_pools\u0027)):"},{"line_number":1010,"context_line":"                for allocation_pool in s[\u0027allocation_pools\u0027]:"},{"line_number":1011,"context_line":"                    pool_range \u003d netaddr.IPRange("}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2B%2B%2BM%3D","line":1008,"in_reply_to":"AAAAM3%2F%2FE2Y%3D","updated":"2013-02-12 15:52:17.000000000","message":"Done","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2031,"name":"Nachi Ueno","email":"nati.ueno@gmail.com","username":"nati-ueno"},"change_message_id":"607c0d9b633f03fb94de8e1b492b946329fedab9","unresolved":false,"context_lines":[{"line_number":1040,"context_line":"                self._validate_host_route(rt, ip_ver)"},{"line_number":1041,"context_line":""},{"line_number":1042,"context_line":"    def create_subnet(self, context, subnet):"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1045,"context_line":"        net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1046,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FE1k%3D","line":1043,"updated":"2013-02-07 21:51:23.000000000","message":"nit: this line needed?","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"352da3325ef29d81968794236e34cf613a88ed9e","unresolved":false,"context_lines":[{"line_number":1040,"context_line":"                self._validate_host_route(rt, ip_ver)"},{"line_number":1041,"context_line":""},{"line_number":1042,"context_line":"    def create_subnet(self, context, subnet):"},{"line_number":1043,"context_line":""},{"line_number":1044,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1045,"context_line":"        net \u003d netaddr.IPNetwork(s[\u0027cidr\u0027])"},{"line_number":1046,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2B%2B%2BI%3D","line":1043,"in_reply_to":"AAAAM3%2F%2FE1k%3D","updated":"2013-02-12 15:52:17.000000000","message":"Done","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"18515c1aa3d68b98336d7e395b480f708726bd16","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"            subnet \u003d models_v2.Subnet(**args)"},{"line_number":1068,"context_line":""},{"line_number":1069,"context_line":"            # perform allocate pools first, since it might raise an error"},{"line_number":1070,"context_line":"            # pools \u003d self._allocate_pools_for_subnet(context, s)"},{"line_number":1071,"context_line":""},{"line_number":1072,"context_line":"            context.session.add(subnet)"},{"line_number":1073,"context_line":"            if s[\u0027dns_nameservers\u0027] is not attributes.ATTR_NOT_SPECIFIED:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FFiA%3D","line":1070,"updated":"2013-02-07 15:43:47.000000000","message":"why is this commented out? did you intend to delete it?","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"352da3325ef29d81968794236e34cf613a88ed9e","unresolved":false,"context_lines":[{"line_number":1067,"context_line":"            subnet \u003d models_v2.Subnet(**args)"},{"line_number":1068,"context_line":""},{"line_number":1069,"context_line":"            # perform allocate pools first, since it might raise an error"},{"line_number":1070,"context_line":"            # pools \u003d self._allocate_pools_for_subnet(context, s)"},{"line_number":1071,"context_line":""},{"line_number":1072,"context_line":"            context.session.add(subnet)"},{"line_number":1073,"context_line":"            if s[\u0027dns_nameservers\u0027] is not attributes.ATTR_NOT_SPECIFIED:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FD1A%3D","line":1070,"in_reply_to":"AAAAM3%2F%2FFiA%3D","updated":"2013-02-12 15:52:17.000000000","message":"Done","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1067,"context_line":"            subnet \u003d models_v2.Subnet(**args)"},{"line_number":1068,"context_line":""},{"line_number":1069,"context_line":"            # perform allocate pools first, since it might raise an error"},{"line_number":1070,"context_line":"            # pools \u003d self._allocate_pools_for_subnet(context, s)"},{"line_number":1071,"context_line":""},{"line_number":1072,"context_line":"            context.session.add(subnet)"},{"line_number":1073,"context_line":"            if s[\u0027dns_nameservers\u0027] is not attributes.ATTR_NOT_SPECIFIED:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FEH4%3D","line":1070,"in_reply_to":"AAAAM3%2F%2FFiA%3D","updated":"2013-02-08 11:26:18.000000000","message":"The comment at line 1069, as well as the restriction can probably be lifted now (it\u0027s all in the same transaction)","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1110,"context_line":"        # value since _validate_subnet() expects subnet spec has \u0027ip_version\u0027"},{"line_number":1111,"context_line":"        # and \u0027allocation_pools\u0027 fields."},{"line_number":1112,"context_line":"        s[\u0027ip_version\u0027] \u003d self._get_subnet(context, id).ip_version"},{"line_number":1113,"context_line":"        pools \u003d self._get_subnet(context, id).allocation_pools"},{"line_number":1114,"context_line":"        s[\u0027allocation_pools\u0027] \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1115,"context_line":"                                 for p in pools]"},{"line_number":1116,"context_line":"        s[\u0027cidr\u0027] \u003d self._get_subnet(context, id).cidr"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FEHE%3D","line":1113,"updated":"2013-02-08 11:26:18.000000000","message":"You\u0027re doing the query twice. \n\ns \u003d self._get_subnet(context, id).ip_version\n\ns.update(subnet[\u0027subnet\u0027])\n\nself._validate_subnet(self._make_subnet_dict(s))","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"352da3325ef29d81968794236e34cf613a88ed9e","unresolved":false,"context_lines":[{"line_number":1110,"context_line":"        # value since _validate_subnet() expects subnet spec has \u0027ip_version\u0027"},{"line_number":1111,"context_line":"        # and \u0027allocation_pools\u0027 fields."},{"line_number":1112,"context_line":"        s[\u0027ip_version\u0027] \u003d self._get_subnet(context, id).ip_version"},{"line_number":1113,"context_line":"        pools \u003d self._get_subnet(context, id).allocation_pools"},{"line_number":1114,"context_line":"        s[\u0027allocation_pools\u0027] \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1115,"context_line":"                                 for p in pools]"},{"line_number":1116,"context_line":"        s[\u0027cidr\u0027] \u003d self._get_subnet(context, id).cidr"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2B%2B%2BE%3D","line":1113,"in_reply_to":"AAAAM3%2F%2FEHE%3D","updated":"2013-02-12 15:52:17.000000000","message":"Done","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1112,"context_line":"        s[\u0027ip_version\u0027] \u003d self._get_subnet(context, id).ip_version"},{"line_number":1113,"context_line":"        pools \u003d self._get_subnet(context, id).allocation_pools"},{"line_number":1114,"context_line":"        s[\u0027allocation_pools\u0027] \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1115,"context_line":"                                 for p in pools]"},{"line_number":1116,"context_line":"        s[\u0027cidr\u0027] \u003d self._get_subnet(context, id).cidr"},{"line_number":1117,"context_line":"        self._validate_subnet(s)"},{"line_number":1118,"context_line":"        # allocation_pools is read-only, we just use it for validate gateway."}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FEHk%3D","line":1115,"updated":"2013-02-08 11:26:18.000000000","message":"I am not sure what to do here.\nI understand why you\u0027re doing this, but at the same time I think this kind of logic will hinder maintainability over time.\n\nI wonder if it would be an overkill to just invoke _make_subnet_dict to transform the data from API to DB representation.","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"352da3325ef29d81968794236e34cf613a88ed9e","unresolved":false,"context_lines":[{"line_number":1112,"context_line":"        s[\u0027ip_version\u0027] \u003d self._get_subnet(context, id).ip_version"},{"line_number":1113,"context_line":"        pools \u003d self._get_subnet(context, id).allocation_pools"},{"line_number":1114,"context_line":"        s[\u0027allocation_pools\u0027] \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1115,"context_line":"                                 for p in pools]"},{"line_number":1116,"context_line":"        s[\u0027cidr\u0027] \u003d self._get_subnet(context, id).cidr"},{"line_number":1117,"context_line":"        self._validate_subnet(s)"},{"line_number":1118,"context_line":"        # allocation_pools is read-only, we just use it for validate gateway."}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2B%2B88%3D","line":1115,"in_reply_to":"AAAAM3%2F%2FEHk%3D","updated":"2013-02-12 15:52:17.000000000","message":"invoking _make_subnet_dict could be a way to explore, but it could brake more code.","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1113,"context_line":"        pools \u003d self._get_subnet(context, id).allocation_pools"},{"line_number":1114,"context_line":"        s[\u0027allocation_pools\u0027] \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1115,"context_line":"                                 for p in pools]"},{"line_number":1116,"context_line":"        s[\u0027cidr\u0027] \u003d self._get_subnet(context, id).cidr"},{"line_number":1117,"context_line":"        self._validate_subnet(s)"},{"line_number":1118,"context_line":"        # allocation_pools is read-only, we just use it for validate gateway."},{"line_number":1119,"context_line":"        del s[\u0027allocation_pools\u0027]"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FEGE%3D","line":1116,"updated":"2013-02-08 11:26:18.000000000","message":"You should avoid there query here (see above)","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"18515c1aa3d68b98336d7e395b480f708726bd16","unresolved":false,"context_lines":[{"line_number":1114,"context_line":"        s[\u0027allocation_pools\u0027] \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1115,"context_line":"                                 for p in pools]"},{"line_number":1116,"context_line":"        s[\u0027cidr\u0027] \u003d self._get_subnet(context, id).cidr"},{"line_number":1117,"context_line":"        self._validate_subnet(s)"},{"line_number":1118,"context_line":"        # allocation_pools is read-only, we just use it for validate gateway."},{"line_number":1119,"context_line":"        del s[\u0027allocation_pools\u0027]"},{"line_number":1120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FFhw%3D","line":1117,"updated":"2013-02-07 15:43:47.000000000","message":"why not pass a flag to _validate_subnet instead to indicate if the allocation pool check should be done","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1114,"context_line":"        s[\u0027allocation_pools\u0027] \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1115,"context_line":"                                 for p in pools]"},{"line_number":1116,"context_line":"        s[\u0027cidr\u0027] \u003d self._get_subnet(context, id).cidr"},{"line_number":1117,"context_line":"        self._validate_subnet(s)"},{"line_number":1118,"context_line":"        # allocation_pools is read-only, we just use it for validate gateway."},{"line_number":1119,"context_line":"        del s[\u0027allocation_pools\u0027]"},{"line_number":1120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FEHw%3D","line":1117,"in_reply_to":"AAAAM3%2F%2FFhw%3D","updated":"2013-02-08 11:26:18.000000000","message":"I prefer its better to as it is. A flag means an if. The less of them we have the more maintainable the code is.","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"change_message_id":"352da3325ef29d81968794236e34cf613a88ed9e","unresolved":false,"context_lines":[{"line_number":1114,"context_line":"        s[\u0027allocation_pools\u0027] \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1115,"context_line":"                                 for p in pools]"},{"line_number":1116,"context_line":"        s[\u0027cidr\u0027] \u003d self._get_subnet(context, id).cidr"},{"line_number":1117,"context_line":"        self._validate_subnet(s)"},{"line_number":1118,"context_line":"        # allocation_pools is read-only, we just use it for validate gateway."},{"line_number":1119,"context_line":"        del s[\u0027allocation_pools\u0027]"},{"line_number":1120,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FDuE%3D","line":1117,"in_reply_to":"AAAAM3%2F%2FFhw%3D","updated":"2013-02-12 15:52:17.000000000","message":"actually _validate_subnet should not behave the same way if it is an update or a create. _validate_subnet may only deal with attributes that can be updated. I think we may split _validate_subnet in several function like _validate_gateway_out_of_pools, validate_allocationpools...","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1116,"context_line":"        s[\u0027cidr\u0027] \u003d self._get_subnet(context, id).cidr"},{"line_number":1117,"context_line":"        self._validate_subnet(s)"},{"line_number":1118,"context_line":"        # allocation_pools is read-only, we just use it for validate gateway."},{"line_number":1119,"context_line":"        del s[\u0027allocation_pools\u0027]"},{"line_number":1120,"context_line":""},{"line_number":1121,"context_line":"        with context.session.begin(subtransactions\u003dTrue):"},{"line_number":1122,"context_line":"            if \"dns_nameservers\" in s:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAM3%2F%2FEHA%3D","line":1119,"updated":"2013-02-08 11:26:18.000000000","message":"As you know allocation_pools cannot have been passed from the API (allow_put\u003dFalse), then deleting or not does not change a lot.\n\nAnyway, this might come useful if in the future plugin methods will be called from transports different than the API.","commit_id":"46b9164fc565d1b73fbeffdd23be8b03a14732fc"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":986,"context_line":"    def _validate_subnet(self, s):"},{"line_number":987,"context_line":"        \"\"\"Validate a subnet spec\"\"\""},{"line_number":988,"context_line":""},{"line_number":989,"context_line":"        # This method will validate attribites which may change during"},{"line_number":990,"context_line":"        # create_subnet() and update_subnet()"},{"line_number":991,"context_line":"        # The method requires the subnet spec \u0027s\u0027 has \u0027ip_version\u0027 field."},{"line_number":992,"context_line":"        # If \u0027s\u0027 dict does not have \u0027ip_version\u0027 field in an API call"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2B9M8%3D","line":989,"updated":"2013-02-13 09:26:41.000000000","message":"attribites - attributes","commit_id":"614aadc2cc1ac6651f206e66aae4ac4de939cee4"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"unresolved":false,"context_lines":[{"line_number":986,"context_line":"    def _validate_subnet(self, s):"},{"line_number":987,"context_line":"        \"\"\"Validate a subnet spec\"\"\""},{"line_number":988,"context_line":""},{"line_number":989,"context_line":"        # This method will validate attribites which may change during"},{"line_number":990,"context_line":"        # create_subnet() and update_subnet()"},{"line_number":991,"context_line":"        # The method requires the subnet spec \u0027s\u0027 has \u0027ip_version\u0027 field."},{"line_number":992,"context_line":"        # If \u0027s\u0027 dict does not have \u0027ip_version\u0027 field in an API call"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2B88Q%3D","line":989,"in_reply_to":"AAAAM3%2F%2B9M8%3D","updated":"2013-02-13 13:42:12.000000000","message":"Done","commit_id":"614aadc2cc1ac6651f206e66aae4ac4de939cee4"},{"author":{"_account_id":5638,"name":"Davanum Srinivas","email":"davanum@gmail.com","username":"dims-v"},"change_message_id":"75e6327bd87167f2daf0d5d14376acd9f9f8c0fb","unresolved":false,"context_lines":[{"line_number":1035,"context_line":"                allocation_pool[\u0027start\u0027],"},{"line_number":1036,"context_line":"                allocation_pool[\u0027end\u0027])"},{"line_number":1037,"context_line":"            if netaddr.IPAddress(gateway_ip) in pool_range:"},{"line_number":1038,"context_line":"                raise q_exc.GatewayConflictWithAllocationPools("},{"line_number":1039,"context_line":"                    pool\u003dpool_range,"},{"line_number":1040,"context_line":"                    ip_address\u003dgateway_ip)"},{"line_number":1041,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2B%2Bz4%3D","line":1038,"updated":"2013-02-12 16:08:29.000000000","message":"is the pool range information enough for the openstack user to figure out which subnet caused this error?","commit_id":"614aadc2cc1ac6651f206e66aae4ac4de939cee4"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"unresolved":false,"context_lines":[{"line_number":1035,"context_line":"                allocation_pool[\u0027start\u0027],"},{"line_number":1036,"context_line":"                allocation_pool[\u0027end\u0027])"},{"line_number":1037,"context_line":"            if netaddr.IPAddress(gateway_ip) in pool_range:"},{"line_number":1038,"context_line":"                raise q_exc.GatewayConflictWithAllocationPools("},{"line_number":1039,"context_line":"                    pool\u003dpool_range,"},{"line_number":1040,"context_line":"                    ip_address\u003dgateway_ip)"},{"line_number":1041,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2B870%3D","line":1038,"in_reply_to":"AAAAM3%2F%2B%2Bz4%3D","updated":"2013-02-13 13:42:12.000000000","message":"this method is called while creating or updating a subnet, so the subnet is obvious no?","commit_id":"614aadc2cc1ac6651f206e66aae4ac4de939cee4"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1107,"context_line":"           gratuitous DHCP offers\"\"\""},{"line_number":1108,"context_line":""},{"line_number":1109,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1110,"context_line":"        s_ctx \u003d self._get_subnet(context, id)"},{"line_number":1111,"context_line":"        # Fill \u0027ip_version\u0027 and \u0027allocation_pools\u0027 fields with the current"},{"line_number":1112,"context_line":"        # value since _validate_subnet() expects subnet spec has \u0027ip_version\u0027"},{"line_number":1113,"context_line":"        # and \u0027allocation_pools\u0027 fields."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2B9Go%3D","line":1110,"updated":"2013-02-13 11:02:06.000000000","message":"db_sub is probably more suitable for a db var name...","commit_id":"614aadc2cc1ac6651f206e66aae4ac4de939cee4"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"unresolved":false,"context_lines":[{"line_number":1107,"context_line":"           gratuitous DHCP offers\"\"\""},{"line_number":1108,"context_line":""},{"line_number":1109,"context_line":"        s \u003d subnet[\u0027subnet\u0027]"},{"line_number":1110,"context_line":"        s_ctx \u003d self._get_subnet(context, id)"},{"line_number":1111,"context_line":"        # Fill \u0027ip_version\u0027 and \u0027allocation_pools\u0027 fields with the current"},{"line_number":1112,"context_line":"        # value since _validate_subnet() expects subnet spec has \u0027ip_version\u0027"},{"line_number":1113,"context_line":"        # and \u0027allocation_pools\u0027 fields."}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2B87w%3D","line":1110,"in_reply_to":"AAAAM3%2F%2B9Go%3D","updated":"2013-02-13 13:42:12.000000000","message":"Done","commit_id":"614aadc2cc1ac6651f206e66aae4ac4de939cee4"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":1115,"context_line":"        s[\u0027cidr\u0027] \u003d s_ctx.cidr"},{"line_number":1116,"context_line":"        self._validate_subnet(s)"},{"line_number":1117,"context_line":""},{"line_number":1118,"context_line":"        if \"gateway_ip\" in s:"},{"line_number":1119,"context_line":"            allocation_pools \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1120,"context_line":"                                for p in s_ctx.allocation_pools]"},{"line_number":1121,"context_line":"            self._validate_gw_out_of_pools(s[\"gateway_ip\"], allocation_pools)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2B9M4%3D","line":1118,"updated":"2013-02-13 09:26:41.000000000","message":"Can you please use \u0027 instead of \"","commit_id":"614aadc2cc1ac6651f206e66aae4ac4de939cee4"},{"author":{"_account_id":2888,"name":"Mathieu Rohon","email":"mathieu.rohon@gmail.com","username":"mathieu-rohon"},"unresolved":false,"context_lines":[{"line_number":1115,"context_line":"        s[\u0027cidr\u0027] \u003d s_ctx.cidr"},{"line_number":1116,"context_line":"        self._validate_subnet(s)"},{"line_number":1117,"context_line":""},{"line_number":1118,"context_line":"        if \"gateway_ip\" in s:"},{"line_number":1119,"context_line":"            allocation_pools \u003d [{\u0027start\u0027: p[\u0027first_ip\u0027], \u0027end\u0027: p[\u0027last_ip\u0027]}"},{"line_number":1120,"context_line":"                                for p in s_ctx.allocation_pools]"},{"line_number":1121,"context_line":"            self._validate_gw_out_of_pools(s[\"gateway_ip\"], allocation_pools)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAM3%2F%2B87g%3D","line":1118,"in_reply_to":"AAAAM3%2F%2B9M4%3D","updated":"2013-02-13 13:42:12.000000000","message":"Done","commit_id":"614aadc2cc1ac6651f206e66aae4ac4de939cee4"}]}
