)]}'
{"glance/common/utils.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"988960dcf826adfe4789d1e227d51ade4f7e416c","unresolved":false,"context_lines":[{"line_number":35,"context_line":"import uuid"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"from oslo.config import cfg"},{"line_number":38,"context_line":"from OpenSSL import crypto"},{"line_number":39,"context_line":"from webob import exc"},{"line_number":40,"context_line":""},{"line_number":41,"context_line":"from glance.common import exception"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOH%2F%2Fv%2BQ%3D","line":38,"updated":"2013-03-29 09:08:06.000000000","message":"Hey,\n\nThis should be before oslo\u0027s import\n\nCheers","commit_id":"51847782df4c97ef3d1a1bf2b0ccea3ce63970bd"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"988960dcf826adfe4789d1e227d51ade4f7e416c","unresolved":false,"context_lines":[{"line_number":472,"context_line":""},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"def validate_key_cert(key_file, cert_file):"},{"line_number":475,"context_line":"    if not os.path.exists(cert_file):"},{"line_number":476,"context_line":"        raise RuntimeError(_(\"The path to the certificate file %s \""},{"line_number":477,"context_line":"                             \"does not exists.\" % (cert_file)))"},{"line_number":478,"context_line":"    if not os.path.exists(key_file):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOH%2F%2Fv%2BM%3D","line":475,"updated":"2013-03-29 09:08:06.000000000","message":"Hey,\n\nWhy don\u0027t you just try to open the file and catch the errors ? \n\nCheers","commit_id":"51847782df4c97ef3d1a1bf2b0ccea3ce63970bd"},{"author":{"_account_id":6493,"name":"John Bresnahan","email":"john@bresnahan.me","username":"jbresnah"},"change_message_id":"2b0399c793c0fb2c56b866c23b6b25ae723efae6","unresolved":false,"context_lines":[{"line_number":472,"context_line":""},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"def validate_key_cert(key_file, cert_file):"},{"line_number":475,"context_line":"    if not os.path.exists(cert_file):"},{"line_number":476,"context_line":"        raise RuntimeError(_(\"The path to the certificate file %s \""},{"line_number":477,"context_line":"                             \"does not exists.\" % (cert_file)))"},{"line_number":478,"context_line":"    if not os.path.exists(key_file):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOH%2F%2Fvkk%3D","line":475,"in_reply_to":"AAAAOH%2F%2Fv%2BM%3D","updated":"2013-03-29 18:00:37.000000000","message":"I felt that the error messages could be more clear if I specifically tested for each condition.","commit_id":"51847782df4c97ef3d1a1bf2b0ccea3ce63970bd"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"e0e2153175b53d70edbaf52da47e51e0a03887b9","unresolved":false,"context_lines":[{"line_number":472,"context_line":""},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"def validate_key_cert(key_file, cert_file):"},{"line_number":475,"context_line":"    if not os.path.exists(cert_file):"},{"line_number":476,"context_line":"        raise RuntimeError(_(\"The path to the certificate file %s \""},{"line_number":477,"context_line":"                             \"does not exists.\" % (cert_file)))"},{"line_number":478,"context_line":"    if not os.path.exists(key_file):"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAOX%2F%2F%2Fic%3D","line":475,"in_reply_to":"AAAAOH%2F%2Fvkk%3D","updated":"2013-04-03 09:57:17.000000000","message":"Not big deal but, IOError gives you the information needed to create an explicit log message. (errno [2,13] and filename).\n\nSince this will be called just once then I guess it doesn\u0027t matter. What I mean is that getting access flags from files and verifying they exists might slow down the application when they\u0027re called several times.\n\nLike I said, it doesn\u0027t matter in this case, I guess.","commit_id":"51847782df4c97ef3d1a1bf2b0ccea3ce63970bd"},{"author":{"_account_id":7073,"name":"mouad benchchaoui","email":"m.benchchaoui@x-ion.de","username":"mouad"},"change_message_id":"3e0b43547a1a74575b4079a65083d87c16155a1b","unresolved":false,"context_lines":[{"line_number":471,"context_line":"        return getattr(backend, key)"},{"line_number":472,"context_line":""},{"line_number":473,"context_line":""},{"line_number":474,"context_line":"def validate_key_cert(key_file, cert_file):"},{"line_number":475,"context_line":"    if not os.path.exists(cert_file):"},{"line_number":476,"context_line":"        raise RuntimeError(_(\"The path to the certificate file %s \""},{"line_number":477,"context_line":"                             \"does not exists.\" % (cert_file)))"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAOX%2F%2F%2FhA%3D","line":474,"updated":"2013-04-03 10:13:24.000000000","message":"Why you need all this test ? IMHO it\u0027s better to do open(\"...\") and if it fail it will raise an OSError which IMHO is good enough, but if not you can try: open() except OSError as ex: and check ex.errno, FWIW this way of doing thing is called EAFP (Easier to ask for forgiveness than permission) and it\u0027s part of Python Zen.","commit_id":"38e69a7a5b32300d5bbf40a089aa0153f4a6c816"}]}
