)]}'
{"quantum/db/db_base_plugin_v2.py":[{"author":{"_account_id":2592,"name":"Mark McClain","email":"mark@mcclain.xyz","username":"markmcclain"},"change_message_id":"43fbb5d1cdd043675ca0b9a4f593ce10eab496d9","unresolved":false,"context_lines":[{"line_number":694,"context_line":"            last_ip \u003d net.last - 1"},{"line_number":695,"context_line":"            gw_ip \u003d int(netaddr.IPAddress(subnet[\u0027gateway_ip\u0027] or net.last))"},{"line_number":696,"context_line":"            # Check if the gateway is in the valid subnet range"},{"line_number":697,"context_line":"            if gw_ip \u003e\u003d first_ip and gw_ip \u003c\u003d last_ip:"},{"line_number":698,"context_line":"                if gw_ip \u003e first_ip:"},{"line_number":699,"context_line":"                    pools.append({\u0027start\u0027: str(netaddr.IPAddress(first_ip)),"},{"line_number":700,"context_line":"                                  \u0027end\u0027: str(netaddr.IPAddress(gw_ip - 1))})"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FgLg%3D","line":697,"updated":"2012-09-05 19:42:27.000000000","message":"Since the gw_ip is only used for calculating the pool split you only need construct a clamp to make things work.  Consider:\n\ngw_ip \u003d min(max(gw_ip, net.first), net.last)\n\nIf you do this, I\u0027d suggest changing var name from gw_ip to split_ip.","commit_id":"e62bca6b270d8634d76b5dd97e5abb1b44cfd9e8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":694,"context_line":"            last_ip \u003d net.last - 1"},{"line_number":695,"context_line":"            gw_ip \u003d int(netaddr.IPAddress(subnet[\u0027gateway_ip\u0027] or net.last))"},{"line_number":696,"context_line":"            # Check if the gateway is in the valid subnet range"},{"line_number":697,"context_line":"            if gw_ip \u003e\u003d first_ip and gw_ip \u003c\u003d last_ip:"},{"line_number":698,"context_line":"                if gw_ip \u003e first_ip:"},{"line_number":699,"context_line":"                    pools.append({\u0027start\u0027: str(netaddr.IPAddress(first_ip)),"},{"line_number":700,"context_line":"                                  \u0027end\u0027: str(netaddr.IPAddress(gw_ip - 1))})"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FflY%3D","line":697,"in_reply_to":"AAAALH%2F%2Ffmg%3D","updated":"2012-09-06 12:16:16.000000000","message":"Done","commit_id":"e62bca6b270d8634d76b5dd97e5abb1b44cfd9e8"},{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":694,"context_line":"            last_ip \u003d net.last - 1"},{"line_number":695,"context_line":"            gw_ip \u003d int(netaddr.IPAddress(subnet[\u0027gateway_ip\u0027] or net.last))"},{"line_number":696,"context_line":"            # Check if the gateway is in the valid subnet range"},{"line_number":697,"context_line":"            if gw_ip \u003e\u003d first_ip and gw_ip \u003c\u003d last_ip:"},{"line_number":698,"context_line":"                if gw_ip \u003e first_ip:"},{"line_number":699,"context_line":"                    pools.append({\u0027start\u0027: str(netaddr.IPAddress(first_ip)),"},{"line_number":700,"context_line":"                                  \u0027end\u0027: str(netaddr.IPAddress(gw_ip - 1))})"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Ffmg%3D","line":697,"in_reply_to":"AAAALH%2F%2FfxU%3D","updated":"2012-09-06 10:30:56.000000000","message":"I have tested this approach (the one proposed by Mark).\nWorks great and allows us to save a conditional statement.","commit_id":"e62bca6b270d8634d76b5dd97e5abb1b44cfd9e8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":694,"context_line":"            last_ip \u003d net.last - 1"},{"line_number":695,"context_line":"            gw_ip \u003d int(netaddr.IPAddress(subnet[\u0027gateway_ip\u0027] or net.last))"},{"line_number":696,"context_line":"            # Check if the gateway is in the valid subnet range"},{"line_number":697,"context_line":"            if gw_ip \u003e\u003d first_ip and gw_ip \u003c\u003d last_ip:"},{"line_number":698,"context_line":"                if gw_ip \u003e first_ip:"},{"line_number":699,"context_line":"                    pools.append({\u0027start\u0027: str(netaddr.IPAddress(first_ip)),"},{"line_number":700,"context_line":"                                  \u0027end\u0027: str(netaddr.IPAddress(gw_ip - 1))})"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2FfxU%3D","line":697,"in_reply_to":"AAAALH%2F%2FgLg%3D","updated":"2012-09-06 04:56:59.000000000","message":"I am not sure that I follow. When I tried to do this the tests failed. Maybe I did not think it through enough","commit_id":"e62bca6b270d8634d76b5dd97e5abb1b44cfd9e8"}],"quantum/tests/unit/test_db_plugin.py":[{"author":{"_account_id":261,"name":"Salvatore Orlando","email":"salv.orlando@gmail.com","username":"salvatore-orlando"},"unresolved":false,"context_lines":[{"line_number":1883,"context_line":"        self.assertEquals(subnet[\u0027subnet\u0027][\u0027gateway_ip\u0027], gateway)"},{"line_number":1884,"context_line":"        self.assertEquals(subnet[\u0027subnet\u0027][\u0027enable_dhcp\u0027], enable_dhcp)"},{"line_number":1885,"context_line":"        self.assertEquals(subnet[\u0027subnet\u0027][\u0027allocation_pools\u0027],"},{"line_number":1886,"context_line":"                          allocation_pools)"},{"line_number":1887,"context_line":""},{"line_number":1888,"context_line":"    def test_create_subnet_gw_is_last(self):"},{"line_number":1889,"context_line":"        gateway \u003d \u002710.0.0.254\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Ffmk%3D","line":1886,"updated":"2012-09-06 10:30:56.000000000","message":"Lines 1879-1886 are common to all tests. Perhaps we can factor them out\n\nor just leverage the fact that you can verify any subnet attribute by passing it to _test_create_subnet.","commit_id":"e62bca6b270d8634d76b5dd97e5abb1b44cfd9e8"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"unresolved":false,"context_lines":[{"line_number":1883,"context_line":"        self.assertEquals(subnet[\u0027subnet\u0027][\u0027gateway_ip\u0027], gateway)"},{"line_number":1884,"context_line":"        self.assertEquals(subnet[\u0027subnet\u0027][\u0027enable_dhcp\u0027], enable_dhcp)"},{"line_number":1885,"context_line":"        self.assertEquals(subnet[\u0027subnet\u0027][\u0027allocation_pools\u0027],"},{"line_number":1886,"context_line":"                          allocation_pools)"},{"line_number":1887,"context_line":""},{"line_number":1888,"context_line":"    def test_create_subnet_gw_is_last(self):"},{"line_number":1889,"context_line":"        gateway \u003d \u002710.0.0.254\u0027"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAALH%2F%2Ffk8%3D","line":1886,"in_reply_to":"AAAALH%2F%2Ffmk%3D","updated":"2012-09-06 12:16:16.000000000","message":"Done","commit_id":"e62bca6b270d8634d76b5dd97e5abb1b44cfd9e8"}]}
