)]}'
{"nova/privsep/utils.py":[{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5e4276b419bbc230f716dba472261048c54183f","unresolved":false,"context_lines":[{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def generate_random_string():"},{"line_number":40,"context_line":"    \"\"\"Returns a random string using randint(0, maxint)\"\"\""},{"line_number":41,"context_line":"    return str(random.randint(0, sys.maxint))"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ffd0ebdf_b4f4fa5c","line":39,"updated":"2019-01-03 21:35:50.000000000","message":"Slight grumble about this not being an exact match for the original generate_random_string [1], but the point is to avoid collisions; and theoretically the file goes away quickly, so meh.\n\n[1] https://github.com/openstack/nova/blob/8ef3d253a086e4f8575f5221d4515cda421abea2/nova/utils.py#L251","commit_id":"faaf75688f56339e6a7a1116e352fc696853caac"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5b69ace1417df438cc6d2f640d4d9877b470a225","unresolved":false,"context_lines":[{"line_number":36,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":37,"context_line":""},{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def generate_random_string():"},{"line_number":40,"context_line":"    \"\"\"Returns a random string using randint(0, maxint)\"\"\""},{"line_number":41,"context_line":"    return str(random.randint(0, sys.maxint))"},{"line_number":42,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"ffd0ebdf_54b7ce87","line":39,"in_reply_to":"ffd0ebdf_b4f4fa5c","updated":"2019-01-03 21:38:29.000000000","message":"Yeah I don\u0027t think it matters what the random string is, it could be a UUID as well.","commit_id":"faaf75688f56339e6a7a1116e352fc696853caac"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"f7fd23ffbc6c72c02c8d8d8047ea44c59b31bd68","unresolved":false,"context_lines":[{"line_number":38,"context_line":""},{"line_number":39,"context_line":"def generate_random_string():"},{"line_number":40,"context_line":"    \"\"\"Returns a random string using randint(0, maxint)\"\"\""},{"line_number":41,"context_line":"    return str(random.randint(0, sys.maxint))"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"def supports_direct_io(dirpath):"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffd0ebdf_4f0df78e","line":41,"range":{"start_line":41,"start_character":37,"end_line":41,"end_character":43},"updated":"2019-01-03 22:21:33.000000000","message":"Apparently this isn\u0027t in py3...","commit_id":"faaf75688f56339e6a7a1116e352fc696853caac"},{"author":{"_account_id":14070,"name":"Eric Fried","email":"openstack@fried.cc","username":"efried"},"change_message_id":"d5e4276b419bbc230f716dba472261048c54183f","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        LOG.debug(\"This python runtime does not support direct I/O\")"},{"line_number":48,"context_line":"        return False"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    # Use a random filename to avoid issues with $dirpath being on shared"},{"line_number":51,"context_line":"    # storage."},{"line_number":52,"context_line":"    file_name \u003d \"%s.%s\" % (\".directio.test\", generate_random_string())"},{"line_number":53,"context_line":"    testfile \u003d os.path.join(dirpath, file_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffd0ebdf_94c69616","line":50,"updated":"2019-01-03 21:35:50.000000000","message":"This is pretty gross, and could be reduced to like five lines by using tempfile [1].\n\nBut not here.\n\n[1] https://docs.python.org/2/library/tempfile.html","commit_id":"faaf75688f56339e6a7a1116e352fc696853caac"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"5b69ace1417df438cc6d2f640d4d9877b470a225","unresolved":false,"context_lines":[{"line_number":47,"context_line":"        LOG.debug(\"This python runtime does not support direct I/O\")"},{"line_number":48,"context_line":"        return False"},{"line_number":49,"context_line":""},{"line_number":50,"context_line":"    # Use a random filename to avoid issues with $dirpath being on shared"},{"line_number":51,"context_line":"    # storage."},{"line_number":52,"context_line":"    file_name \u003d \"%s.%s\" % (\".directio.test\", generate_random_string())"},{"line_number":53,"context_line":"    testfile \u003d os.path.join(dirpath, file_name)"}],"source_content_type":"text/x-python","patch_set":1,"id":"ffd0ebdf_34aeca2e","line":50,"in_reply_to":"ffd0ebdf_94c69616","updated":"2019-01-03 21:38:29.000000000","message":"I was wondering about that too when looking at this code, but yeah I don\u0027t want to conflate a refactor with this.","commit_id":"faaf75688f56339e6a7a1116e352fc696853caac"}]}
