)]}'
{"nova/image/glance.py":[{"author":{"_account_id":15888,"name":"Zhenyu Zheng","email":"zheng.zhenyu@outlook.com","username":"Kevin_Zheng"},"change_message_id":"74928f681e263fe55e9a088fea7d09f3fa5590b4","unresolved":false,"context_lines":[{"line_number":153,"context_line":"    # (sbiswas7): Remove this plumbing once we have migrated all of the"},{"line_number":154,"context_line":"    # code to use v2."},{"line_number":155,"context_line":"    if not version:"},{"line_number":156,"context_line":"        version \u003d _determine_current_version(endpoint)"},{"line_number":157,"context_line":"        # (sbiswas7): If there was a problem with discovering the API"},{"line_number":158,"context_line":"        # version then default that to 2."},{"line_number":159,"context_line":"        if not version:"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_dad0e521","line":156,"updated":"2015-10-08 01:53:22.000000000","message":"the function name in the other patch has been changed, update it here also.( _determine_curr_major_version(endpoint):)","commit_id":"7ac2ed4e3ec726b5485336658f1987d0ed0b6dd7"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"658f40b7364230decbc0e7778493cf040e0d914b","unresolved":false,"context_lines":[{"line_number":53,"context_line":"               max\u003d65535,"},{"line_number":54,"context_line":"               help\u003d\u0027Default glance port\u0027),"},{"line_number":55,"context_line":"    cfg.StrOpt(\u0027protocol\u0027,"},{"line_number":56,"context_line":"               default\u003d\u0027http\u0027,"},{"line_number":57,"context_line":"               choices\u003d(\u0027http\u0027, \u0027https\u0027),"},{"line_number":58,"context_line":"               help\u003d\u0027Default protocol to use when connecting to glance. \u0027"},{"line_number":59,"context_line":"                    \u0027Set to https for SSL.\u0027),"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_084bc95a","line":56,"updated":"2015-10-13 00:41:37.000000000","message":"this change is unrelated - you can do it in a separate change set","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"9980bfeaaa153d220db2799375852d06c9998e0c","unresolved":false,"context_lines":[{"line_number":53,"context_line":"               max\u003d65535,"},{"line_number":54,"context_line":"               help\u003d\u0027Default glance port\u0027),"},{"line_number":55,"context_line":"    cfg.StrOpt(\u0027protocol\u0027,"},{"line_number":56,"context_line":"               default\u003d\u0027http\u0027,"},{"line_number":57,"context_line":"               choices\u003d(\u0027http\u0027, \u0027https\u0027),"},{"line_number":58,"context_line":"               help\u003d\u0027Default protocol to use when connecting to glance. \u0027"},{"line_number":59,"context_line":"                    \u0027Set to https for SSL.\u0027),"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_3ab58730","line":56,"in_reply_to":"7a2fa921_084bc95a","updated":"2015-10-14 19:47:45.000000000","message":"Done","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"1cb1c2260199d0de75ef444befe72fdb7f0e5526","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        # (sbiswas7): If there was a problem with discovering the API"},{"line_number":159,"context_line":"        # version then default that to 1."},{"line_number":160,"context_line":"        if not version:"},{"line_number":161,"context_line":"            version \u003d \u00271\u0027"},{"line_number":162,"context_line":"    return glanceclient.Client(str(version), endpoint, **params)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_1413d75d","line":161,"updated":"2015-10-13 09:27:24.000000000","message":"We can add:\n\n    client \u003d glanceclient.Client(str(version), endpoint, **params)\n\n    client.version \u003d version\n\n    return client\n\nThoughts?","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"9980bfeaaa153d220db2799375852d06c9998e0c","unresolved":false,"context_lines":[{"line_number":158,"context_line":"        # (sbiswas7): If there was a problem with discovering the API"},{"line_number":159,"context_line":"        # version then default that to 1."},{"line_number":160,"context_line":"        if not version:"},{"line_number":161,"context_line":"            version \u003d \u00271\u0027"},{"line_number":162,"context_line":"    return glanceclient.Client(str(version), endpoint, **params)"},{"line_number":163,"context_line":""},{"line_number":164,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_5f6955bd","line":161,"in_reply_to":"7a2fa921_1413d75d","updated":"2015-10-14 19:47:45.000000000","message":"agree! but let\u0027s keep it as integer, not string","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"658f40b7364230decbc0e7778493cf040e0d914b","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        retry the request according to CONF.glance.num_retries."},{"line_number":239,"context_line":"        \"\"\""},{"line_number":240,"context_line":"        retry_excs \u003d (glanceclient.exc.ServiceUnavailable,"},{"line_number":241,"context_line":"                      glanceclient.exc.InvalidEndpoint,"},{"line_number":242,"context_line":"                      glanceclient.exc.CommunicationError)"},{"line_number":243,"context_line":"        retries \u003d CONF.glance.num_retries"},{"line_number":244,"context_line":"        if retries \u003c 0:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_68659ddf","line":241,"updated":"2015-10-13 00:41:37.000000000","message":"unrelated too","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"9980bfeaaa153d220db2799375852d06c9998e0c","unresolved":false,"context_lines":[{"line_number":238,"context_line":"        retry the request according to CONF.glance.num_retries."},{"line_number":239,"context_line":"        \"\"\""},{"line_number":240,"context_line":"        retry_excs \u003d (glanceclient.exc.ServiceUnavailable,"},{"line_number":241,"context_line":"                      glanceclient.exc.InvalidEndpoint,"},{"line_number":242,"context_line":"                      glanceclient.exc.CommunicationError)"},{"line_number":243,"context_line":"        retries \u003d CONF.glance.num_retries"},{"line_number":244,"context_line":"        if retries \u003c 0:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_3a5ee712","line":241,"in_reply_to":"7a2fa921_68659ddf","updated":"2015-10-14 19:47:45.000000000","message":"Done","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"658f40b7364230decbc0e7778493cf040e0d914b","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                               \u0027method\u0027: method, \u0027extra\u0027: extra})"},{"line_number":270,"context_line":"                if attempt \u003d\u003d num_attempts:"},{"line_number":271,"context_line":"                    raise exception.GlanceConnectionFailed("},{"line_number":272,"context_line":"                        host\u003dhost, port\u003dport, reason\u003dsix.text_type(e))"},{"line_number":273,"context_line":"                time.sleep(1)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_285fa50f","line":272,"updated":"2015-10-13 00:41:37.000000000","message":"ditto","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"9980bfeaaa153d220db2799375852d06c9998e0c","unresolved":false,"context_lines":[{"line_number":269,"context_line":"                               \u0027method\u0027: method, \u0027extra\u0027: extra})"},{"line_number":270,"context_line":"                if attempt \u003d\u003d num_attempts:"},{"line_number":271,"context_line":"                    raise exception.GlanceConnectionFailed("},{"line_number":272,"context_line":"                        host\u003dhost, port\u003dport, reason\u003dsix.text_type(e))"},{"line_number":273,"context_line":"                time.sleep(1)"},{"line_number":274,"context_line":""},{"line_number":275,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_da9b33c8","line":272,"in_reply_to":"7a2fa921_285fa50f","updated":"2015-10-14 19:47:45.000000000","message":"Done","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"658f40b7364230decbc0e7778493cf040e0d914b","unresolved":false,"context_lines":[{"line_number":584,"context_line":"    # therefore sorted, with dependent attributes as the end"},{"line_number":585,"context_line":"    # \u0027deleted_at\u0027 depends on \u0027deleted\u0027"},{"line_number":586,"context_line":"    # \u0027checksum\u0027 depends on \u0027status\u0027 \u003d\u003d \u0027active\u0027"},{"line_number":587,"context_line":"    image_attributes \u003d (\u0027size\u0027, \u0027disk_format\u0027, \u0027owner\u0027,"},{"line_number":588,"context_line":"                        \u0027container_format\u0027, \u0027status\u0027, \u0027id\u0027,"},{"line_number":589,"context_line":"                        \u0027name\u0027, \u0027created_at\u0027, \u0027updated_at\u0027,"},{"line_number":590,"context_line":"                        \u0027deleted\u0027, \u0027deleted_at\u0027, \u0027checksum\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_88a4b908","line":587,"updated":"2015-10-13 00:41:37.000000000","message":"unrelated","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"9980bfeaaa153d220db2799375852d06c9998e0c","unresolved":false,"context_lines":[{"line_number":584,"context_line":"    # therefore sorted, with dependent attributes as the end"},{"line_number":585,"context_line":"    # \u0027deleted_at\u0027 depends on \u0027deleted\u0027"},{"line_number":586,"context_line":"    # \u0027checksum\u0027 depends on \u0027status\u0027 \u003d\u003d \u0027active\u0027"},{"line_number":587,"context_line":"    image_attributes \u003d (\u0027size\u0027, \u0027disk_format\u0027, \u0027owner\u0027,"},{"line_number":588,"context_line":"                        \u0027container_format\u0027, \u0027status\u0027, \u0027id\u0027,"},{"line_number":589,"context_line":"                        \u0027name\u0027, \u0027created_at\u0027, \u0027updated_at\u0027,"},{"line_number":590,"context_line":"                        \u0027deleted\u0027, \u0027deleted_at\u0027, \u0027checksum\u0027,"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_fa9e2fb7","line":587,"in_reply_to":"7a2fa921_88a4b908","updated":"2015-10-14 19:47:45.000000000","message":"Done","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"658f40b7364230decbc0e7778493cf040e0d914b","unresolved":false,"context_lines":[{"line_number":649,"context_line":""},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"def _remove_read_only(image_meta):"},{"line_number":652,"context_line":"    image_attributes \u003d (\u0027status\u0027, \u0027updated_at\u0027, \u0027created_at\u0027, \u0027deleted_at\u0027)"},{"line_number":653,"context_line":"    output \u003d copy.deepcopy(image_meta)"},{"line_number":654,"context_line":"    for attr in image_attributes:"},{"line_number":655,"context_line":"        if attr in output:"}],"source_content_type":"text/x-python","patch_set":6,"id":"7a2fa921_08b9892e","line":652,"updated":"2015-10-13 00:41:37.000000000","message":"ditto","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"9980bfeaaa153d220db2799375852d06c9998e0c","unresolved":false,"context_lines":[{"line_number":649,"context_line":""},{"line_number":650,"context_line":""},{"line_number":651,"context_line":"def _remove_read_only(image_meta):"},{"line_number":652,"context_line":"    image_attributes \u003d (\u0027status\u0027, \u0027updated_at\u0027, \u0027created_at\u0027, \u0027deleted_at\u0027)"},{"line_number":653,"context_line":"    output \u003d copy.deepcopy(image_meta)"},{"line_number":654,"context_line":"    for attr in image_attributes:"},{"line_number":655,"context_line":"        if attr in output:"}],"source_content_type":"text/x-python","patch_set":6,"id":"5a2ca52d_9aa5bb05","line":652,"in_reply_to":"7a2fa921_08b9892e","updated":"2015-10-14 19:47:45.000000000","message":"Done","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1217aa1aee1b8cbf30214d87c18bcdb205cff081","unresolved":false,"context_lines":[{"line_number":321,"context_line":"                             image is deleted."},{"line_number":322,"context_line":"        \"\"\""},{"line_number":323,"context_line":"        version \u003d 1"},{"line_number":324,"context_line":"        if include_locations:"},{"line_number":325,"context_line":"            version \u003d 2"},{"line_number":326,"context_line":"        try:"},{"line_number":327,"context_line":"            image \u003d self._client.call(context, version, \u0027get\u0027, image_id)"}],"source_content_type":"text/x-python","patch_set":19,"id":"3a29b11f_526d5cca","side":"PARENT","line":324,"updated":"2015-10-22 05:55:05.000000000","message":"What happens if v2 is not installed and include_locations is True?\n\nI\u0027d assume this is handled already in nova as it can happen in the current code. I just want to make sure the same behavior is preserved.","commit_id":"4b7189eb49afb4c740c17bf5a2590f30dadf36bf"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1217aa1aee1b8cbf30214d87c18bcdb205cff081","unresolved":false,"context_lines":[{"line_number":316,"context_line":""},{"line_number":317,"context_line":"        return _images"},{"line_number":318,"context_line":""},{"line_number":319,"context_line":"    def show(self, context, image_id, include_locations\u003dFalse,"},{"line_number":320,"context_line":"             show_deleted\u003dTrue):"},{"line_number":321,"context_line":"        \"\"\"Returns a dict with image data for the given opaque image id."},{"line_number":322,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"3a29b11f_3240e033","line":319,"updated":"2015-10-22 05:55:05.000000000","message":"in future patches, it\u0027d be possible to get rid of `include_locations` as these will be gotten from Glance when v2 is available.","commit_id":"d327bd55a9f2be615452e05e6c9fb826a9e59629"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"1217aa1aee1b8cbf30214d87c18bcdb205cff081","unresolved":false,"context_lines":[{"line_number":332,"context_line":"                             image is deleted."},{"line_number":333,"context_line":"        \"\"\""},{"line_number":334,"context_line":"        try:"},{"line_number":335,"context_line":"            image \u003d self._client.call(context, None, \u0027get\u0027, image_id)"},{"line_number":336,"context_line":"        except Exception:"},{"line_number":337,"context_line":"            _reraise_translated_image_exception(image_id)"},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"3a29b11f_123e04c1","line":335,"range":{"start_line":335,"start_character":12,"end_line":335,"end_character":17},"updated":"2015-10-22 05:55:05.000000000","message":"Why don\u0027t you get rid of the `version` argument entirely? It shouldn\u0027t be required anymore with this change.","commit_id":"d327bd55a9f2be615452e05e6c9fb826a9e59629"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"9a0999a4cb0e160775ce658cce79d374050d161e","unresolved":false,"context_lines":[{"line_number":332,"context_line":"                             image is deleted."},{"line_number":333,"context_line":"        \"\"\""},{"line_number":334,"context_line":"        try:"},{"line_number":335,"context_line":"            image \u003d self._client.call(context, None, \u0027get\u0027, image_id)"},{"line_number":336,"context_line":"        except Exception:"},{"line_number":337,"context_line":"            _reraise_translated_image_exception(image_id)"},{"line_number":338,"context_line":""}],"source_content_type":"text/x-python","patch_set":19,"id":"3a29b11f_727e586b","line":335,"range":{"start_line":335,"start_character":12,"end_line":335,"end_character":17},"in_reply_to":"3a29b11f_123e04c1","updated":"2015-10-22 05:56:45.000000000","message":"I just read the other patch and I realized there are other places still using the version argument. I guess we could get rid of it at the end of this \u0027un-hardcoding\u0027 series of patches.","commit_id":"d327bd55a9f2be615452e05e6c9fb826a9e59629"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e68da32915008150ea5975b22680945723a2ac18","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    endpoint \u003d \u0027%s://%s:%s\u0027 % (scheme, host, port)"},{"line_number":156,"context_line":"    # (sbiswas7): Remove this plumbing once we have migrated all of the"},{"line_number":157,"context_line":"    # code to use v2."},{"line_number":158,"context_line":"    if not version:"},{"line_number":159,"context_line":"        version \u003d _determine_curr_major_version(endpoint)"},{"line_number":160,"context_line":"        # (sbiswas7): If there was a problem with discovering the API"},{"line_number":161,"context_line":"        # version then default that to 1."}],"source_content_type":"text/x-python","patch_set":21,"id":"ba8a016a_8601773a","line":158,"updated":"2015-11-18 23:29:45.000000000","message":"nit: use:\n\n if version is None:","commit_id":"716da6b7faacdcb5f33ed31d684c079411588650"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"a8a3e1d4bca127b1fb7d4a94375baf650277cbd4","unresolved":false,"context_lines":[{"line_number":155,"context_line":"    endpoint \u003d \u0027%s://%s:%s\u0027 % (scheme, host, port)"},{"line_number":156,"context_line":"    # (sbiswas7): Remove this plumbing once we have migrated all of the"},{"line_number":157,"context_line":"    # code to use v2."},{"line_number":158,"context_line":"    if not version:"},{"line_number":159,"context_line":"        version \u003d _determine_curr_major_version(endpoint)"},{"line_number":160,"context_line":"        # (sbiswas7): If there was a problem with discovering the API"},{"line_number":161,"context_line":"        # version then default that to 1."}],"source_content_type":"text/x-python","patch_set":21,"id":"9a8ffd7b_7aab201e","line":158,"in_reply_to":"ba8a016a_8601773a","updated":"2015-11-25 14:22:00.000000000","message":"Will do!","commit_id":"716da6b7faacdcb5f33ed31d684c079411588650"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e68da32915008150ea5975b22680945723a2ac18","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            version \u003d \u00271\u0027"},{"line_number":164,"context_line":"    client \u003d glanceclient.Client(str(version), endpoint, **params)"},{"line_number":165,"context_line":"    # convert version from float to string."},{"line_number":166,"context_line":"    client.version \u003d str(int(client.version))"},{"line_number":167,"context_line":"    return client"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ba8a016a_26a8cb1f","line":166,"updated":"2015-11-18 23:29:45.000000000","message":"Why is the above conversion necessary? The glanceclient.Client() constructor should accept/handle the version argument properly. Callers should not be responsible for stripping floats to ints to strings.","commit_id":"716da6b7faacdcb5f33ed31d684c079411588650"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"a8a3e1d4bca127b1fb7d4a94375baf650277cbd4","unresolved":false,"context_lines":[{"line_number":163,"context_line":"            version \u003d \u00271\u0027"},{"line_number":164,"context_line":"    client \u003d glanceclient.Client(str(version), endpoint, **params)"},{"line_number":165,"context_line":"    # convert version from float to string."},{"line_number":166,"context_line":"    client.version \u003d str(int(client.version))"},{"line_number":167,"context_line":"    return client"},{"line_number":168,"context_line":""},{"line_number":169,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a8ffd7b_daac8c37","line":166,"in_reply_to":"ba8a016a_26a8cb1f","updated":"2015-11-25 14:22:00.000000000","message":"I think this code was intending to write a string to the version variable of the client object because Mike was using it for one of the checks in his other patch to extract attributes. But I see now that with his latest patchset, he is doing a check on the \u0027schema\u0027 instead of client versions. So i think this piece of code above can be completely remove.","commit_id":"716da6b7faacdcb5f33ed31d684c079411588650"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"e68da32915008150ea5975b22680945723a2ac18","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                             image is deleted."},{"line_number":338,"context_line":"        \"\"\""},{"line_number":339,"context_line":"        try:"},{"line_number":340,"context_line":"            image \u003d self._client.call(context, None, \u0027get\u0027, image_id)"},{"line_number":341,"context_line":"        except Exception:"},{"line_number":342,"context_line":"            _reraise_translated_image_exception(image_id)"},{"line_number":343,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"ba8a016a_79e67416","line":340,"updated":"2015-11-18 23:29:45.000000000","message":"So this changes the existing logic in a way that is problematic. Previously, if this method was called with include_locations\u003dTrue, that means the caller needed the location dictionary in order to determine which location to download an image from:\n\nhttps://github.com/openstack/nova/blob/master/nova/image/glance.py#L365-L366\n\nThat code -- specifically line 366 -- expects the locations dictionary to not be empty, which forcing the version to 2 accomplishes. However, with this change, the download() method may end up using the v1 Glance API if that is the current supported API for that endpoint. Instead of an exception being raised because there is no v2 API support (required for locations information), now the code will happily just proceed and the download module will die here:\n\nhttps://github.com/openstack/nova/blob/master/nova/image/glance.py#L381\n\nand end up bubbling up an AttributeError because image_id won\u0027t be defined (since the locations dictionary will be empty...)","commit_id":"716da6b7faacdcb5f33ed31d684c079411588650"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"a8a3e1d4bca127b1fb7d4a94375baf650277cbd4","unresolved":false,"context_lines":[{"line_number":337,"context_line":"                             image is deleted."},{"line_number":338,"context_line":"        \"\"\""},{"line_number":339,"context_line":"        try:"},{"line_number":340,"context_line":"            image \u003d self._client.call(context, None, \u0027get\u0027, image_id)"},{"line_number":341,"context_line":"        except Exception:"},{"line_number":342,"context_line":"            _reraise_translated_image_exception(image_id)"},{"line_number":343,"context_line":""}],"source_content_type":"text/x-python","patch_set":21,"id":"9a8ffd7b_e1577200","line":340,"in_reply_to":"ba8a016a_79e67416","updated":"2015-11-25 14:22:00.000000000","message":"Hi Jay, good point. I have a couple of thoughts around it:\n\n- Having the CURRENT set to v1 means that we are talking about really old glance vs a very new Nova:\n\nhttps://github.com/openstack/glance/blob/stable/kilo/glance/api/versions.py (they have switched v2 to CURRENT from Kilo, so it should be release before that to have v1 set to CURRENT)\n\nTheoretically that can happen. Practically? (I don\u0027t have much experience, hence I seek your advice) Or do we have something to fix in the glance code then, because it seems that if the glance code is on or after Kilo - v2 will always be reported as CURRENT.\n\n- We can harden this code to say if the requested code in nova wants to include_locations - and we have discovered the glance API to be  v1 - then we just raise an exception, calling out - that it\u0027s not supported.","commit_id":"716da6b7faacdcb5f33ed31d684c079411588650"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"412688bdd75920a13cff2a9d73e2b92dc602a66d","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    if version is None:"},{"line_number":159,"context_line":"        version \u003d _determine_curr_major_version(endpoint)"},{"line_number":160,"context_line":"        # (sbiswas7): If there was a problem with discovering the API"},{"line_number":161,"context_line":"        # version then default that to 2."},{"line_number":162,"context_line":"        if version is None:"},{"line_number":163,"context_line":"            version \u003d \u00272\u0027"},{"line_number":164,"context_line":"    client \u003d glanceclient.Client(str(version), endpoint, **params)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a740942_561d1665","line":161,"updated":"2015-12-03 20:53:27.000000000","message":"This should default to 1 I think since that\u0027s the current behavior.  I\u0027m not familiar with the timeline of Glance features, but is it safe to assume that 2 is deployed everywhere?\n\nAlso, _determine_curr_major_version should return 1 on failure, not None.  This logic should be in that method.","commit_id":"50ec99c08c17879d51b0123f3099c5ba82f62c2f"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"cd00511eff9f3c1e989ad8e07794d917779656de","unresolved":false,"context_lines":[{"line_number":158,"context_line":"    if version is None:"},{"line_number":159,"context_line":"        version \u003d _determine_curr_major_version(endpoint)"},{"line_number":160,"context_line":"        # (sbiswas7): If there was a problem with discovering the API"},{"line_number":161,"context_line":"        # version then default that to 2."},{"line_number":162,"context_line":"        if version is None:"},{"line_number":163,"context_line":"            version \u003d \u00272\u0027"},{"line_number":164,"context_line":"    client \u003d glanceclient.Client(str(version), endpoint, **params)"}],"source_content_type":"text/x-python","patch_set":23,"id":"7a740942_53e4fa0b","line":161,"in_reply_to":"7a740942_561d1665","updated":"2015-12-06 07:29:08.000000000","message":"Done","commit_id":"50ec99c08c17879d51b0123f3099c5ba82f62c2f"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"ee29d280bc650a0eb97061d6f98535513d605919","unresolved":false,"context_lines":[{"line_number":330,"context_line":"                             image is deleted."},{"line_number":331,"context_line":"        \"\"\""},{"line_number":332,"context_line":"        if include_locations:"},{"line_number":333,"context_line":"            if hasattr(self._client,"},{"line_number":334,"context_line":"                       \"version\") and self._client.version \u003d\u003d 1.0:"},{"line_number":335,"context_line":"                raise exception.ImageVersionNotSupported(image_id\u003dimage_id)"},{"line_number":336,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a740942_942c8503","line":333,"updated":"2015-12-06 19:49:03.000000000","message":"Just realized that this approach is still incomplete. The discovery of the client version may happen inside the \"call\" method...which means - it could still discover version \u003d\u003d 1 there. So in order to retain the older behavior, I think we can do something like:\n\nversion \u003d None\nif include_locations:\n    version \u003d 2\n\nand then in the determine_versionxxx method - we can add a check saying if version was not specified - then determine the right one.","commit_id":"3d4cb69130396103858f6b162b8702e8e758c186"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"93b14ed441eba7adbd260423edf253b425983a49","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                # deprecated."},{"line_number":178,"context_line":"                return res if res in supported_glance_versions else 1"},{"line_number":179,"context_line":"    except Exception:"},{"line_number":180,"context_line":"        LOG.error(_LE(\"Unable to determine the glance API version\"))"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def get_api_servers():"}],"source_content_type":"text/x-python","patch_set":26,"id":"7a740942_0c8ffa75","line":180,"updated":"2015-12-07 19:40:30.000000000","message":"There should be a return 1 here as well.  And probably a new line 179 above the \"except...\" block which returns 1 as well.","commit_id":"84a7e91929fe8c4d1715ed564e8256dd730530bf"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"3255134912b30681c98eb8a76f3af65648f4733e","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                # deprecated."},{"line_number":178,"context_line":"                return res if res in supported_glance_versions else 1"},{"line_number":179,"context_line":"    except Exception:"},{"line_number":180,"context_line":"        LOG.error(_LE(\"Unable to determine the glance API version\"))"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def get_api_servers():"}],"source_content_type":"text/x-python","patch_set":26,"id":"7a740942_0e511c36","line":180,"in_reply_to":"7a740942_0c8ffa75","updated":"2015-12-08 05:50:18.000000000","message":"Added this. However, the line above except is already defaulting it to 1 right? \nAm i missing something?","commit_id":"84a7e91929fe8c4d1715ed564e8256dd730530bf"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"e1979cfc88812740a4f7f0b38fb55ad619003d5a","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                # deprecated."},{"line_number":178,"context_line":"                return res if res in supported_glance_versions else 1"},{"line_number":179,"context_line":"    except Exception:"},{"line_number":180,"context_line":"        LOG.error(_LE(\"Unable to determine the glance API version\"))"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def get_api_servers():"}],"source_content_type":"text/x-python","patch_set":26,"id":"7a740942_45536c6b","line":180,"in_reply_to":"7a740942_0e511c36","updated":"2015-12-08 13:10:56.000000000","message":"I was thinking of cases where content[\u0027versions\u0027] \u003d [] or there is no version[\u0027status\u0027] \u003d\u003d \u0027CURRENT\u0027.  Although I think we would want logging for those cases as well.","commit_id":"84a7e91929fe8c4d1715ed564e8256dd730530bf"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"192b570ca5acfad8b5eb07b3043b5cda48827642","unresolved":false,"context_lines":[{"line_number":177,"context_line":"                # deprecated."},{"line_number":178,"context_line":"                return res if res in supported_glance_versions else 1"},{"line_number":179,"context_line":"    except Exception:"},{"line_number":180,"context_line":"        LOG.error(_LE(\"Unable to determine the glance API version\"))"},{"line_number":181,"context_line":""},{"line_number":182,"context_line":""},{"line_number":183,"context_line":"def get_api_servers():"}],"source_content_type":"text/x-python","patch_set":26,"id":"7a740942_bd634841","line":180,"in_reply_to":"7a740942_45536c6b","updated":"2015-12-08 14:02:40.000000000","message":"Done","commit_id":"84a7e91929fe8c4d1715ed564e8256dd730530bf"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"3f9bf1e50347a58f06755d3e9ed9b544a815d88d","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        host \u003d \u0027[%s]\u0027 % host"},{"line_number":155,"context_line":"    endpoint \u003d \u0027%s://%s:%s\u0027 % (scheme, host, port)"},{"line_number":156,"context_line":"    if version is None:"},{"line_number":157,"context_line":"        version \u003d _determine_curr_major_version(endpoint)"},{"line_number":158,"context_line":"    client \u003d glanceclient.Client(str(version), endpoint, **params)"},{"line_number":159,"context_line":"    return client"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a7e1126_dbd29f34","line":157,"updated":"2015-12-16 23:19:50.000000000","message":"I\u0027m concerned about making a REST call for the current major version every time we create a client object. Checking around, it looks like a new client object is created for every call to glance (get_all/get/create/update/delete/download), so I think we should cache the current major version after we discover it the first time. Otherwise we\u0027re going to double our calls to glance just to get a version every time","commit_id":"59f590a63de616b2a094fe6e2ebc3e1ebb6ac864"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"2081c18004abc3ebe2e476c27e814b22ed106b96","unresolved":false,"context_lines":[{"line_number":154,"context_line":"        host \u003d \u0027[%s]\u0027 % host"},{"line_number":155,"context_line":"    endpoint \u003d \u0027%s://%s:%s\u0027 % (scheme, host, port)"},{"line_number":156,"context_line":"    if version is None:"},{"line_number":157,"context_line":"        version \u003d _determine_curr_major_version(endpoint)"},{"line_number":158,"context_line":"    client \u003d glanceclient.Client(str(version), endpoint, **params)"},{"line_number":159,"context_line":"    return client"},{"line_number":160,"context_line":""}],"source_content_type":"text/x-python","patch_set":29,"id":"3a7e1126_134e8e6f","line":157,"in_reply_to":"3a7e1126_dbd29f34","updated":"2015-12-17 14:28:10.000000000","message":"Agreed, this was a lightweight operation before, but now it\u0027s extra heavy.","commit_id":"59f590a63de616b2a094fe6e2ebc3e1ebb6ac864"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e8fb0f752ffc035e67cbc7bc3ce8407d848c7f2b","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        # if so, it is ipv6 address, need to wrap it with \u0027[]\u0027"},{"line_number":154,"context_line":"        host \u003d \u0027[%s]\u0027 % host"},{"line_number":155,"context_line":"    endpoint \u003d \u0027%s://%s:%s\u0027 % (scheme, host, port)"},{"line_number":156,"context_line":"    # (sbiswas7): Remove this plumbing once we have migrated all of the"},{"line_number":157,"context_line":"    # code to use v2."},{"line_number":158,"context_line":"    if version is None:"},{"line_number":159,"context_line":"        version \u003d _determine_curr_major_version(endpoint)"}],"source_content_type":"text/x-python","patch_set":30,"id":"3a7e1126_71cb2ea6","line":156,"range":{"start_line":156,"start_character":6,"end_line":156,"end_character":16},"updated":"2015-12-18 00:10:46.000000000","message":"This should be NOTE(sbiswas7) for the note format","commit_id":"b2c6227f4c7a98a5ca64511027a9fea06065a3f4"},{"author":{"_account_id":4690,"name":"melanie witt","display_name":"melwitt","email":"melwittt@gmail.com","username":"melwitt"},"change_message_id":"e8fb0f752ffc035e67cbc7bc3ce8407d848c7f2b","unresolved":false,"context_lines":[{"line_number":157,"context_line":"    # code to use v2."},{"line_number":158,"context_line":"    if version is None:"},{"line_number":159,"context_line":"        version \u003d _determine_curr_major_version(endpoint)"},{"line_number":160,"context_line":"        # (sbiswas7): If there was a problem with discovering the API"},{"line_number":161,"context_line":"        # version then default that to 2."},{"line_number":162,"context_line":"        if version is None:"},{"line_number":163,"context_line":"            version \u003d \u00272\u0027"}],"source_content_type":"text/x-python","patch_set":30,"id":"3a7e1126_51c1527f","line":160,"range":{"start_line":160,"start_character":10,"end_line":160,"end_character":20},"updated":"2015-12-18 00:10:46.000000000","message":"This should be NOTE(sbiswas7) for the note format","commit_id":"b2c6227f4c7a98a5ca64511027a9fea06065a3f4"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"630b0d7f0a2ef04c01ac518890c704c3fe271488","unresolved":false,"context_lines":[{"line_number":607,"context_line":"    else:"},{"line_number":608,"context_line":"        if include_locations:"},{"line_number":609,"context_line":"            LOG.warning(_LW(\"Including locations is not supported\""},{"line_number":610,"context_line":"                            \" in legacy mode\"))"},{"line_number":611,"context_line":"        return _extract_attributes_legacy(image, include_locations)"},{"line_number":612,"context_line":""},{"line_number":613,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"fa69d971_b3dc9175","line":610,"updated":"2016-01-07 20:12:54.000000000","message":"Why isn\u0027t including locations no supported in legacy mode? It\u0027s supported below. I think perhaps this should read \"Including locations is not supported by the Glance API server %(glance_server_uri)s, which is using version 1.0 of the Glance API.\"","commit_id":"d3e6484d58fb85365fc06a26ed74d26ce5f41c36"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"b67144514b7ae206afc273e1ac1d391779cb4a19","unresolved":false,"context_lines":[{"line_number":607,"context_line":"    else:"},{"line_number":608,"context_line":"        if include_locations:"},{"line_number":609,"context_line":"            LOG.warning(_LW(\"Including locations is not supported\""},{"line_number":610,"context_line":"                            \" in legacy mode\"))"},{"line_number":611,"context_line":"        return _extract_attributes_legacy(image, include_locations)"},{"line_number":612,"context_line":""},{"line_number":613,"context_line":""}],"source_content_type":"text/x-python","patch_set":33,"id":"fa69d971_206581e0","line":610,"in_reply_to":"fa69d971_b3dc9175","updated":"2016-01-08 06:16:44.000000000","message":"printing glance_server_uri - would probably need additional parameters to be passed to the method. Do you consider that absolutely necessary?\n\nI have modified the message otherwise.","commit_id":"d3e6484d58fb85365fc06a26ed74d26ce5f41c36"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":309,"context_line":"                             image is deleted."},{"line_number":310,"context_line":"        \"\"\""},{"line_number":311,"context_line":"        version \u003d 1"},{"line_number":312,"context_line":"        if include_locations:"},{"line_number":313,"context_line":"            version \u003d 2"},{"line_number":314,"context_line":"        try:"},{"line_number":315,"context_line":"            image \u003d self._client.call(context, version, \u0027get\u0027, image_id)"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_be35fa46","side":"PARENT","line":312,"updated":"2016-01-13 10:29:49.000000000","message":"it feels like we should still request version\u003d2 when include_locations\u003dTrue?","commit_id":"a4b7f52c1b3f4df996ad334929747bcec298db75"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"c2d9450279f0a4ab8950d1b77a493ab0e75e8528","unresolved":false,"context_lines":[{"line_number":309,"context_line":"                             image is deleted."},{"line_number":310,"context_line":"        \"\"\""},{"line_number":311,"context_line":"        version \u003d 1"},{"line_number":312,"context_line":"        if include_locations:"},{"line_number":313,"context_line":"            version \u003d 2"},{"line_number":314,"context_line":"        try:"},{"line_number":315,"context_line":"            image \u003d self._client.call(context, version, \u0027get\u0027, image_id)"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a68dd71_f09a11c5","side":"PARENT","line":312,"in_reply_to":"da6ed579_be35fa46","updated":"2016-01-20 14:35:15.000000000","message":"Agree! If glance_ver is 1 and we request locations, then it will be an error... But what if glance server doesn\u0027t support v2?! It means that for a long time Nova can\u0027t work with v1 only, and v2 support is mandatory.","commit_id":"a4b7f52c1b3f4df996ad334929747bcec298db75"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":91,"context_line":"CONF.import_opt(\u0027my_ip\u0027, \u0027nova.netconf\u0027)"},{"line_number":92,"context_line":""},{"line_number":93,"context_line":"supported_glance_versions \u003d (1, 2)"},{"line_number":94,"context_line":"glance_ver \u003d None"},{"line_number":95,"context_line":""},{"line_number":96,"context_line":""},{"line_number":97,"context_line":"def generate_glance_url():"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_3edcaa11","line":94,"updated":"2016-01-13 10:29:49.000000000","message":"Nit: Is it not more normal to have these things named with all caps? I should supported_glance_versions isn\u0027t.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":132,"context_line":"    }"},{"line_number":133,"context_line":""},{"line_number":134,"context_line":""},{"line_number":135,"context_line":"def _glanceclient_from_endpoint(context, endpoint, version\u003dNone):"},{"line_number":136,"context_line":"        \"\"\"Instantiate a new glanceclient.Client object.\"\"\""},{"line_number":137,"context_line":"        params \u003d {}"},{"line_number":138,"context_line":"        # NOTE(sdague): even if we aren\u0027t using keystone, it doesn\u0027t"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_61e36334","line":135,"updated":"2016-01-13 10:29:49.000000000","message":"I don\u0027t see any unit tests for the changes to this method? Maybe I missed them?","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":149,"context_line":"                params[\u0027key_file\u0027] \u003d CONF.ssl.key_file"},{"line_number":150,"context_line":"            if CONF.ssl.ca_file:"},{"line_number":151,"context_line":"                params[\u0027cacert\u0027] \u003d CONF.ssl.ca_file"},{"line_number":152,"context_line":"        # (sbiswas7): Remove this plumbing once we have migrated all of the"},{"line_number":153,"context_line":"        # code to use v2."},{"line_number":154,"context_line":"        if version is None:"},{"line_number":155,"context_line":"            version \u003d _determine_curr_major_version(endpoint)"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_3e910a9a","line":152,"updated":"2016-01-13 10:29:49.000000000","message":"As mel noted on the previous patch, please put #NOTE(sbiswas7) or TODO or FIXME or similar.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":153,"context_line":"        # code to use v2."},{"line_number":154,"context_line":"        if version is None:"},{"line_number":155,"context_line":"            version \u003d _determine_curr_major_version(endpoint)"},{"line_number":156,"context_line":"            # (sbiswas7): If there was a problem with discovering the API"},{"line_number":157,"context_line":"            # version then default that to 2."},{"line_number":158,"context_line":"            if version is None:"},{"line_number":159,"context_line":"                version \u003d \u00272\u0027"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_bef3ba09","line":156,"updated":"2016-01-13 10:29:49.000000000","message":"as above.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ff2536e2e2f13c70bf64a1bcb51801b79a41624e","unresolved":false,"context_lines":[{"line_number":157,"context_line":"            # version then default that to 2."},{"line_number":158,"context_line":"            if version is None:"},{"line_number":159,"context_line":"                version \u003d \u00272\u0027"},{"line_number":160,"context_line":"        return glanceclient.Client(str(version), endpoint, **params)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"def _determine_curr_major_version(endpoint):"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_7c422a40","line":160,"updated":"2016-01-13 10:45:59.000000000","message":"I think we should also return the version here, so we can save it in the client wrapper.\n\nreturn version, glanceclient...","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"c2d9450279f0a4ab8950d1b77a493ab0e75e8528","unresolved":false,"context_lines":[{"line_number":157,"context_line":"            # version then default that to 2."},{"line_number":158,"context_line":"            if version is None:"},{"line_number":159,"context_line":"                version \u003d \u00272\u0027"},{"line_number":160,"context_line":"        return glanceclient.Client(str(version), endpoint, **params)"},{"line_number":161,"context_line":""},{"line_number":162,"context_line":""},{"line_number":163,"context_line":"def _determine_curr_major_version(endpoint):"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a68dd71_3ca72551","line":160,"in_reply_to":"da6ed579_7c422a40","updated":"2016-01-20 14:35:15.000000000","message":"It\u0027s not necessary. client.version contains it. https://github.com/openstack/python-glanceclient/blob/master/glanceclient/v2/client.py#L41\n\nBut you have to convert it into int :(","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    :returns Integer version number or None if unable to determine version"},{"line_number":167,"context_line":"    \"\"\""},{"line_number":168,"context_line":"    global glance_ver"},{"line_number":169,"context_line":"    if glance_ver:"},{"line_number":170,"context_line":"        return glance_ver"},{"line_number":171,"context_line":"    http_client \u003d http.HTTPClient(endpoint)"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_3e77ca3b","line":168,"updated":"2016-01-13 10:29:49.000000000","message":"if we do this, I think we need to clear this global on SIG_HUP (when we reload config, and recalculate version pins, etc)\n\nWe need this to make it easier to deal with upgrades.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"c2d9450279f0a4ab8950d1b77a493ab0e75e8528","unresolved":false,"context_lines":[{"line_number":165,"context_line":""},{"line_number":166,"context_line":"    :returns Integer version number or None if unable to determine version"},{"line_number":167,"context_line":"    \"\"\""},{"line_number":168,"context_line":"    global glance_ver"},{"line_number":169,"context_line":"    if glance_ver:"},{"line_number":170,"context_line":"        return glance_ver"},{"line_number":171,"context_line":"    http_client \u003d http.HTTPClient(endpoint)"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a68dd71_f32bfb31","line":168,"in_reply_to":"da6ed579_3e77ca3b","updated":"2016-01-20 14:35:15.000000000","message":"Yep... we should think about dynamic config upgrades.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"ff2536e2e2f13c70bf64a1bcb51801b79a41624e","unresolved":false,"context_lines":[{"line_number":222,"context_line":"    def _create_static_client(self, context, endpoint, version):"},{"line_number":223,"context_line":"        \"\"\"Create a client that we\u0027ll use for every call.\"\"\""},{"line_number":224,"context_line":"        self.api_server \u003d str(endpoint)"},{"line_number":225,"context_line":"        return _glanceclient_from_endpoint(context, endpoint, version)"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"    def _create_onetime_client(self, context, version):"},{"line_number":228,"context_line":"        \"\"\"Create a client that will be used for one call.\"\"\""}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_7c3b0ad2","line":225,"updated":"2016-01-13 10:45:59.000000000","message":"should we not save self.version here? ideally saving it as an int not a string, I feel.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"c2d9450279f0a4ab8950d1b77a493ab0e75e8528","unresolved":false,"context_lines":[{"line_number":222,"context_line":"    def _create_static_client(self, context, endpoint, version):"},{"line_number":223,"context_line":"        \"\"\"Create a client that we\u0027ll use for every call.\"\"\""},{"line_number":224,"context_line":"        self.api_server \u003d str(endpoint)"},{"line_number":225,"context_line":"        return _glanceclient_from_endpoint(context, endpoint, version)"},{"line_number":226,"context_line":""},{"line_number":227,"context_line":"    def _create_onetime_client(self, context, version):"},{"line_number":228,"context_line":"        \"\"\"Create a client that will be used for one call.\"\"\""}],"source_content_type":"text/x-python","patch_set":35,"id":"9a68dd71_7095c13e","line":225,"in_reply_to":"da6ed579_7c3b0ad2","updated":"2016-01-20 14:35:15.000000000","message":"As I mentioned it\u0027s not necessary. Since client was saved to self.client you can get glance version with self.client.version.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":560,"context_line":"    return _convert(_json_dumps, metadata)"},{"line_number":561,"context_line":""},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"def _extract_attributes(image, include_locations\u003dFalse):"},{"line_number":564,"context_line":"    if hasattr(image, \u0027schema\u0027):"},{"line_number":565,"context_line":"        return _extract_attributes_schema_based(image, include_locations)"},{"line_number":566,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_1ed76624","line":563,"updated":"2016-01-13 10:29:49.000000000","message":"I wonder if we should add a TODO about moving this translation into glanceclient (or similar), at least eventually?","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"63df5fcf9a6b02d9acbe2c4f0bc689d9b8c4e85d","unresolved":false,"context_lines":[{"line_number":560,"context_line":"    return _convert(_json_dumps, metadata)"},{"line_number":561,"context_line":""},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"def _extract_attributes(image, include_locations\u003dFalse):"},{"line_number":564,"context_line":"    if hasattr(image, \u0027schema\u0027):"},{"line_number":565,"context_line":"        return _extract_attributes_schema_based(image, include_locations)"},{"line_number":566,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a5de9d1_a9ff0ea9","line":563,"in_reply_to":"9a68dd71_50e43d3a","updated":"2016-01-28 14:48:56.000000000","message":"I know that exists, I just wanted to add a note that this code is not intended to live too long for the benefit of other reviews without that info.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"c2d9450279f0a4ab8950d1b77a493ab0e75e8528","unresolved":false,"context_lines":[{"line_number":560,"context_line":"    return _convert(_json_dumps, metadata)"},{"line_number":561,"context_line":""},{"line_number":562,"context_line":""},{"line_number":563,"context_line":"def _extract_attributes(image, include_locations\u003dFalse):"},{"line_number":564,"context_line":"    if hasattr(image, \u0027schema\u0027):"},{"line_number":565,"context_line":"        return _extract_attributes_schema_based(image, include_locations)"},{"line_number":566,"context_line":"    else:"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a68dd71_50e43d3a","line":563,"in_reply_to":"da6ed579_1ed76624","updated":"2016-01-20 14:35:15.000000000","message":"John, this work is in progress. Soon glance client will be able to do it https://review.openstack.org/#/c/266419/","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":567,"context_line":"        if include_locations:"},{"line_number":568,"context_line":"            LOG.warning(_LW(\"Including locations is not supported \""},{"line_number":569,"context_line":"                            \"by the Glance API server, which is using \""},{"line_number":570,"context_line":"                            \"version 1.0 of the Glance API\"))"},{"line_number":571,"context_line":"        return _extract_attributes_legacy(image, include_locations)"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_9ef596cc","line":570,"updated":"2016-01-13 10:29:49.000000000","message":"I do wonder if that needs to be an exception that gets raised here. Usually when include_locations \u003d True the caller *needs* the locations (for ceph, or similar, I think?)\n\nBetter, why not just check the version is v2, otherwise raise an exception saying that v2 is not available?","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"63df5fcf9a6b02d9acbe2c4f0bc689d9b8c4e85d","unresolved":false,"context_lines":[{"line_number":567,"context_line":"        if include_locations:"},{"line_number":568,"context_line":"            LOG.warning(_LW(\"Including locations is not supported \""},{"line_number":569,"context_line":"                            \"by the Glance API server, which is using \""},{"line_number":570,"context_line":"                            \"version 1.0 of the Glance API\"))"},{"line_number":571,"context_line":"        return _extract_attributes_legacy(image, include_locations)"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"7a5de9d1_09de623f","line":570,"in_reply_to":"9a68dd71_50175ded","updated":"2016-01-28 14:48:56.000000000","message":"But surely we need *this* patch to work, so it should be changed here?","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"c2d9450279f0a4ab8950d1b77a493ab0e75e8528","unresolved":false,"context_lines":[{"line_number":567,"context_line":"        if include_locations:"},{"line_number":568,"context_line":"            LOG.warning(_LW(\"Including locations is not supported \""},{"line_number":569,"context_line":"                            \"by the Glance API server, which is using \""},{"line_number":570,"context_line":"                            \"version 1.0 of the Glance API\"))"},{"line_number":571,"context_line":"        return _extract_attributes_legacy(image, include_locations)"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":""}],"source_content_type":"text/x-python","patch_set":35,"id":"9a68dd71_50175ded","line":570,"in_reply_to":"da6ed579_9ef596cc","updated":"2016-01-20 14:35:15.000000000","message":"Agree. Will be updated in https://review.openstack.org/#/c/266419/","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        return _extract_attributes_legacy(image, include_locations)"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"def _extract_attributes_legacy(image, include_locations\u003dFalse):"},{"line_number":575,"context_line":"    # NOTE(hdd): If a key is not found, base.Resource.__getattr__() may perform"},{"line_number":576,"context_line":"    # a get(), resulting in a useless request back to glance. This list is"},{"line_number":577,"context_line":"    # therefore sorted, with dependent attributes as the end"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_7e030243","line":574,"updated":"2016-01-13 10:29:49.000000000","message":"why have include_locations if it is not used in here?","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"63df5fcf9a6b02d9acbe2c4f0bc689d9b8c4e85d","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        return _extract_attributes_legacy(image, include_locations)"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"def _extract_attributes_legacy(image, include_locations\u003dFalse):"},{"line_number":575,"context_line":"    # NOTE(hdd): If a key is not found, base.Resource.__getattr__() may perform"},{"line_number":576,"context_line":"    # a get(), resulting in a useless request back to glance. This list is"},{"line_number":577,"context_line":"    # therefore sorted, with dependent attributes as the end"}],"source_content_type":"text/x-python","patch_set":35,"id":"7a5de9d1_a9edcef0","line":574,"in_reply_to":"9a68dd71_70f941c8","updated":"2016-01-28 14:48:56.000000000","message":"as above.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"c2d9450279f0a4ab8950d1b77a493ab0e75e8528","unresolved":false,"context_lines":[{"line_number":571,"context_line":"        return _extract_attributes_legacy(image, include_locations)"},{"line_number":572,"context_line":""},{"line_number":573,"context_line":""},{"line_number":574,"context_line":"def _extract_attributes_legacy(image, include_locations\u003dFalse):"},{"line_number":575,"context_line":"    # NOTE(hdd): If a key is not found, base.Resource.__getattr__() may perform"},{"line_number":576,"context_line":"    # a get(), resulting in a useless request back to glance. This list is"},{"line_number":577,"context_line":"    # therefore sorted, with dependent attributes as the end"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a68dd71_70f941c8","line":574,"in_reply_to":"da6ed579_7e030243","updated":"2016-01-20 14:35:15.000000000","message":"Fixed in https://review.openstack.org/#/c/266419/","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":782,"name":"John Garbutt","email":"john@johngarbutt.com","username":"johngarbutt"},"change_message_id":"78ccca5731a4fcf505933ef9ef4d0607f68c35c6","unresolved":false,"context_lines":[{"line_number":628,"context_line":"    output \u003d {\u0027properties\u0027: {}, \u0027deleted\u0027: False, \u0027deleted_at\u0027: None}"},{"line_number":629,"context_line":"    for name, value in six.iteritems(image):"},{"line_number":630,"context_line":"        if (name in omit_attrs"},{"line_number":631,"context_line":"                or name in include_locations_attrs and not include_locations):"},{"line_number":632,"context_line":"            continue"},{"line_number":633,"context_line":"        elif name \u003d\u003d \u0027visibility\u0027:"},{"line_number":634,"context_line":"            output[\u0027is_public\u0027] \u003d value \u003d\u003d \u0027public\u0027"}],"source_content_type":"text/x-python","patch_set":35,"id":"da6ed579_9eacb636","line":631,"updated":"2016-01-13 10:29:49.000000000","message":"Why bother with include_locations here?\n\nThe original idea is just to make sure you get the locations when needed. We may as well just pass them back if we have them.","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"c2d9450279f0a4ab8950d1b77a493ab0e75e8528","unresolved":false,"context_lines":[{"line_number":628,"context_line":"    output \u003d {\u0027properties\u0027: {}, \u0027deleted\u0027: False, \u0027deleted_at\u0027: None}"},{"line_number":629,"context_line":"    for name, value in six.iteritems(image):"},{"line_number":630,"context_line":"        if (name in omit_attrs"},{"line_number":631,"context_line":"                or name in include_locations_attrs and not include_locations):"},{"line_number":632,"context_line":"            continue"},{"line_number":633,"context_line":"        elif name \u003d\u003d \u0027visibility\u0027:"},{"line_number":634,"context_line":"            output[\u0027is_public\u0027] \u003d value \u003d\u003d \u0027public\u0027"}],"source_content_type":"text/x-python","patch_set":35,"id":"9a68dd71_306c299c","line":631,"in_reply_to":"da6ed579_9eacb636","updated":"2016-01-20 14:35:15.000000000","message":"Fixed in https://review.openstack.org/#/c/266419/","commit_id":"4e1c023174b2a045083093221d26b44243af1e71"}],"nova/tests/unit/image/test_glance.py":[{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"630b0d7f0a2ef04c01ac518890c704c3fe271488","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                           \u0027visibility\u0027)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def is_base_property(self, prop_name):"},{"line_number":56,"context_line":"        return prop_name in self.base_props"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"image_fixtures \u003d {"},{"line_number":59,"context_line":"    \u0027active_image_v1\u0027: {"}],"source_content_type":"text/x-python","patch_set":33,"id":"fa69d971_93edcdf1","line":56,"updated":"2016-01-07 20:12:54.000000000","message":"The above FakeSchema class is not used anywhere in this file. Please remove it.","commit_id":"d3e6484d58fb85365fc06a26ed74d26ce5f41c36"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"b67144514b7ae206afc273e1ac1d391779cb4a19","unresolved":false,"context_lines":[{"line_number":53,"context_line":"                           \u0027visibility\u0027)"},{"line_number":54,"context_line":""},{"line_number":55,"context_line":"    def is_base_property(self, prop_name):"},{"line_number":56,"context_line":"        return prop_name in self.base_props"},{"line_number":57,"context_line":""},{"line_number":58,"context_line":"image_fixtures \u003d {"},{"line_number":59,"context_line":"    \u0027active_image_v1\u0027: {"}],"source_content_type":"text/x-python","patch_set":33,"id":"fa69d971_3b50530a","line":56,"in_reply_to":"fa69d971_93edcdf1","updated":"2016-01-08 06:16:44.000000000","message":"Jay, it\u0027s being used below around line 493 as side effects...","commit_id":"d3e6484d58fb85365fc06a26ed74d26ce5f41c36"}],"requirements.txt":[{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"6ef3b73b40b42085a72740b7144e576f754a651d","unresolved":false,"context_lines":[{"line_number":43,"context_line":"oslo.utils\u003e\u003d2.0.0 # Apache-2.0"},{"line_number":44,"context_line":"oslo.db\u003e\u003d2.4.1 # Apache-2.0"},{"line_number":45,"context_line":"oslo.rootwrap\u003e\u003d2.0.0 # Apache-2.0"},{"line_number":46,"context_line":"oslo.messaging!\u003d1.17.0,!\u003d1.17.1,\u003e\u003d1.16.0,!\u003d2.6.0 # Apache-2.0"},{"line_number":47,"context_line":"oslo.i18n\u003e\u003d1.5.0 # Apache-2.0"},{"line_number":48,"context_line":"oslo.service\u003e\u003d0.9.0 # Apache-2.0"},{"line_number":49,"context_line":"rfc3986\u003e\u003d0.2.0 # Apache-2.0"}],"source_content_type":"text/plain","patch_set":6,"id":"7a2fa921_c6c4e360","line":46,"updated":"2015-10-13 00:11:37.000000000","message":"It\u0027s a temporary solution. Will be removed later.","commit_id":"8583645297862ce6ea011724c7d99649f76d6734"}]}
