)]}'
{"swift/common/middleware/cname_lookup.py":[{"author":{"_account_id":7020,"name":"Joe Hakim Rahme","email":"jhakimra@redhat.com","username":"rahmu"},"change_message_id":"2a970da81b405761c6944bfd0e8a966d03d8bcca","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"def is_ip(domain):"},{"line_number":64,"context_line":"    try:"},{"line_number":65,"context_line":"        socket.inet_aton(domain)"},{"line_number":66,"context_line":"        return True"},{"line_number":67,"context_line":"    except socket.error:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2Ft3c%3D","line":64,"updated":"2013-04-26 13:54:28.000000000","message":"I\u0027m not a big fan of using exceptions to implement logic. Wouldn\u0027t it be simpler to write something like this (not tested, written immediately in the browser):\n\nnumbers \u003d domain.split(\".\")\nif len(numbers) !\u003d 4:\n    return False\n\ntry:\n    return all(0\u003cint(n)\u003c256 for n in numbers)\nexcept ValueError:\n    return False\n\nI think this would also be clearer.\nNote that this does not support IPv6, but inet_aton() has the same problem.","commit_id":"041e6afe8670909f6399448c27b22a0692db9e6e"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"187ede364dff4f692c1c4335710d7400ca29b5d7","unresolved":false,"context_lines":[{"line_number":61,"context_line":""},{"line_number":62,"context_line":""},{"line_number":63,"context_line":"def is_ip(domain):"},{"line_number":64,"context_line":"    try:"},{"line_number":65,"context_line":"        socket.inet_aton(domain)"},{"line_number":66,"context_line":"        return True"},{"line_number":67,"context_line":"    except socket.error:"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FsxU%3D","line":64,"in_reply_to":"AAAAOn%2F%2Ft3c%3D","updated":"2013-04-27 04:44:17.000000000","message":"Not all IP representations are dotted quads.\n\nTry this:\n\n    \u003e\u003e\u003e socket.inet_aton(\"10.51.8888\")\n    \u003e\u003e\u003e socket.inet_aton(\"10.51.34.184\")\n\nUsing inet_aton gives you parsing of a.b.c.d, a.b.c, a.b, and a for free.\n\nThis does run the possible risk of confusion should there someday be an all-numeric TLD, because then something like \"10.123.456\" would actually be both a valid IP address and a valid hostname, but at that point the cname_lookup middleware is probably the least of your problems. :)","commit_id":"041e6afe8670909f6399448c27b22a0692db9e6e"}],"test/unit/common/middleware/test_cname_lookup.py":[{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"187ede364dff4f692c1c4335710d7400ca29b5d7","unresolved":false,"context_lines":[{"line_number":183,"context_line":"        cname_lookup.lookup_cname \u003d my_lookup"},{"line_number":184,"context_line":""},{"line_number":185,"context_line":"        resp \u003d app(req.environ, start_response)"},{"line_number":186,"context_line":"        self.assertEquals(resp, \u0027FAKE APP\u0027)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FsxQ%3D","line":186,"updated":"2013-04-27 04:44:17.000000000","message":"If you do submit another patch set, might you get rid of this bit of trailing whitespace?","commit_id":"041e6afe8670909f6399448c27b22a0692db9e6e"},{"author":{"_account_id":2622,"name":"Samuel Merritt","email":"spam+launchpad@andcheese.org","username":"torgomatic"},"change_message_id":"68ac696eb8a98dcccf08673281e85ee1d0594112","unresolved":false,"context_lines":[{"line_number":185,"context_line":"        resp \u003d app(req.environ, start_response)"},{"line_number":186,"context_line":"        self.assertEquals(resp, \u0027FAKE APP\u0027)"},{"line_number":187,"context_line":""},{"line_number":188,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAOn%2F%2FlzI%3D","line":188,"updated":"2013-05-02 17:22:43.000000000","message":"Couple of extra newlines here at the end of the file. If you want to clean those up, that\u0027d be nice. Not essential, just nice.","commit_id":"e997793dfb9cc90e3f966932f3d708fa55aa1dfe"}]}
