)]}'
{"nova/image/glance.py":[{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"37e15097d4327050e7756a448cb2b687ae0024bc","unresolved":false,"context_lines":[{"line_number":967,"context_line":"        elif attr \u003d\u003d \u0027size\u0027:"},{"line_number":968,"context_line":"            # NOTE(mriedem): A snapshot image may not have the size attribute"},{"line_number":969,"context_line":"            # set so default to 0."},{"line_number":970,"context_line":"            output[attr] \u003d getattr(image, attr, 0) or 0"},{"line_number":971,"context_line":"        else:"},{"line_number":972,"context_line":"            # NOTE(xarses): Anything that is caught with the default value"},{"line_number":973,"context_line":"            # will result in an additional lookup to glance for said attr."}],"source_content_type":"text/x-python","patch_set":1,"id":"dada55a8_fb3c84c9","line":970,"range":{"start_line":970,"start_character":51,"end_line":970,"end_character":55},"updated":"2016-07-27 13:35:10.000000000","message":"Is this an artifact of the unit tests returning None? It sounds like because of the comment you put in the test, this shouldn\u0027t be here, because None is invalid. I guess it isn\u0027t doing anything, but it may be covering up other problems.","commit_id":"0b6acb024cb1484cc1962373071849c3b70829c3"},{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"a01b3c370380fafbff314357ee5fd943e2d8ec6d","unresolved":false,"context_lines":[{"line_number":967,"context_line":"        elif attr \u003d\u003d \u0027size\u0027:"},{"line_number":968,"context_line":"            # NOTE(mriedem): A snapshot image may not have the size attribute"},{"line_number":969,"context_line":"            # set so default to 0."},{"line_number":970,"context_line":"            output[attr] \u003d getattr(image, attr, 0) or 0"},{"line_number":971,"context_line":"        else:"},{"line_number":972,"context_line":"            # NOTE(xarses): Anything that is caught with the default value"},{"line_number":973,"context_line":"            # will result in an additional lookup to glance for said attr."}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_4bbb190f","line":970,"range":{"start_line":970,"start_character":51,"end_line":970,"end_character":55},"in_reply_to":"bacf61ea_e808132b","updated":"2016-07-27 14:15:46.000000000","message":"So None and not set are both valid cases. See my comment in the test.","commit_id":"0b6acb024cb1484cc1962373071849c3b70829c3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c5e7f1fea15d3eb71871e11997e4cf68a654f018","unresolved":false,"context_lines":[{"line_number":967,"context_line":"        elif attr \u003d\u003d \u0027size\u0027:"},{"line_number":968,"context_line":"            # NOTE(mriedem): A snapshot image may not have the size attribute"},{"line_number":969,"context_line":"            # set so default to 0."},{"line_number":970,"context_line":"            output[attr] \u003d getattr(image, attr, 0) or 0"},{"line_number":971,"context_line":"        else:"},{"line_number":972,"context_line":"            # NOTE(xarses): Anything that is caught with the default value"},{"line_number":973,"context_line":"            # will result in an additional lookup to glance for said attr."}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_e808132b","line":970,"range":{"start_line":970,"start_character":51,"end_line":970,"end_character":55},"in_reply_to":"dada55a8_fb3c84c9","updated":"2016-07-27 13:52:48.000000000","message":"So None could happen I suppose, the compute API could set image_meta[\u0027size\u0027] \u003d None (or 0) as another fix for this bug, but then we\u0027re baking that logic into the compute API for glance v1 and we might not be using glance v1, so I opted to fix it here.\n\nThe \"or 0\" was just becaues of mdorman\u0027s fix before, see the note above:\n\n\"# NOTE(mdorman): \u0027size\u0027 attribute must not be \u0027None\u0027, so use 0 instead\"\n\nMy feeling is this worked (somehow) before the glance v2 support for nova and then was regressed, but I\u0027m not sure how since we didn\u0027t flip that switch in the CI testing until the end of the series.","commit_id":"0b6acb024cb1484cc1962373071849c3b70829c3"}],"nova/tests/unit/image/test_glance.py":[{"author":{"_account_id":11803,"name":"Ryan Rossiter","email":"rlrossit@us.ibm.com","username":"rlrossiter"},"change_message_id":"a01b3c370380fafbff314357ee5fd943e2d8ec6d","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                raw \u003d dict.fromkeys(IMAGE_ATTRIBUTES)"},{"line_number":217,"context_line":"                # NOTE(mriedem): fromkeys defaults all values in the dict to"},{"line_number":218,"context_line":"                # None which is not correct for \u0027size\u0027 so pop that out."},{"line_number":219,"context_line":"                raw.pop(\u0027size\u0027)"},{"line_number":220,"context_line":"                raw.update(metadata)"},{"line_number":221,"context_line":"                self.__dict__[\u0027raw\u0027] \u003d raw"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_cb5c29f0","line":219,"range":{"start_line":219,"start_character":16,"end_line":219,"end_character":31},"updated":"2016-07-27 14:15:46.000000000","message":"so because None and not set are both valid, does that mean this pop is now removing testing against the None case? It seems like we should then be testing against both the None (don\u0027t pop) and the not set case (do pop).","commit_id":"0b6acb024cb1484cc1962373071849c3b70829c3"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"ef40976770b98c5688f4b3c7dc854d08908d4b27","unresolved":false,"context_lines":[{"line_number":216,"context_line":"                raw \u003d dict.fromkeys(IMAGE_ATTRIBUTES)"},{"line_number":217,"context_line":"                # NOTE(mriedem): fromkeys defaults all values in the dict to"},{"line_number":218,"context_line":"                # None which is not correct for \u0027size\u0027 so pop that out."},{"line_number":219,"context_line":"                raw.pop(\u0027size\u0027)"},{"line_number":220,"context_line":"                raw.update(metadata)"},{"line_number":221,"context_line":"                self.__dict__[\u0027raw\u0027] \u003d raw"},{"line_number":222,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"bacf61ea_2935fb45","line":219,"range":{"start_line":219,"start_character":16,"end_line":219,"end_character":31},"in_reply_to":"bacf61ea_cb5c29f0","updated":"2016-07-27 20:47:33.000000000","message":"Done","commit_id":"0b6acb024cb1484cc1962373071849c3b70829c3"}]}
