)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"09f816c4065e7c2be7ea3706fe388baf5fdd3d11","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Check --store parameter validity before _reserve"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Currently the value of the --store parameter is checked after the call to"},{"line_number":10,"context_line":"_reserve is made. Thus the image is actually created on the database"},{"line_number":11,"context_line":"even though the store is invalid, and then returns a E400."},{"line_number":12,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"AAAAUH%2F%2FaSE%3D","line":9,"updated":"2014-01-14 01:45:22.000000000","message":"please make this  \u003c 72 chars","commit_id":"0c1def2ed9f595e6b3080a227222e6096745768b"}],"glance/api/v1/images.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d764f1dfb0b80f715bfdb302dbaf6140cdaa4af","unresolved":false,"context_lines":[{"line_number":488,"context_line":"        location \u003d self._external_source(image_meta, req)"},{"line_number":489,"context_line":"        store \u003d image_meta.get(\u0027store\u0027)"},{"line_number":490,"context_line":"        if store and store not in get_known_stores():"},{"line_number":491,"context_line":"            msg \u003d _(\"Store for scheme %s not found\") % store"},{"line_number":492,"context_line":"            LOG.debug(msg)"},{"line_number":493,"context_line":"            raise HTTPBadRequest(explanation\u003dmsg,"},{"line_number":494,"context_line":"                                 content_type\u003d\u0027text/plain\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2Fe8s%3D","line":491,"updated":"2014-01-13 12:56:08.000000000","message":"What about change message to \"Required store %s is invalid\" ? Since IMO there is no related with store scheme.\n\nbtw one quick ask: I\u0027m interesting but not sure can we verify it by scheme but store class name? thanks.","commit_id":"d6d1c8d23082442228053c0c3ddfa026a8b64402"}],"glance/store/__init__.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"590683e470ce097b468e775ae94383241c858fca","unresolved":false,"context_lines":[{"line_number":201,"context_line":"    return location.SCHEME_TO_CLS_MAP.keys()"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"def get_known_stores():"},{"line_number":205,"context_line":"    stores \u003d [classes[\u0027store_class\u0027].__module__.split(\u0027.\u0027)[2]"},{"line_number":206,"context_line":"              for scheme, classes in location.SCHEME_TO_CLS_MAP.iteritems()]"},{"line_number":207,"context_line":"    if \u0027filesystem\u0027 in stores:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2Fn3o%3D","line":204,"updated":"2014-01-10 11:37:34.000000000","message":"I\u0027d prefer having a global dict with the mapping instead of generating it every time. Other parts of this code could benefit from that as well.","commit_id":"d6d1c8d23082442228053c0c3ddfa026a8b64402"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"5d764f1dfb0b80f715bfdb302dbaf6140cdaa4af","unresolved":false,"context_lines":[{"line_number":201,"context_line":"    return location.SCHEME_TO_CLS_MAP.keys()"},{"line_number":202,"context_line":""},{"line_number":203,"context_line":""},{"line_number":204,"context_line":"def get_known_stores():"},{"line_number":205,"context_line":"    stores \u003d [classes[\u0027store_class\u0027].__module__.split(\u0027.\u0027)[2]"},{"line_number":206,"context_line":"              for scheme, classes in location.SCHEME_TO_CLS_MAP.iteritems()]"},{"line_number":207,"context_line":"    if \u0027filesystem\u0027 in stores:"}],"source_content_type":"text/x-python","patch_set":2,"id":"AAAAUH%2F%2FfAY%3D","line":204,"in_reply_to":"AAAAUH%2F%2Fn3o%3D","updated":"2014-01-13 12:56:08.000000000","message":"+1. Actually I\u0027m thinking we\u0027d better also change create_stores() to make the necessary valid store list within the same loop logic which already existing in above #177, and cache it in location.py . Then we can just write a similar simple helper like above \"get_know_schemes()\" to reuse that valid store list, for api in this case or others in future.","commit_id":"d6d1c8d23082442228053c0c3ddfa026a8b64402"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b251f590d28c5048688dad076936d74035af666f","unresolved":false,"context_lines":[{"line_number":208,"context_line":""},{"line_number":209,"context_line":"def get_known_stores():"},{"line_number":210,"context_line":"    \"\"\"Returns list of known stores\"\"\""},{"line_number":211,"context_line":"    return location.REGISTERED_STORES"},{"line_number":212,"context_line":""},{"line_number":213,"context_line":""},{"line_number":214,"context_line":"def get_store_from_scheme(context, scheme, loc\u003dNone):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2FZqo%3D","line":211,"updated":"2014-01-14 05:42:49.000000000","message":"I prefer return a new object but location.REGISTERED_STORES directly, it will prevent outside change its values. What about:\n\n    return list(location.REGISTERED_STORES)","commit_id":"7de4e9f273d8fb719d57d7675fd6ae97e198ba84"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"65118091c5c2795e998f6bf24723dd656171aec4","unresolved":false,"context_lines":[{"line_number":140,"context_line":""},{"line_number":141,"context_line":"def _register_stores(store_classes):"},{"line_number":142,"context_line":"    \"\"\""},{"line_number":143,"context_line":"    Given a set of store names, add them to a globally available list"},{"line_number":144,"context_line":"    of store names."},{"line_number":145,"context_line":"    \"\"\""},{"line_number":146,"context_line":"    for store_cls in store_classes:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F%2FPLo%3D","line":143,"updated":"2014-01-16 02:38:10.000000000","message":"(nit): You\u0027re using set to save the data, but you\u0027re saying \u0027available list\u0027, though I don\u0027t think it\u0027s a blocker.","commit_id":"bfc3c4ad132ee16dcd2e79fdfd1735adff796e41"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"65118091c5c2795e998f6bf24723dd656171aec4","unresolved":false,"context_lines":[{"line_number":146,"context_line":"    for store_cls in store_classes:"},{"line_number":147,"context_line":"        REGISTERED_STORES.add(store_cls.__module__.split(\u0027.\u0027)[2])"},{"line_number":148,"context_line":"    # NOTE (spredzy): Store names that does not match class name"},{"line_number":149,"context_line":"    #                 needs to be added manually"},{"line_number":150,"context_line":"    if \u0027filesystem\u0027 in REGISTERED_STORES:"},{"line_number":151,"context_line":"        REGISTERED_STORES.add(\u0027file\u0027)"},{"line_number":152,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAAUH%2F%2FPLc%3D","line":149,"updated":"2014-01-16 02:38:10.000000000","message":"(nit): I\u0027m not really comfortable with the format. Would you mind updating it?","commit_id":"bfc3c4ad132ee16dcd2e79fdfd1735adff796e41"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"9046166b725d38f7bcfdd17b886bd8de6e82db19","unresolved":false,"context_lines":[{"line_number":223,"context_line":""},{"line_number":224,"context_line":"def get_known_stores():"},{"line_number":225,"context_line":"    \"\"\"Returns list of known stores\"\"\""},{"line_number":226,"context_line":"    return list(REGISTERED_STORES)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"def get_store_from_scheme(context, scheme, loc\u003dNone):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2B1zw%3D","line":226,"updated":"2014-01-21 14:54:27.000000000","message":"Why do you need to convert this to list? If you keep it as set() checking whether it contains a value or not will be faster.\n\nThat said, if you think this is really necessary, I\u0027d rather have it in the `_register_stores` function or just have a list and check if a store was already added before adding it.","commit_id":"77c58c7d54b4f402851a294e4309dfc74862e8cb"},{"author":{"_account_id":9410,"name":"Yanis Guenane","email":"yguenane@redhat.com","username":"yguenane"},"change_message_id":"9f9afad585acbf97f671ae04ff7a17604ee91032","unresolved":false,"context_lines":[{"line_number":223,"context_line":""},{"line_number":224,"context_line":"def get_known_stores():"},{"line_number":225,"context_line":"    \"\"\"Returns list of known stores\"\"\""},{"line_number":226,"context_line":"    return list(REGISTERED_STORES)"},{"line_number":227,"context_line":""},{"line_number":228,"context_line":""},{"line_number":229,"context_line":"def get_store_from_scheme(context, scheme, loc\u003dNone):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2Bg8Y%3D","line":226,"in_reply_to":"AAAAUH%2F%2B1zw%3D","updated":"2014-01-24 21:23:44.000000000","message":"Flavio, please refer to Zhi Yan comment on PS5 about that one","commit_id":"77c58c7d54b4f402851a294e4309dfc74862e8cb"}],"glance/store/location.py":[{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"09f816c4065e7c2be7ea3706fe388baf5fdd3d11","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            SCHEME_TO_CLS_MAP[k] \u003d v"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def register_stores(registered_stores):"},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    Given a set of registered store names, cache them."},{"line_number":94,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FaRY%3D","line":91,"updated":"2014-01-14 01:45:22.000000000","message":"I think the semantic of this function is not correct:\nregister_stores(registered_stores): for me this means \"register stores that are already registered.\"\nBased on the docstring, I would rename that to cache_stores(registered_stores)\n\nlet me know if that makes sense.","commit_id":"0c1def2ed9f595e6b3080a227222e6096745768b"},{"author":{"_account_id":9410,"name":"Yanis Guenane","email":"yguenane@redhat.com","username":"yguenane"},"change_message_id":"d5f4314f034e8f2d611e965d3b8392fab7759316","unresolved":false,"context_lines":[{"line_number":88,"context_line":"            SCHEME_TO_CLS_MAP[k] \u003d v"},{"line_number":89,"context_line":""},{"line_number":90,"context_line":""},{"line_number":91,"context_line":"def register_stores(registered_stores):"},{"line_number":92,"context_line":"    \"\"\""},{"line_number":93,"context_line":"    Given a set of registered store names, cache them."},{"line_number":94,"context_line":"    \"\"\""}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FaCo%3D","line":91,"in_reply_to":"AAAAUH%2F%2FaRY%3D","updated":"2014-01-14 02:49:44.000000000","message":"Arnaud, I changed the param name (and the docstring) but kept the function name so it matches the idea of register_scheme_map.\n\nDoes that look good to you ?","commit_id":"0c1def2ed9f595e6b3080a227222e6096745768b"},{"author":{"_account_id":8759,"name":"Arnaud Legendre","email":"arnaudleg@gmail.com","username":"arnaud"},"change_message_id":"09f816c4065e7c2be7ea3706fe388baf5fdd3d11","unresolved":false,"context_lines":[{"line_number":95,"context_line":"    for store_cls in registered_stores:"},{"line_number":96,"context_line":"        REGISTERED_STORES.add(store_cls.__module__.split(\u0027.\u0027)[2])"},{"line_number":97,"context_line":"    if \u0027filesystem\u0027 in REGISTERED_STORES:"},{"line_number":98,"context_line":"        REGISTERED_STORES.add(\u0027file\u0027)"},{"line_number":99,"context_line":""},{"line_number":100,"context_line":""},{"line_number":101,"context_line":"class Location(object):"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2FaQw%3D","line":98,"updated":"2014-01-14 01:45:22.000000000","message":"1. I would add a note here to mention that each store having a different scheme/filename will need to be registered manually.\n\n2. Maybe I am missing something: here you add file, but you do not remove filesystem.","commit_id":"0c1def2ed9f595e6b3080a227222e6096745768b"},{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"b251f590d28c5048688dad076936d74035af666f","unresolved":false,"context_lines":[{"line_number":97,"context_line":"        REGISTERED_STORES.add(store_cls.__module__.split(\u0027.\u0027)[2])"},{"line_number":98,"context_line":"    # NOTE (spredzy): Store names that does not match scheme name"},{"line_number":99,"context_line":"    #                 needs to be edited manually"},{"line_number":100,"context_line":"    if \u0027filesystem\u0027 in REGISTERED_STORES:"},{"line_number":101,"context_line":"        REGISTERED_STORES.add(\u0027file\u0027)"},{"line_number":102,"context_line":"        REGISTERED_STORES.remove(\u0027filesystem\u0027)"},{"line_number":103,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUH%2F%2FZsU%3D","line":100,"updated":"2014-01-14 05:42:49.000000000","message":"Yanis could you pls help explain why you need do this replacement? thanks.","commit_id":"7de4e9f273d8fb719d57d7675fd6ae97e198ba84"},{"author":{"_account_id":6484,"name":"Feilong Wang","email":"hustemb@gmail.com","username":"flwang"},"change_message_id":"12019a0bdb3266e80cc0bf11ae22716ba009a8d9","unresolved":false,"context_lines":[{"line_number":47,"context_line":"LOG \u003d logging.getLogger(__name__)"},{"line_number":48,"context_line":""},{"line_number":49,"context_line":"SCHEME_TO_CLS_MAP \u003d {}"},{"line_number":50,"context_line":"REGISTERED_STORES \u003d set()"},{"line_number":51,"context_line":""},{"line_number":52,"context_line":""},{"line_number":53,"context_line":"def get_location_from_uri(uri):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAUH%2F%2FUZs%3D","line":50,"updated":"2014-01-15 04:06:22.000000000","message":"I\u0027m curious why this variable is defined in location.py? Given it\u0027s about store and unrelated to location. Why don\u0027t just put it in store/__init__.py? Please poking me if I missed anything.","commit_id":"75b4af52b9ea29440c88527f8df40f3cb0e0c7ab"}],"glance/tests/unit/v1/test_api.py":[{"author":{"_account_id":6549,"name":"Zhi Yan Liu","email":"lzy.dev@gmail.com","username":"lzy-dev"},"change_message_id":"089d0e2171c02fddfbe0047848dcf2dc67d6292f","unresolved":false,"context_lines":[{"line_number":350,"context_line":""},{"line_number":351,"context_line":"        res \u003d req.get_response(self.api)"},{"line_number":352,"context_line":"        self.assertEqual(res.status_int, 400)"},{"line_number":353,"context_line":"        self.assertTrue(\u0027Required store\u0027 in res.body)"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    def test_create_with_location_unknown_scheme(self):"},{"line_number":356,"context_line":"        fixture_headers \u003d {"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAUH%2F%2B44I%3D","line":353,"updated":"2014-01-21 02:44:11.000000000","message":"What about this: self.assertTrue(\u0027Required store bad is invalid\u0027 in res.body)\n\nIt can also check the bad store name can be returned to end user correctly as a debug message.","commit_id":"77c58c7d54b4f402851a294e4309dfc74862e8cb"}]}
