)]}'
{"nova/image/glance.py":[{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"7c2b9fc2bdf0a6aa7c0a428f3f3b9bbf8d37cc6c","unresolved":false,"context_lines":[{"line_number":592,"context_line":"        elif attr \u003d\u003d \u0027name\u0027:"},{"line_number":593,"context_line":"            output[attr] \u003d getattr(image, attr, None)"},{"line_number":594,"context_line":"        # NOTE(liusheng): queued image may not have these attributes and \u0027name\u0027"},{"line_number":595,"context_line":"        elif queued and attr in queued_exclude_attrs:"},{"line_number":596,"context_line":"            output[attr] \u003d getattr(image, attr, None)"},{"line_number":597,"context_line":"        else:"},{"line_number":598,"context_line":"            # NOTE(xarses): Anything that is caught with the default value"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_e0b9eb7a","line":595,"updated":"2015-10-12 08:51:20.000000000","message":"I am actually finding it a bit hard to understand this code.\nIt says - in the note, that queued image may not have these attributes and then it tries to fetch the same attribute below - just to populate it with None?\n\nThe v2 version of this method doesn\u0027t have this check. How is it supposed to behave for that?","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"fae20cef4ac7bd2ff8ccd4e6c03ea537a60e8577","unresolved":false,"context_lines":[{"line_number":592,"context_line":"        elif attr \u003d\u003d \u0027name\u0027:"},{"line_number":593,"context_line":"            output[attr] \u003d getattr(image, attr, None)"},{"line_number":594,"context_line":"        # NOTE(liusheng): queued image may not have these attributes and \u0027name\u0027"},{"line_number":595,"context_line":"        elif queued and attr in queued_exclude_attrs:"},{"line_number":596,"context_line":"            output[attr] \u003d getattr(image, attr, None)"},{"line_number":597,"context_line":"        else:"},{"line_number":598,"context_line":"            # NOTE(xarses): Anything that is caught with the default value"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_4ea47707","line":595,"in_reply_to":"7a2fa921_e0b9eb7a","updated":"2015-10-12 19:32:18.000000000","message":"It\u0027s okay. Indeed, v1 output may not contain these two parameters if status of image is \u0027queued\u0027. So we have to manually add them there with None values.\n\nOn the other hand, even if \u0027disk_format\u0027 and \u0027container_format\u0027 are not presented in queued image - v2 automatically adds None values there.\n\nYou can see the example in test_glance.py. There are two \"empty\" image outputs in fixtures (v1 and v2) and after my transformation they become equal.","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"7c2b9fc2bdf0a6aa7c0a428f3f3b9bbf8d37cc6c","unresolved":false,"context_lines":[{"line_number":602,"context_line":"            output[attr] \u003d getattr(image, attr, None)"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"    output[\u0027properties\u0027] \u003d getattr(image, \u0027properties\u0027, {})"},{"line_number":605,"context_line":"    if include_locations is True:"},{"line_number":606,"context_line":"        # It\u0027s done for backward compatibility. V1 doesn\u0027t support including"},{"line_number":607,"context_line":"        # locations in output."},{"line_number":608,"context_line":"        output[\u0027direct_url\u0027] \u003d output[\u0027locations\u0027] \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_a0abf3d5","line":605,"updated":"2015-10-12 08:51:20.000000000","message":"nit: if include_locations:\n\nOn another thought - since this method is specific to v1 APIs - is it more obvious to set the \u0027direct_url\u0027 and \u0027locations\u0027 values to None irrespective of the include_locations check?","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"fae20cef4ac7bd2ff8ccd4e6c03ea537a60e8577","unresolved":false,"context_lines":[{"line_number":602,"context_line":"            output[attr] \u003d getattr(image, attr, None)"},{"line_number":603,"context_line":""},{"line_number":604,"context_line":"    output[\u0027properties\u0027] \u003d getattr(image, \u0027properties\u0027, {})"},{"line_number":605,"context_line":"    if include_locations is True:"},{"line_number":606,"context_line":"        # It\u0027s done for backward compatibility. V1 doesn\u0027t support including"},{"line_number":607,"context_line":"        # locations in output."},{"line_number":608,"context_line":"        output[\u0027direct_url\u0027] \u003d output[\u0027locations\u0027] \u003d None"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_2e233b07","line":605,"in_reply_to":"7a2fa921_a0abf3d5","updated":"2015-10-12 19:32:18.000000000","message":"My main goal was \u0027not to break the existing format for v1\u0027. In case of v1 if include_locations_attrs is True, then these parameters are included in the output and vice versa, respectively. Here is a test for it, btw https://github.com/openstack/nova/blob/master/nova/tests/unit/image/test_glance.py#L108\nSo, there is no way to set the \u0027direct_url\u0027 and \u0027locations\u0027 values to None irrespective of the include_locations check.\n\nAbout if include_locations: - some time ago I got a lot of minuses for this, because people were worried that if we pass, for example, \u0027False\u0027 (as a string, not a boolean constant) to include_locations, then it will be considered as True for the reason \u0027False\u0027 is not an empty string. And they suggested me to write these conditions more explicitly and check also that the value \u0027is True\u0027. \nBut I don\u0027t mind to change it as you want.","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"7c2b9fc2bdf0a6aa7c0a428f3f3b9bbf8d37cc6c","unresolved":false,"context_lines":[{"line_number":621,"context_line":"        if name in omit_attrs \\"},{"line_number":622,"context_line":"                or name in include_locations_attrs and not include_locations:"},{"line_number":623,"context_line":"            continue"},{"line_number":624,"context_line":"        if not schema.is_base_property(name):"},{"line_number":625,"context_line":"            if hasattr(image, name):"},{"line_number":626,"context_line":"                output[\u0027properties\u0027][name] \u003d getattr(image, name)"},{"line_number":627,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_7367f7ea","line":624,"updated":"2015-10-12 08:51:20.000000000","message":"elif not schema.is_base_property(name) and hasattr(image, name):\n\ndoes this work too?","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"32705f950c61d743f07b83861b1ab6898e9357a2","unresolved":false,"context_lines":[{"line_number":621,"context_line":"        if name in omit_attrs \\"},{"line_number":622,"context_line":"                or name in include_locations_attrs and not include_locations:"},{"line_number":623,"context_line":"            continue"},{"line_number":624,"context_line":"        if not schema.is_base_property(name):"},{"line_number":625,"context_line":"            if hasattr(image, name):"},{"line_number":626,"context_line":"                output[\u0027properties\u0027][name] \u003d getattr(image, name)"},{"line_number":627,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_bdcf71b2","line":624,"in_reply_to":"7a2fa921_491f915b","updated":"2015-10-13 05:57:09.000000000","message":"Good spot. I missed the outer else :)","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"fae20cef4ac7bd2ff8ccd4e6c03ea537a60e8577","unresolved":false,"context_lines":[{"line_number":621,"context_line":"        if name in omit_attrs \\"},{"line_number":622,"context_line":"                or name in include_locations_attrs and not include_locations:"},{"line_number":623,"context_line":"            continue"},{"line_number":624,"context_line":"        if not schema.is_base_property(name):"},{"line_number":625,"context_line":"            if hasattr(image, name):"},{"line_number":626,"context_line":"                output[\u0027properties\u0027][name] \u003d getattr(image, name)"},{"line_number":627,"context_line":"        else:"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_491f915b","line":624,"in_reply_to":"7a2fa921_7367f7ea","updated":"2015-10-12 19:32:18.000000000","message":"No, sir. Example: there is a nonbase property in schema called \u0027os_distro\u0027 and it doesn\u0027t present in image output. If we do what you say, then \u0027elif not schema.is_base_property(name) and hasattr(image, name):\u0027 will be False and \u0027else\u0027 branch will be executed, more concrete - line 637 \u0027output[name] \u003d getattr(image, name)\u0027 It\u0027s not what we want - because we want to exclude this parameter from output.\n\nSo, the correct logic is: check if property is non-base and then if it\u0027s presented in output then include it in special \u0027properties\u0027 section, and in other case do nothing.","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"7c2b9fc2bdf0a6aa7c0a428f3f3b9bbf8d37cc6c","unresolved":false,"context_lines":[{"line_number":624,"context_line":"        if not schema.is_base_property(name):"},{"line_number":625,"context_line":"            if hasattr(image, name):"},{"line_number":626,"context_line":"                output[\u0027properties\u0027][name] \u003d getattr(image, name)"},{"line_number":627,"context_line":"        else:"},{"line_number":628,"context_line":"            if name \u003d\u003d \u0027visibility\u0027:"},{"line_number":629,"context_line":"                output[\u0027is_public\u0027] \u003d True \\"},{"line_number":630,"context_line":"                    if getattr(image, name) \u003d\u003d \u0027public\u0027 else False"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_33e65f45","line":627,"updated":"2015-10-12 08:51:20.000000000","message":"Since you are iterating on one name at a time, doesn\u0027t converting all of the ifs/elifs make sense?\n\nelif name \u003d\u003d \u0027visibility\u0027:\n....\n\nelif name \u003d\u003d \u0027tags\u0027:\n\n...","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"7c2b9fc2bdf0a6aa7c0a428f3f3b9bbf8d37cc6c","unresolved":false,"context_lines":[{"line_number":624,"context_line":"        if not schema.is_base_property(name):"},{"line_number":625,"context_line":"            if hasattr(image, name):"},{"line_number":626,"context_line":"                output[\u0027properties\u0027][name] \u003d getattr(image, name)"},{"line_number":627,"context_line":"        else:"},{"line_number":628,"context_line":"            if name \u003d\u003d \u0027visibility\u0027:"},{"line_number":629,"context_line":"                output[\u0027is_public\u0027] \u003d True \\"},{"line_number":630,"context_line":"                    if getattr(image, name) \u003d\u003d \u0027public\u0027 else False"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_93d97386","line":627,"updated":"2015-10-12 08:51:20.000000000","message":"another elif name \u003d\u003d \u0027visibility\u0027:\n....\n\nelif name \u003d\u003d \u0027tags\u0027:\n\n...","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"fae20cef4ac7bd2ff8ccd4e6c03ea537a60e8577","unresolved":false,"context_lines":[{"line_number":624,"context_line":"        if not schema.is_base_property(name):"},{"line_number":625,"context_line":"            if hasattr(image, name):"},{"line_number":626,"context_line":"                output[\u0027properties\u0027][name] \u003d getattr(image, name)"},{"line_number":627,"context_line":"        else:"},{"line_number":628,"context_line":"            if name \u003d\u003d \u0027visibility\u0027:"},{"line_number":629,"context_line":"                output[\u0027is_public\u0027] \u003d True \\"},{"line_number":630,"context_line":"                    if getattr(image, name) \u003d\u003d \u0027public\u0027 else False"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_c98f2174","line":627,"in_reply_to":"7a2fa921_138c8334","updated":"2015-10-12 19:32:18.000000000","message":"Yep, agree, it may be optimized a little.","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"172c6ad96361cdefe4878398c4488c3b857704ee","unresolved":false,"context_lines":[{"line_number":624,"context_line":"        if not schema.is_base_property(name):"},{"line_number":625,"context_line":"            if hasattr(image, name):"},{"line_number":626,"context_line":"                output[\u0027properties\u0027][name] \u003d getattr(image, name)"},{"line_number":627,"context_line":"        else:"},{"line_number":628,"context_line":"            if name \u003d\u003d \u0027visibility\u0027:"},{"line_number":629,"context_line":"                output[\u0027is_public\u0027] \u003d True \\"},{"line_number":630,"context_line":"                    if getattr(image, name) \u003d\u003d \u0027public\u0027 else False"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_138c8334","line":627,"in_reply_to":"7a2fa921_93d97386","updated":"2015-10-12 08:58:04.000000000","message":"^you can ignore the above one. Must have been some copy problem :)","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"cbada5cdd538787a129d230f334b7a57c6001fe1","unresolved":false,"context_lines":[{"line_number":557,"context_line":""},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"def _extract_attributes(image, include_locations\u003dFalse, version\u003d\u00271\u0027):"},{"line_number":560,"context_line":"    if version \u003d\u003d \u00271\u0027:"},{"line_number":561,"context_line":"        return _extract_attributes_v1(image, include_locations)"},{"line_number":562,"context_line":"    elif version \u003d\u003d \u00272\u0027:"},{"line_number":563,"context_line":"        return _extract_attributes_v2(image, include_locations)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_523c072f","line":560,"updated":"2015-10-13 06:54:17.000000000","message":"Since we are using the glanceclient\u0027s version value in the other patch.\nself._client.version -- i guess we need to change this code to take in float values as opposed to strings for the version variable.","commit_id":"721f4612e5ff36a29e4f4a19adbc0f82bfb48b0e"},{"author":{"_account_id":9775,"name":"Sudipta Biswas","email":"sbiswas7@in.ibm.com","username":"sudswas"},"change_message_id":"fc89c841ef437c3ac92467e96720590b04d77b86","unresolved":false,"context_lines":[{"line_number":557,"context_line":""},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"def _extract_attributes(image, include_locations\u003dFalse, version\u003d\u00271\u0027):"},{"line_number":560,"context_line":"    if version \u003d\u003d \u00271\u0027:"},{"line_number":561,"context_line":"        return _extract_attributes_v1(image, include_locations)"},{"line_number":562,"context_line":"    elif version \u003d\u003d \u00272\u0027:"},{"line_number":563,"context_line":"        return _extract_attributes_v2(image, include_locations)"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_a85deaed","line":560,"in_reply_to":"7a2fa921_523c072f","updated":"2015-10-13 07:49:23.000000000","message":"Actually, we shouldn\u0027t change this behavior because it would make the variable inconsistent within Nova.\n\nSo i have filed a bug in the glanceclient code to solve this: https://bugs.launchpad.net/python-glanceclient/+bug/1505534\n\nHowever, if i am not wrong, the client\u0027s in NOVA\u0027s CIs are only picked up during the milestone releases. If that\u0027s true, then the CI for this patch will keep failing till the correct version of the glanceclient is picked up.\n\nSo maybe we should not rely on the glanceclient\u0027s returned version till then.","commit_id":"721f4612e5ff36a29e4f4a19adbc0f82bfb48b0e"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"09302f1e39f34399b8d375279ab6cfff4c3bd549","unresolved":false,"context_lines":[{"line_number":557,"context_line":""},{"line_number":558,"context_line":""},{"line_number":559,"context_line":"def _extract_attributes(image, include_locations\u003dFalse, version\u003d\u00271\u0027):"},{"line_number":560,"context_line":"    if version \u003d\u003d \u00271\u0027:"},{"line_number":561,"context_line":"        return _extract_attributes_v1(image, include_locations)"},{"line_number":562,"context_line":"    elif version \u003d\u003d \u00272\u0027:"},{"line_number":563,"context_line":"        return _extract_attributes_v2(image, include_locations)"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_54513cd7","line":560,"in_reply_to":"7a2fa921_a85deaed","updated":"2015-10-14 19:47:28.000000000","message":"I followed your solution from the next patch and set GlanceWrapper version to \u0027current\u0027 .","commit_id":"721f4612e5ff36a29e4f4a19adbc0f82bfb48b0e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"25d0a0450f1fabb4a9e9b188f4e3fbc90a4af743","unresolved":false,"context_lines":[{"line_number":564,"context_line":"    else:"},{"line_number":565,"context_line":"        msg \u003d _LE(\u0027Version %s is not supported\u0027) % version"},{"line_number":566,"context_line":"        LOG.error(msg)"},{"line_number":567,"context_line":"        raise NotImplementedError(msg)"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":""},{"line_number":570,"context_line":"def _extract_attributes_v1(image, include_locations\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_a6052715","line":567,"updated":"2015-10-13 00:38:43.000000000","message":"this is a problem the _LE is only a logging hint. For exceptions you should use _()","commit_id":"721f4612e5ff36a29e4f4a19adbc0f82bfb48b0e"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"09302f1e39f34399b8d375279ab6cfff4c3bd549","unresolved":false,"context_lines":[{"line_number":564,"context_line":"    else:"},{"line_number":565,"context_line":"        msg \u003d _LE(\u0027Version %s is not supported\u0027) % version"},{"line_number":566,"context_line":"        LOG.error(msg)"},{"line_number":567,"context_line":"        raise NotImplementedError(msg)"},{"line_number":568,"context_line":""},{"line_number":569,"context_line":""},{"line_number":570,"context_line":"def _extract_attributes_v1(image, include_locations\u003dFalse):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_2ef30da0","line":567,"in_reply_to":"7a2fa921_a6052715","updated":"2015-10-14 19:47:28.000000000","message":"Done","commit_id":"721f4612e5ff36a29e4f4a19adbc0f82bfb48b0e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"25d0a0450f1fabb4a9e9b188f4e3fbc90a4af743","unresolved":false,"context_lines":[{"line_number":618,"context_line":"    properties \u003d raw_schema.get(\u0027properties\u0027, {})"},{"line_number":619,"context_line":"    output \u003d {\u0027properties\u0027: {}, \u0027deleted\u0027: False, \u0027deleted_at\u0027: None}"},{"line_number":620,"context_line":"    for name, _ in six.iteritems(properties):"},{"line_number":621,"context_line":"        if name in omit_attrs \\"},{"line_number":622,"context_line":"                or name in include_locations_attrs and not include_locations:"},{"line_number":623,"context_line":"            continue"},{"line_number":624,"context_line":"        elif not schema.is_base_property(name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_a80df538","line":621,"updated":"2015-10-13 00:38:43.000000000","message":"please use () so that we do not need \\\nif (name in omit_attrs or\n    name in include_locations_attrs ...):","commit_id":"721f4612e5ff36a29e4f4a19adbc0f82bfb48b0e"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"09302f1e39f34399b8d375279ab6cfff4c3bd549","unresolved":false,"context_lines":[{"line_number":618,"context_line":"    properties \u003d raw_schema.get(\u0027properties\u0027, {})"},{"line_number":619,"context_line":"    output \u003d {\u0027properties\u0027: {}, \u0027deleted\u0027: False, \u0027deleted_at\u0027: None}"},{"line_number":620,"context_line":"    for name, _ in six.iteritems(properties):"},{"line_number":621,"context_line":"        if name in omit_attrs \\"},{"line_number":622,"context_line":"                or name in include_locations_attrs and not include_locations:"},{"line_number":623,"context_line":"            continue"},{"line_number":624,"context_line":"        elif not schema.is_base_property(name):"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_4eee89b5","line":621,"in_reply_to":"7a2fa921_a80df538","updated":"2015-10-14 19:47:28.000000000","message":"Done","commit_id":"721f4612e5ff36a29e4f4a19adbc0f82bfb48b0e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"25d0a0450f1fabb4a9e9b188f4e3fbc90a4af743","unresolved":false,"context_lines":[{"line_number":625,"context_line":"            if hasattr(image, name):"},{"line_number":626,"context_line":"                output[\u0027properties\u0027][name] \u003d getattr(image, name)"},{"line_number":627,"context_line":"        elif name \u003d\u003d \u0027visibility\u0027:"},{"line_number":628,"context_line":"            output[\u0027is_public\u0027] \u003d True \\"},{"line_number":629,"context_line":"                if getattr(image, name) \u003d\u003d \u0027public\u0027 else False"},{"line_number":630,"context_line":"        elif name \u003d\u003d \u0027tags\u0027:"},{"line_number":631,"context_line":"            # TODO(mfedosin): decide if we need to include tags"}],"source_content_type":"text/x-python","patch_set":5,"id":"7a2fa921_68103d4f","line":628,"updated":"2015-10-13 00:38:43.000000000","message":"ditto\n\nconsider:\noutput[\u0027is_public\u0027] \u003d getattr(image, name) \u003d\u003d \u0027public\u0027","commit_id":"721f4612e5ff36a29e4f4a19adbc0f82bfb48b0e"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"09302f1e39f34399b8d375279ab6cfff4c3bd549","unresolved":false,"context_lines":[{"line_number":625,"context_line":"            if hasattr(image, name):"},{"line_number":626,"context_line":"                output[\u0027properties\u0027][name] \u003d getattr(image, name)"},{"line_number":627,"context_line":"        elif name \u003d\u003d \u0027visibility\u0027:"},{"line_number":628,"context_line":"            output[\u0027is_public\u0027] \u003d True \\"},{"line_number":629,"context_line":"                if getattr(image, name) \u003d\u003d \u0027public\u0027 else False"},{"line_number":630,"context_line":"        elif name \u003d\u003d \u0027tags\u0027:"},{"line_number":631,"context_line":"            # TODO(mfedosin): decide if we need to include tags"}],"source_content_type":"text/x-python","patch_set":5,"id":"5a2ca52d_8e3b4138","line":628,"in_reply_to":"7a2fa921_68103d4f","updated":"2015-10-14 19:47:28.000000000","message":"Done, thanks :)","commit_id":"721f4612e5ff36a29e4f4a19adbc0f82bfb48b0e"},{"author":{"_account_id":1653,"name":"garyk","email":"gkotton@vmware.com","username":"garyk"},"change_message_id":"fc403cbbc3f8d9031c2e20b99c4182b011a48ff5","unresolved":false,"context_lines":[{"line_number":568,"context_line":"    elif version \u003d\u003d \u00271\u0027:"},{"line_number":569,"context_line":"        return _extract_attributes_v1(image, include_locations)"},{"line_number":570,"context_line":"    else:"},{"line_number":571,"context_line":"        msg \u003d _LE(\u0027Version %s is not supported\u0027)"},{"line_number":572,"context_line":"        LOG.error(msg, version)"},{"line_number":573,"context_line":"        raise NotImplementedError(_(\u0027Version %s is not supported\u0027) % version)"},{"line_number":574,"context_line":""}],"source_content_type":"text/x-python","patch_set":14,"id":"3a29b11f_0fee968b","line":571,"updated":"2015-10-18 11:02:11.000000000","message":"LOG.error(_LE(\u0027Version %s is not supported\u0027))\nthen no need for the variable","commit_id":"a644895f9f0e433b220f1315585099800cec4336"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"20b51f7c2e52067c3fd681240396360a00453be0","unresolved":false,"context_lines":[{"line_number":626,"context_line":"        elif name \u003d\u003d \u0027tags\u0027:"},{"line_number":627,"context_line":"            # TODO(mfedosin): decide if we need to include tags"},{"line_number":628,"context_line":"            # in output or not."},{"line_number":629,"context_line":"            # Currently we omit them to get full equality with v1."},{"line_number":630,"context_line":"            pass"},{"line_number":631,"context_line":"        elif schema.is_base_property(name):"},{"line_number":632,"context_line":"            output[name] \u003d value"}],"source_content_type":"text/x-python","patch_set":15,"id":"3a29b11f_cf80e98d","line":629,"updated":"2015-10-22 05:44:06.000000000","message":"The same should be done with virtual_size, which is actually useful","commit_id":"4b7189eb49afb4c740c17bf5a2590f30dadf36bf"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3b897a4cf656fa1be3551a8c5ee3733b5bfa3e24","unresolved":false,"context_lines":[{"line_number":610,"context_line":"    output[\u0027properties\u0027] \u003d getattr(image, \u0027properties\u0027, {})"},{"line_number":611,"context_line":"    if include_locations:"},{"line_number":612,"context_line":"        # It\u0027s done for backward compatibility. V1 doesn\u0027t support including"},{"line_number":613,"context_line":"        # locations in output."},{"line_number":614,"context_line":"        output[\u0027direct_url\u0027] \u003d output[\u0027locations\u0027] \u003d None"},{"line_number":615,"context_line":""},{"line_number":616,"context_line":"    return output"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba8a016a_861f3707","line":613,"updated":"2015-11-18 23:12:13.000000000","message":"What backwards compatibility is referred to here? You are correct that Glance v1 API doesn\u0027t support the direct_uri or locations image properties, then why would we ever return these keys in the dictionary result from the method?","commit_id":"d83f38c88d813c06a32b53fc4a96999abb830df7"},{"author":{"_account_id":2750,"name":"Sean Dague","email":"sean@dague.net","username":"sdague"},"change_message_id":"fca3525d8612aa987737c211e9ea040630b57414","unresolved":false,"context_lines":[{"line_number":614,"context_line":"    return output"},{"line_number":615,"context_line":""},{"line_number":616,"context_line":""},{"line_number":617,"context_line":"def _extract_attributes_schema_based(image, include_locations\u003dFalse):"},{"line_number":618,"context_line":"    include_locations_attrs \u003d [\u0027direct_url\u0027, \u0027locations\u0027]"},{"line_number":619,"context_line":"    omit_attrs \u003d [\u0027self\u0027, \u0027schema\u0027, \u0027protected\u0027, \u0027virtual_size\u0027, \u0027file\u0027,"},{"line_number":620,"context_line":"                  \u0027tags\u0027]"}],"source_content_type":"text/x-python","patch_set":18,"id":"5a710552_ab59135c","line":617,"updated":"2015-12-16 12:54:13.000000000","message":"this so feels like this shouldn\u0027t be in Nova. This is really deep information about glance, it should be in glanceclient or better yet in glance itself.","commit_id":"2d3dd198d2961c832983cd29ebc0d8aa1aabd770"}],"nova/tests/unit/image/test_glance.py":[{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"c3644f14fc8bd0be89ab9f621ecdd944263c0535","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        \u0027size\u0027: 25165824,"},{"line_number":213,"context_line":"        \u0027status\u0027: \u0027active\u0027,"},{"line_number":214,"context_line":"        \u0027updated_at\u0027: \u00272015-08-31T19:37:45Z\u0027},"},{"line_number":215,"context_line":"    \u0027active_image_v2\u0027: {"},{"line_number":216,"context_line":"        \u0027checksum\u0027: \u0027eb9139e4942121f22bbc2afc0400b2a4\u0027,"},{"line_number":217,"context_line":"        \u0027container_format\u0027: \u0027ami\u0027,"},{"line_number":218,"context_line":"        \u0027created_at\u0027: \u00272015-08-31T19:37:41Z\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_a6a86b21","line":215,"updated":"2015-10-08 07:34:38.000000000","message":"One of the issues I faced in my previous attempt was that the image format between v1 and v2 are different (as you know already). We should probably make the v2 format compatible with v1 to begin with. Once we get this working, we can start making other parts of nova support the new format.","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"ce05ce242d0be93e1c30ab1c533183d98c0e1205","unresolved":false,"context_lines":[{"line_number":212,"context_line":"        \u0027size\u0027: 25165824,"},{"line_number":213,"context_line":"        \u0027status\u0027: \u0027active\u0027,"},{"line_number":214,"context_line":"        \u0027updated_at\u0027: \u00272015-08-31T19:37:45Z\u0027},"},{"line_number":215,"context_line":"    \u0027active_image_v2\u0027: {"},{"line_number":216,"context_line":"        \u0027checksum\u0027: \u0027eb9139e4942121f22bbc2afc0400b2a4\u0027,"},{"line_number":217,"context_line":"        \u0027container_format\u0027: \u0027ami\u0027,"},{"line_number":218,"context_line":"        \u0027created_at\u0027: \u00272015-08-31T19:37:41Z\u0027,"}],"source_content_type":"text/x-python","patch_set":4,"id":"7a2fa921_eea87179","line":215,"in_reply_to":"7a2fa921_a6a86b21","updated":"2015-10-08 11:37:11.000000000","message":"bah, nevermind. The patch is doing exactly what I asked to do. I must have been sleeping when I reviewed this.","commit_id":"ac9c2123378ea0690088585349fc9dedf95fe998"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3b897a4cf656fa1be3551a8c5ee3733b5bfa3e24","unresolved":false,"context_lines":[{"line_number":39,"context_line":""},{"line_number":40,"context_line":"NOW_DATETIME \u003d datetime.datetime(2010, 10, 11, 10, 30, 22, tzinfo\u003dtzinfo())"},{"line_number":41,"context_line":""},{"line_number":42,"context_line":"raw_schema \u003d {"},{"line_number":43,"context_line":"    \u0027additionalProperties\u0027: {\u0027type\u0027: \u0027string\u0027},"},{"line_number":44,"context_line":"    \u0027links\u0027: ["},{"line_number":45,"context_line":"        {\u0027href\u0027: \u0027{self}\u0027, \u0027rel\u0027: \u0027self\u0027},"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba8a016a_26c20b35","line":42,"updated":"2015-11-18 23:12:13.000000000","message":"This schema should not be reproduced from glance\u0027s code base.\n\nThe only thing the glanceclient.v2.schemas.Schema class is being used for is the is_base_property() method, so just return a mock.MagicMock() object from glanceclient.v2.schema.Schema.__init__ that contains an is_base_property() method that acts according to the expectations needed. The idea is to minimize the amount of code in glanceclient that we are testing in these unit tests.","commit_id":"d83f38c88d813c06a32b53fc4a96999abb830df7"},{"author":{"_account_id":7,"name":"Jay Pipes","email":"jaypipes@gmail.com","username":"jaypipes"},"change_message_id":"3b897a4cf656fa1be3551a8c5ee3733b5bfa3e24","unresolved":false,"context_lines":[{"line_number":318,"context_line":""},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"class ImageV2(dict):"},{"line_number":321,"context_line":"    schema \u003d raw_schema"},{"line_number":322,"context_line":""},{"line_number":323,"context_line":""},{"line_number":324,"context_line":"class TestConversions(test.NoDBTestCase):"}],"source_content_type":"text/x-python","patch_set":16,"id":"ba8a016a_66fa5377","line":321,"updated":"2015-11-18 23:12:13.000000000","message":"Why is this necessary?","commit_id":"d83f38c88d813c06a32b53fc4a96999abb830df7"},{"author":{"_account_id":11391,"name":"Mikhail Fedosin","email":"mfedosin@redhat.com","username":"fedosinme"},"change_message_id":"ae492b28637fdcd090637727e383587ea5fb8a1e","unresolved":false,"context_lines":[{"line_number":54,"context_line":"        self.assertEqual(result[\u0027updated_at\u0027], NOW_DATETIME)"},{"line_number":55,"context_line":"        self.assertEqual(result[\u0027deleted_at\u0027], NOW_DATETIME)"},{"line_number":56,"context_line":""},{"line_number":57,"context_line":"    def _test_extracting_missing_attributes(self, include_locations):"},{"line_number":58,"context_line":"        # Verify behavior from glance objects that are missing attributes"},{"line_number":59,"context_line":"        # TODO(jaypipes): Find a better way of testing this crappy"},{"line_number":60,"context_line":"        #                 glanceclient magic object stuff."}],"source_content_type":"text/x-python","patch_set":17,"id":"9a8ffd7b_b5975b8f","side":"PARENT","line":57,"updated":"2015-11-25 14:27:49.000000000","message":"These tests were removed, because the logic was implemented in \ntest_extract_image_attributes_active_images_(no/with)_locations.\n\nHere it tests v1 with locations and checks that \u0027locations\u0027 and \u0027direct_url\u0027 is None if we call \u0027_extract_attributes\u0027 with \u0027include_locations \u003d True\u0027, which is wrong, because v1 doesn\u0027t have the ability to include locations.","commit_id":"20eb06fb0cbb7dc0ef8a4d5ce92dd9c8723f3250"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"19fe89bc2a1719c27221247f966a5a14c3871d5e","unresolved":false,"context_lines":[{"line_number":41,"context_line":"NOW_DATETIME \u003d datetime.datetime(2010, 10, 11, 10, 30, 22, tzinfo\u003dtzinfo())"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class FakeSchema(object):"},{"line_number":45,"context_line":"    def __init__(self, raw_schema):"},{"line_number":46,"context_line":"        self.raw_schema \u003d raw_schema"},{"line_number":47,"context_line":"        self.base_props \u003d (\u0027checksum\u0027, \u0027container_format\u0027, \u0027created_at\u0027,"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a740942_ab517364","line":44,"updated":"2015-12-03 20:45:05.000000000","message":"Does this need to be defined on the Nova side?  It\u0027s bugging me that the tests are dependent on this matching the schema that\u0027s actually going to be used from glanceclient.  In other words why is schemas.Schema being mocked out?","commit_id":"2d3dd198d2961c832983cd29ebc0d8aa1aabd770"},{"author":{"_account_id":6159,"name":"Flavio Percoco Premoli","display_name":"flaper87","email":"flavio.percoco@flyrlabs.com","username":"flaper87"},"change_message_id":"b8c5f241fbe8b9b41398d4177c3d55ef3d717820","unresolved":false,"context_lines":[{"line_number":41,"context_line":"NOW_DATETIME \u003d datetime.datetime(2010, 10, 11, 10, 30, 22, tzinfo\u003dtzinfo())"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class FakeSchema(object):"},{"line_number":45,"context_line":"    def __init__(self, raw_schema):"},{"line_number":46,"context_line":"        self.raw_schema \u003d raw_schema"},{"line_number":47,"context_line":"        self.base_props \u003d (\u0027checksum\u0027, \u0027container_format\u0027, \u0027created_at\u0027,"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a740942_f2ab7273","line":44,"in_reply_to":"7a740942_ab517364","updated":"2015-12-07 16:45:25.000000000","message":"It\u0027s being mocked out because this change focuses on making the returned v2 schema complaint with the current supported v1 schema in nova.\n\nMany of this changes will go into glanceclient and they are being put here temporarily while the changes in glanceclient land and they are also released. We did this with the \"version discovery\" call and we\u0027ve released a glanceclient version containing it.\n\nhope this makes sense.","commit_id":"2d3dd198d2961c832983cd29ebc0d8aa1aabd770"},{"author":{"_account_id":5441,"name":"Andrew Laski","email":"andrew@lascii.com","username":"alaski"},"change_message_id":"82913a119ccb726eeddacc37fb35745e76bdf978","unresolved":false,"context_lines":[{"line_number":41,"context_line":"NOW_DATETIME \u003d datetime.datetime(2010, 10, 11, 10, 30, 22, tzinfo\u003dtzinfo())"},{"line_number":42,"context_line":""},{"line_number":43,"context_line":""},{"line_number":44,"context_line":"class FakeSchema(object):"},{"line_number":45,"context_line":"    def __init__(self, raw_schema):"},{"line_number":46,"context_line":"        self.raw_schema \u003d raw_schema"},{"line_number":47,"context_line":"        self.base_props \u003d (\u0027checksum\u0027, \u0027container_format\u0027, \u0027created_at\u0027,"}],"source_content_type":"text/x-python","patch_set":18,"id":"7a740942_498c14da","line":44,"in_reply_to":"7a740942_f2ab7273","updated":"2015-12-07 19:31:04.000000000","message":"Sure.  But these tests are only asserting that the v1 schema matches this fake schema here.  If glanceclient.v2.schemas.Schema differs from this then when someone runs this they\u0027ll find that the v2 schema doesn\u0027t actually match the v1 schema and the unit tests didn\u0027t catch that.  That\u0027s my concern.  These tests don\u0027t assure me that the schema is actually going to match.","commit_id":"2d3dd198d2961c832983cd29ebc0d8aa1aabd770"}]}
