)]}'
{"swift/cli/ringbuilder.py":[{"author":{"_account_id":8779,"name":"Chetan Risbud","email":"chetan.risbud@gmail.com","username":"crisbud"},"change_message_id":"040e022ef36984ebf7c8faa9c02bf702b0de95d6","unresolved":false,"context_lines":[{"line_number":139,"context_line":"            # if this is an ipv6 address then we want to convert it"},{"line_number":140,"context_line":"            # to all lowercase and use its fully expanded representation"},{"line_number":141,"context_line":"            # to make searches easier"},{"line_number":142,"context_line":"            ip \u003d norm_addr"},{"line_number":143,"context_line":""},{"line_number":144,"context_line":"            if not rest.startswith(\u0027:\u0027):"},{"line_number":145,"context_line":"                print \u0027Invalid add value: %s\u0027 % devstr"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXX%2F%2F6YE%3D","line":142,"updated":"2014-04-25 11:13:39.000000000","message":"#1","commit_id":"3c2c534eba0025cdb33723904cd85b5ec1a3bfb8"},{"author":{"_account_id":8779,"name":"Chetan Risbud","email":"chetan.risbud@gmail.com","username":"crisbud"},"change_message_id":"040e022ef36984ebf7c8faa9c02bf702b0de95d6","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                # if this is an ipv6 address then we want to convert it"},{"line_number":186,"context_line":"                # to all lowercase and use its fully expanded representation"},{"line_number":187,"context_line":"                # to make searches easier"},{"line_number":188,"context_line":"                replication_ip \u003d norm_addr"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"                if not rest.startswith(\u0027:\u0027):"},{"line_number":191,"context_line":"                    print \u0027Invalid add value: %s\u0027 % devstr"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXX%2F%2F6YQ%3D","line":188,"updated":"2014-04-25 11:13:39.000000000","message":"#2\nI am fine with the code here as it is used for couple of times only. But may be good if we write a block so as can reuse it.","commit_id":"3c2c534eba0025cdb33723904cd85b5ec1a3bfb8"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"4d183fa112f2a36cc48a901e7c99e80beaadd1fc","unresolved":false,"context_lines":[{"line_number":185,"context_line":"                # if this is an ipv6 address then we want to convert it"},{"line_number":186,"context_line":"                # to all lowercase and use its fully expanded representation"},{"line_number":187,"context_line":"                # to make searches easier"},{"line_number":188,"context_line":"                replication_ip \u003d norm_addr"},{"line_number":189,"context_line":""},{"line_number":190,"context_line":"                if not rest.startswith(\u0027:\u0027):"},{"line_number":191,"context_line":"                    print \u0027Invalid add value: %s\u0027 % devstr"}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_dc6d0e06","line":188,"in_reply_to":"AAAAXX%2F%2F6YQ%3D","updated":"2014-06-11 02:46:01.000000000","message":"I agree with Chetan, I think this should be refactored out into its own function seeing as it is rather complicated and using it more then once.","commit_id":"3c2c534eba0025cdb33723904cd85b5ec1a3bfb8"}],"swift/common/ring/utils.py":[{"author":{"_account_id":8779,"name":"Chetan Risbud","email":"chetan.risbud@gmail.com","username":"crisbud"},"change_message_id":"7fe7b57d25b402273f1a873117cdfa9518acfeb4","unresolved":false,"context_lines":[{"line_number":135,"context_line":"    Return tuple of (True, normalized_address) if the address is a valid"},{"line_number":136,"context_line":"    ip or hostname or (False, None) if the address is invalid"},{"line_number":137,"context_line":"    Hostnames are normalized to all lower case. IPv6-addresses are converted"},{"line_number":138,"context_line":"    to lowercase and fully expaned. IPv4 addresses are left alone"},{"line_number":139,"context_line":"    \"\"\""},{"line_number":140,"context_line":"    # first convert to lower case"},{"line_number":141,"context_line":"    if is_valid_ipv4(address) is True:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAWH%2F94rc%3D","line":138,"updated":"2014-04-01 13:16:33.000000000","message":"expanded","commit_id":"b87d94bb9a3884dbf5c29367b379c67fc063de6d"},{"author":{"_account_id":8779,"name":"Chetan Risbud","email":"chetan.risbud@gmail.com","username":"crisbud"},"change_message_id":"040e022ef36984ebf7c8faa9c02bf702b0de95d6","unresolved":false,"context_lines":[{"line_number":230,"context_line":"            return False"},{"line_number":231,"context_line":"    return dev_ip in my_ips and dev_port \u003d\u003d my_port"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":""},{"line_number":234,"context_line":"def parse_search_value(search_value):"},{"line_number":235,"context_line":"    \"\"\"The \u003csearch-value\u003e can be of the form::"},{"line_number":236,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXX%2F%2F6WU%3D","line":233,"updated":"2014-04-25 11:13:39.000000000","message":"already +1 for this portion of the code changes","commit_id":"3c2c534eba0025cdb33723904cd85b5ec1a3bfb8"}],"swift/common/utils.py":[{"author":{"_account_id":8779,"name":"Chetan Risbud","email":"chetan.risbud@gmail.com","username":"crisbud"},"change_message_id":"040e022ef36984ebf7c8faa9c02bf702b0de95d6","unresolved":false,"context_lines":[{"line_number":1336,"context_line":""},{"line_number":1337,"context_line":"def expand_ipv6(address):"},{"line_number":1338,"context_line":"    \"\"\""},{"line_number":1339,"context_line":"    Return fully expanded ipv6 address (assumes input is valid ipv6 address)"},{"line_number":1340,"context_line":"    \"\"\""},{"line_number":1341,"context_line":"    ipv6_address \u003d address.lower()"},{"line_number":1342,"context_line":"    full_address \u003d \"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAXX%2F%2F6UY%3D","line":1339,"updated":"2014-04-25 11:13:39.000000000","message":"Might be a good idea to do the validation though ? Open for discussion.","commit_id":"3c2c534eba0025cdb33723904cd85b5ec1a3bfb8"},{"author":{"_account_id":7233,"name":"Matthew Oliver","email":"matt@oliver.net.au","username":"mattoliverau"},"change_message_id":"4d183fa112f2a36cc48a901e7c99e80beaadd1fc","unresolved":false,"context_lines":[{"line_number":1336,"context_line":""},{"line_number":1337,"context_line":"def expand_ipv6(address):"},{"line_number":1338,"context_line":"    \"\"\""},{"line_number":1339,"context_line":"    Return fully expanded ipv6 address (assumes input is valid ipv6 address)"},{"line_number":1340,"context_line":"    \"\"\""},{"line_number":1341,"context_line":"    ipv6_address \u003d address.lower()"},{"line_number":1342,"context_line":"    full_address \u003d \"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ae5cdf2_b7ecdd2a","line":1339,"in_reply_to":"AAAAXX%2F%2F6UY%3D","updated":"2014-06-11 02:46:01.000000000","message":"This method in most cases in the code seems to be called from the is_local_device method which it grabs the IP address out of the socket address info. So I guess we can assume it\u0027s valid. \n\nHowever, seeing as this method has been placed in common/utils. You obviously want to make it available to everyone, so I think adding a the IPv6 validation (a simple call to an existing method) in this method is reasonable. It would mean throwing an exception if it isn\u0027t a valid ipv6 address, but that is what I\u0027d expect it to do if wanted to use the method elsewhere. \n\nMy 2 cents.\n\nTL;DR +1 to adding validation to this method.","commit_id":"3c2c534eba0025cdb33723904cd85b5ec1a3bfb8"}]}
