)]}'
{"glanceclient/compat.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"5fe0d8da1fd26fd4b9c671fc404733ebedb9587d","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    return image_meta"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"def get_image_attributes(image, include_locations\u003dFalse):"},{"line_number":30,"context_line":"    if hasattr(image, \u0027schema\u0027):  # v2"},{"line_number":31,"context_line":"        image_meta \u003d _extract_attributes_schema_based(image, include_locations)"},{"line_number":32,"context_line":"    else:  # v1"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_ec61e3a9","line":29,"updated":"2016-01-15 19:50:25.000000000","message":"Since this is a public function, we should document it.\n\nI wonder whether we should keep the `include_locations` keyword here.","commit_id":"2ed8941d09359f816599e6231c7cfc42a0988187"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"ec2b1286b7818173ef6d9cfd52cf61bb888bb491","unresolved":false,"context_lines":[{"line_number":26,"context_line":"    return image_meta"},{"line_number":27,"context_line":""},{"line_number":28,"context_line":""},{"line_number":29,"context_line":"def get_image_attributes(image, include_locations\u003dFalse):"},{"line_number":30,"context_line":"    if hasattr(image, \u0027schema\u0027):  # v2"},{"line_number":31,"context_line":"        image_meta \u003d _extract_attributes_schema_based(image, include_locations)"},{"line_number":32,"context_line":"    else:  # v1"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_76d7c0ed","line":29,"in_reply_to":"da6ed579_ec61e3a9","updated":"2016-01-19 16:54:52.000000000","message":"\"\"\"Converts image to the format adopted in Nova Image API\"\"\"?\n\nAbout including locations... It\u0027s used only one time during image download. So we have two options:\n\n1. Omit `include_locations` param, include locations every time here and then exclude in Nova\u0027s _extract_attributes if they are not required (almost every time) https://github.com/openstack/nova/blob/master/nova/image/glance.py#L552\n\n2. Keep the param here and include locations in output if it\u0027s required.\n\nI would prefer the second scenario (like it\u0027s done now).","commit_id":"2ed8941d09359f816599e6231c7cfc42a0988187"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"ec2b1286b7818173ef6d9cfd52cf61bb888bb491","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        image_meta \u003d _extract_attributes_schema_based(image, include_locations)"},{"line_number":32,"context_line":"    else:  # v1"},{"line_number":33,"context_line":"        if include_locations:"},{"line_number":34,"context_line":"            LOG.warning(_LW(\"Including locations is not supported\""},{"line_number":35,"context_line":"                            \" in legacy mode\"))"},{"line_number":36,"context_line":"        image_meta \u003d _extract_attributes_legacy(image)"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_d6354c46","line":34,"range":{"start_line":34,"start_character":12,"end_line":34,"end_character":15},"updated":"2016-01-19 16:54:52.000000000","message":"Logger is not enabled and this variable isn\u0027t set.","commit_id":"2ed8941d09359f816599e6231c7cfc42a0988187"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"ec2b1286b7818173ef6d9cfd52cf61bb888bb491","unresolved":false,"context_lines":[{"line_number":31,"context_line":"        image_meta \u003d _extract_attributes_schema_based(image, include_locations)"},{"line_number":32,"context_line":"    else:  # v1"},{"line_number":33,"context_line":"        if include_locations:"},{"line_number":34,"context_line":"            LOG.warning(_LW(\"Including locations is not supported\""},{"line_number":35,"context_line":"                            \" in legacy mode\"))"},{"line_number":36,"context_line":"        image_meta \u003d _extract_attributes_legacy(image)"},{"line_number":37,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_d60c6c96","line":34,"range":{"start_line":34,"start_character":24,"end_line":34,"end_character":27},"updated":"2016-01-19 16:54:52.000000000","message":"This function is not necessary here.","commit_id":"2ed8941d09359f816599e6231c7cfc42a0988187"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"3e51667dad7b9a86bf1219f65b1a76f846da7aed","unresolved":false,"context_lines":[{"line_number":79,"context_line":"def _extract_attributes_schema_based(image, include_locations\u003dFalse):"},{"line_number":80,"context_line":"    include_locations_attrs \u003d [\u0027direct_url\u0027, \u0027locations\u0027]"},{"line_number":81,"context_line":"    omit_attrs \u003d [\u0027self\u0027, \u0027schema\u0027, \u0027protected\u0027, \u0027virtual_size\u0027, \u0027file\u0027,"},{"line_number":82,"context_line":"                  \u0027tags\u0027]"},{"line_number":83,"context_line":"    raw_schema \u003d image.schema"},{"line_number":84,"context_line":"    schema \u003d schemas.Schema(raw_schema)"},{"line_number":85,"context_line":"    output \u003d {\u0027properties\u0027: {}, \u0027deleted\u0027: False, \u0027deleted_at\u0027: None}"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_60be62af","line":82,"updated":"2016-01-15 16:55:21.000000000","message":"why are we dropping these, rather than giving Noop defaults to output in v1/if they don\u0027t exist.","commit_id":"2ed8941d09359f816599e6231c7cfc42a0988187"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"ec2b1286b7818173ef6d9cfd52cf61bb888bb491","unresolved":false,"context_lines":[{"line_number":79,"context_line":"def _extract_attributes_schema_based(image, include_locations\u003dFalse):"},{"line_number":80,"context_line":"    include_locations_attrs \u003d [\u0027direct_url\u0027, \u0027locations\u0027]"},{"line_number":81,"context_line":"    omit_attrs \u003d [\u0027self\u0027, \u0027schema\u0027, \u0027protected\u0027, \u0027virtual_size\u0027, \u0027file\u0027,"},{"line_number":82,"context_line":"                  \u0027tags\u0027]"},{"line_number":83,"context_line":"    raw_schema \u003d image.schema"},{"line_number":84,"context_line":"    schema \u003d schemas.Schema(raw_schema)"},{"line_number":85,"context_line":"    output \u003d {\u0027properties\u0027: {}, \u0027deleted\u0027: False, \u0027deleted_at\u0027: None}"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_b6fe9836","line":82,"in_reply_to":"da6ed579_60be62af","updated":"2016-01-19 16:54:52.000000000","message":"The whole idea is to follow Nova Image API requirements. We have to keep the output as much identical as we can.","commit_id":"2ed8941d09359f816599e6231c7cfc42a0988187"},{"author":{"_account_id":5202,"name":"Erno Kuvaja","email":"jokke@usr.fi","username":"jokke"},"change_message_id":"3e51667dad7b9a86bf1219f65b1a76f846da7aed","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                or name in include_locations_attrs and not include_locations):"},{"line_number":89,"context_line":"            continue"},{"line_number":90,"context_line":"        elif name \u003d\u003d \u0027visibility\u0027:"},{"line_number":91,"context_line":"            output[\u0027is_public\u0027] \u003d value \u003d\u003d \u0027public\u0027"},{"line_number":92,"context_line":"        elif name \u003d\u003d \u0027size\u0027 and value is None:"},{"line_number":93,"context_line":"            output[\u0027size\u0027] \u003d 0"},{"line_number":94,"context_line":"        elif schema.is_base_property(name):"}],"source_content_type":"text/x-python","patch_set":2,"id":"da6ed579_6e1ad9c7","line":91,"updated":"2016-01-15 16:55:21.000000000","message":"Is there specific reason to transform the current output to legacy form rather than other way around? Anyone using this compat module would be doing it intentionally and would know how to deal with \u0027visibility\u0027 this way we would be returning all visibility possibilities, not just is_public binary information.","commit_id":"2ed8941d09359f816599e6231c7cfc42a0988187"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"ec2b1286b7818173ef6d9cfd52cf61bb888bb491","unresolved":false,"context_lines":[{"line_number":88,"context_line":"                or name in include_locations_attrs and not include_locations):"},{"line_number":89,"context_line":"            continue"},{"line_number":90,"context_line":"        elif name \u003d\u003d \u0027visibility\u0027:"},{"line_number":91,"context_line":"            output[\u0027is_public\u0027] \u003d value \u003d\u003d \u0027public\u0027"},{"line_number":92,"context_line":"        elif name \u003d\u003d \u0027size\u0027 and value is None:"},{"line_number":93,"context_line":"            output[\u0027size\u0027] \u003d 0"},{"line_number":94,"context_line":"        elif schema.is_base_property(name):"}],"source_content_type":"text/x-python","patch_set":2,"id":"ba63e191_594c2f70","line":91,"in_reply_to":"da6ed579_6e1ad9c7","updated":"2016-01-19 16:54:52.000000000","message":"Nova waits for \u0027is_public\u0027 :( So changing it to \u0027visibility\u0027 will break Nova Image API.","commit_id":"2ed8941d09359f816599e6231c7cfc42a0988187"},{"author":{"_account_id":13562,"name":"Samuel Matzek","email":"smatzek@us.ibm.com","username":"smatzek"},"change_message_id":"b9cefb8aa824ad7d5f3788f6bf089e8f6de65964","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def convert_to_nova(image, include_locations\u003dFalse):"},{"line_number":33,"context_line":"    \"\"\"Converts image to the format adopted in Nova Image API\"\"\""},{"line_number":34,"context_line":"    if hasattr(image, \u0027schema\u0027):  # v2"},{"line_number":35,"context_line":"        image_meta \u003d _extract_attributes_schema_based(image, include_locations)"},{"line_number":36,"context_line":"    else:  # v1"},{"line_number":37,"context_line":"        if include_locations:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_f110c15b","line":34,"updated":"2016-01-26 15:48:00.000000000","message":"This check on the schema attr will cause a v1 image to call HEAD on Glance to re-fetch and repopulate all image properties due to the lazy loading support here:\nhttps://github.com/openstack/python-glanceclient/blob/master/glanceclient/openstack/common/apiclient/base.py#L487-L490\n\nThe net effect is that if you are using Glance v1 in Nova and call the convert_to_nova function with a v1 image you are doubling your calls to Glance.\n\nIf you are in a \u0027split\u0027 world where you are using V2 Glance for show in Nova but aren\u0027t using other patches for example, are still using V1 for update, then this re-fetch of image properties using V1\u0027s header mechanism can cause data truncation of long property values if you are also using an HTTP proxy between Glance and Nova since HTTP proxies generally truncate long headers.\n\nIs there something else that could be done to determine whether the image passed in is a v1 or v2? Possibly a version attribute in the glanceclient Image class?","commit_id":"c12c6c3c9198c1ee3636f0cf7f613a1eee485e26"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"bd9a44e08f93d63b4769d68acaa1765bb2545418","unresolved":false,"context_lines":[{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def convert_to_nova(image, include_locations\u003dFalse):"},{"line_number":33,"context_line":"    \"\"\"Converts image to the format adopted in Nova Image API\"\"\""},{"line_number":34,"context_line":"    if hasattr(image, \u0027schema\u0027):  # v2"},{"line_number":35,"context_line":"        image_meta \u003d _extract_attributes_schema_based(image, include_locations)"},{"line_number":36,"context_line":"    else:  # v1"},{"line_number":37,"context_line":"        if include_locations:"}],"source_content_type":"text/x-python","patch_set":3,"id":"9a68dd71_09920958","line":34,"in_reply_to":"9a68dd71_f110c15b","updated":"2016-01-26 16:45:38.000000000","message":"Ouch... Sometimes I hate python for these things... Thank you Samuel, we will try to improve it.\n\nThere are a lot of ways to differentiate v1 and v2 apis: for example, \u0027schema\u0027 is always in v2 output (not attribute, but just a dict element) and it\u0027s value is \u0027/v2/schemas/image\u0027, but it\u0027s never presented in v1. I can update the patch in a moment.\n\nAlso about your concerns: there are there patches on review in Nova that enable full v2 support. If we merge them close together, then no one will notice the substitution :)\nhttps://review.openstack.org/#/c/228578/\nhttps://review.openstack.org/#/c/238309/\nhttps://review.openstack.org/#/c/259097/","commit_id":"c12c6c3c9198c1ee3636f0cf7f613a1eee485e26"},{"author":{"_account_id":13562,"name":"Samuel Matzek","email":"smatzek@us.ibm.com","username":"smatzek"},"change_message_id":"cb95a01fdeec6f997e223cb5a2381af4ce27e55a","unresolved":false,"context_lines":[{"line_number":29,"context_line":"    return image_meta"},{"line_number":30,"context_line":""},{"line_number":31,"context_line":""},{"line_number":32,"context_line":"def convert_to_nova(image, include_locations\u003dFalse):"},{"line_number":33,"context_line":"    \"\"\"Converts image to the format adopted in Nova Image API\"\"\""},{"line_number":34,"context_line":"    if isinstance(image, dict) and image.get(\u0027schema\u0027) \u003d\u003d \u0027/v2/schemas/image\u0027:"},{"line_number":35,"context_line":"        # v2"}],"source_content_type":"text/x-python","patch_set":4,"id":"9a68dd71_6599611f","line":32,"updated":"2016-01-26 20:05:50.000000000","message":"Is this method meant to be a replacement for nova.image.glance._extract_attributes or _translate_from_glance?\n\nIf it\u0027s meant to replace _extract_attributes, should it contain the _convert_timestamps_to_datetimes call which _extract_attributes doesn\u0027t have but _translate_from_glance does?\n\nIf it\u0027s meant to replace _translate_from_glance, should it have the _convert_from_string call added that _translate_from_glance has?","commit_id":"293bf9c894236dd7f20e9925f2581f84a6a2e284"}]}
