)]}'
{"ironic/drivers/modules/ssh.py":[{"author":{"_account_id":4190,"name":"lifeless","email":"robertc@robertcollins.net","username":"lifeless"},"change_message_id":"2c23415628d75e005a870ca6a9b78220ec1ef9af","unresolved":false,"context_lines":[{"line_number":82,"context_line":"        return mac.translate(string.maketrans(\u0027\u0027, \u0027\u0027), \u0027-:\u0027).lower()"},{"line_number":83,"context_line":"    elif isinstance(mac, unicode):"},{"line_number":84,"context_line":"        remove_map \u003d dict((ord(char), None) for char in \"-:\")"},{"line_number":85,"context_line":"        return mac.translate(remove_map).lower()"},{"line_number":86,"context_line":""},{"line_number":87,"context_line":""},{"line_number":88,"context_line":"def _parse_driver_info(node):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAATn%2F9zIU%3D","line":85,"updated":"2013-12-05 19:32:14.000000000","message":"Is there any reason not to upcast to unicode all the time for this?\n\ne.g.\n\ndef _normalize_mac(mac, remove_map\u003d{ord(\u0027-\u0027): None, ord(\u0027:\u0027): None}):\n return six.text_type(mac).translate(remove_map).lower()","commit_id":"4fb33ed48db5de79181c773942e7134727a6a220"},{"author":{"_account_id":7711,"name":"Yuriy Zveryanskyy","email":"yzveryanskyy@mirantis.com","username":"yuriyz"},"change_message_id":"ba75528c4ebf5a23b614718e557896e5c6c5199a","unresolved":false,"context_lines":[{"line_number":77,"context_line":"}"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"def _normalize_mac(mac, remove_map\u003d{ord(\u0027-\u0027): None, ord(\u0027:\u0027): None}):"},{"line_number":81,"context_line":"    return six.text_type(mac).translate(remove_map).lower()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9wuM%3D","line":80,"updated":"2013-12-06 09:03:01.000000000","message":"Do you think that anybody will use \u0027remove_map\u0027 parameter?","commit_id":"f9771b1a81fa083e3f10bf766e106749da8f329e"},{"author":{"_account_id":6773,"name":"Lucas Alvares Gomes","email":"lucasagomes@gmail.com","username":"lucasagomes"},"change_message_id":"ca1f1225dc6bc757757fe9f93dbb0f93254df842","unresolved":false,"context_lines":[{"line_number":77,"context_line":"}"},{"line_number":78,"context_line":""},{"line_number":79,"context_line":""},{"line_number":80,"context_line":"def _normalize_mac(mac, remove_map\u003d{ord(\u0027-\u0027): None, ord(\u0027:\u0027): None}):"},{"line_number":81,"context_line":"    return six.text_type(mac).translate(remove_map).lower()"},{"line_number":82,"context_line":""},{"line_number":83,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAATn%2F9wfM%3D","line":80,"in_reply_to":"AAAATn%2F9wuM%3D","updated":"2013-12-06 10:23:02.000000000","message":"Hey Chris,\n\nI agree with Yuriy, I think that having a character map to a function like this is overkill. Another thing, I don\u0027t think we should convert the string passed as parameter to unicode ( six.text_type() ), I think this function should only strip off the characters, lowercase the string and return it, unicodifying it behind the scenes doesn\u0027t looks right.\n\nI have some suggestions, if we still want to be flexible with which characters we need to strip off from the string we can still accept it as parameter, like:\n\ndef _normalize_mac(mac, to_remove\u003d\u0027-:\u0027):\n    return re.sub(\u0027[%s]\u0027 % to_remove, \u0027\u0027, mac).lower()\n\nor if we just want to be straight forward and remove only \u0027:\u0027 and \u0027-\u0027 (because the API already has a regex to validate the mac address format) we could just:\n\ndef _normalize_mac(mac):\n    return mac.replace(\u0027-\u0027, \u0027\u0027).replace(\u0027:\u0027, \u0027\u0027).lower()\n\nWhat you think?","commit_id":"f9771b1a81fa083e3f10bf766e106749da8f329e"}]}
