)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"ea145f68947bb33d449438afe9bd941cef231822","unresolved":false,"context_lines":[{"line_number":33,"context_line":"2. image_volume_type   (via glance image metadata)"},{"line_number":34,"context_line":"3. default_volume_type (via cinder.conf)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"DocImpact"},{"line_number":37,"context_line":"Change-Id: I62f02d817d84d3a7b651db36d7297299b1af2fe3"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da6ed579_d7feac6a","line":36,"updated":"2016-01-12 22:53:53.000000000","message":"In general we\u0027ve been pretty bad about this, but could you add some text after DocImpact to let the docs team know what needs to be added to the documentation?","commit_id":"65218cd5165c71d6b053f7da4275c8af7bbaebcf"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"38151c13b3fd2f288a5e599d5b9d01990ccbc818","unresolved":false,"context_lines":[{"line_number":33,"context_line":"2. image_volume_type   (via glance image metadata)"},{"line_number":34,"context_line":"3. default_volume_type (via cinder.conf)"},{"line_number":35,"context_line":""},{"line_number":36,"context_line":"DocImpact"},{"line_number":37,"context_line":"Change-Id: I62f02d817d84d3a7b651db36d7297299b1af2fe3"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":3,"id":"da6ed579_a5f97e82","line":36,"in_reply_to":"da6ed579_d7feac6a","updated":"2016-01-13 00:02:01.000000000","message":"Done","commit_id":"65218cd5165c71d6b053f7da4275c8af7bbaebcf"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"ab33223b44fd66e7850d1a35b7f6c8dc9535b0a3","unresolved":false,"context_lines":[{"line_number":14,"context_line":"to boot a VMware instance from an image, this image has to"},{"line_number":15,"context_line":"be configured some VMware specific parameters in previous,"},{"line_number":16,"context_line":"and then Nova can deploy an instance on to proper hypervisor"},{"line_number":17,"context_line":"based on the image metadata perperties."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Currently, Cinder handles few image metadata properties but"},{"line_number":20,"context_line":"volume type is not included. If volume type can be retrieved"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"da6ed579_22253fc0","line":17,"range":{"start_line":17,"start_character":28,"end_line":17,"end_character":38},"updated":"2016-01-14 01:24:08.000000000","message":"s/perperties/properties","commit_id":"da76a1913b76cc8ba0ae6c3edd4c93dafd1b65b8"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"7c08cea7eb9437c1cc68d1e2c093a393e1d3467d","unresolved":false,"context_lines":[{"line_number":14,"context_line":"to boot a VMware instance from an image, this image has to"},{"line_number":15,"context_line":"be configured some VMware specific parameters in previous,"},{"line_number":16,"context_line":"and then Nova can deploy an instance on to proper hypervisor"},{"line_number":17,"context_line":"based on the image metadata perperties."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"Currently, Cinder handles few image metadata properties but"},{"line_number":20,"context_line":"volume type is not included. If volume type can be retrieved"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":5,"id":"da6ed579_1b3ae6cc","line":17,"range":{"start_line":17,"start_character":28,"end_line":17,"end_character":38},"in_reply_to":"da6ed579_22253fc0","updated":"2016-01-14 01:44:56.000000000","message":"Done","commit_id":"da76a1913b76cc8ba0ae6c3edd4c93dafd1b65b8"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"cbdf6b64c61c21fbddf3ea2aeedd74e6cc0d0e9d","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patch adds a feature to specify Cinder volume type"},{"line_number":10,"context_line":"via cinder_img_volume_type parameter in glance image metadata."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Is some cases, between image and hypervisor, storage backend"},{"line_number":13,"context_line":"are tightly connected in each other. For example, if user want"},{"line_number":14,"context_line":"to boot a VMware instance from an image, this image has to"},{"line_number":15,"context_line":"be configured some VMware specific parameters in previous,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"9a68dd71_242106fc","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":2},"updated":"2016-01-21 16:14:16.000000000","message":"Is -\u003e In","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"c4f93b9169dc5e77fdc3545a672e8863ac971bdc","unresolved":false,"context_lines":[{"line_number":9,"context_line":"This patch adds a feature to specify Cinder volume type"},{"line_number":10,"context_line":"via cinder_img_volume_type parameter in glance image metadata."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Is some cases, between image and hypervisor, storage backend"},{"line_number":13,"context_line":"are tightly connected in each other. For example, if user want"},{"line_number":14,"context_line":"to boot a VMware instance from an image, this image has to"},{"line_number":15,"context_line":"be configured some VMware specific parameters in previous,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"9a68dd71_e07d04e8","line":12,"range":{"start_line":12,"start_character":0,"end_line":12,"end_character":2},"in_reply_to":"9a68dd71_242106fc","updated":"2016-01-21 23:46:18.000000000","message":"Done","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"cbdf6b64c61c21fbddf3ea2aeedd74e6cc0d0e9d","unresolved":false,"context_lines":[{"line_number":10,"context_line":"via cinder_img_volume_type parameter in glance image metadata."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Is some cases, between image and hypervisor, storage backend"},{"line_number":13,"context_line":"are tightly connected in each other. For example, if user want"},{"line_number":14,"context_line":"to boot a VMware instance from an image, this image has to"},{"line_number":15,"context_line":"be configured some VMware specific parameters in previous,"},{"line_number":16,"context_line":"and then Nova can deploy an instance on to proper hypervisor"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"9a68dd71_4473da15","line":13,"range":{"start_line":13,"start_character":53,"end_line":13,"end_character":57},"updated":"2016-01-21 16:14:16.000000000","message":"user -\u003e users","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"c4f93b9169dc5e77fdc3545a672e8863ac971bdc","unresolved":false,"context_lines":[{"line_number":10,"context_line":"via cinder_img_volume_type parameter in glance image metadata."},{"line_number":11,"context_line":""},{"line_number":12,"context_line":"Is some cases, between image and hypervisor, storage backend"},{"line_number":13,"context_line":"are tightly connected in each other. For example, if user want"},{"line_number":14,"context_line":"to boot a VMware instance from an image, this image has to"},{"line_number":15,"context_line":"be configured some VMware specific parameters in previous,"},{"line_number":16,"context_line":"and then Nova can deploy an instance on to proper hypervisor"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":10,"id":"9a68dd71_808448d4","line":13,"range":{"start_line":13,"start_character":53,"end_line":13,"end_character":57},"in_reply_to":"9a68dd71_4473da15","updated":"2016-01-21 23:46:18.000000000","message":"Done","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"}],"cinder/tests/unit/volume/flows/test_create_volume_flow.py":[{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"2f7b5c6dbd8c108364609453df2d48a8cf90eab6","unresolved":false,"context_lines":[{"line_number":471,"context_line":"    @mock.patch(\u0027cinder.volume.flows.api.create_volume.\u0027"},{"line_number":472,"context_line":"                \u0027ExtractVolumeRequestTask.\u0027"},{"line_number":473,"context_line":"                \u0027_get_volume_type_id\u0027)"},{"line_number":474,"context_line":"    def test_extract_image_volume_type_from_image_no_properties("},{"line_number":475,"context_line":"            self,"},{"line_number":476,"context_line":"            fake_get_type_id,"},{"line_number":477,"context_line":"            fake_get_def_vol_type,"}],"source_content_type":"text/x-python","patch_set":12,"id":"9a68dd71_f115b83f","line":474,"updated":"2016-01-22 13:24:29.000000000","message":"The only difference between this test and the next one is  image_properties value. We can combine these two tests into a single test using python ddt. We would need to add one more decorator: \n\n@ddt.data(None, {\u0027cinder_volume_type\u0027: None}) and assign it to fake_img_properties and set image_meta[\u0027properties\u0027] \u003d fake_img_properties.","commit_id":"21a3a4607924e3f96aea6cfd59ce344808ba2c70"}],"cinder/volume/flows/api/create_volume.py":[{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"ea145f68947bb33d449438afe9bd941cef231822","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        # check whether image is active"},{"line_number":236,"context_line":"        if image_meta[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":237,"context_line":"            msg \u003d _(\u0027Image %(image_id)s is not active.\u0027)\\"},{"line_number":238,"context_line":"                % {\u0027image_id\u0027: image_id}"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_f7ead0ab","line":237,"range":{"start_line":237,"start_character":53,"end_line":237,"end_character":57},"updated":"2016-01-12 22:53:53.000000000","message":"Please wrap in () to avoid using \\ for line continuation.","commit_id":"65218cd5165c71d6b053f7da4275c8af7bbaebcf"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"38151c13b3fd2f288a5e599d5b9d01990ccbc818","unresolved":false,"context_lines":[{"line_number":234,"context_line":""},{"line_number":235,"context_line":"        # check whether image is active"},{"line_number":236,"context_line":"        if image_meta[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":237,"context_line":"            msg \u003d _(\u0027Image %(image_id)s is not active.\u0027)\\"},{"line_number":238,"context_line":"                % {\u0027image_id\u0027: image_id}"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"da6ed579_85eebab2","line":237,"range":{"start_line":237,"start_character":53,"end_line":237,"end_character":57},"in_reply_to":"da6ed579_f7ead0ab","updated":"2016-01-13 00:02:01.000000000","message":"Done","commit_id":"65218cd5165c71d6b053f7da4275c8af7bbaebcf"},{"author":{"_account_id":14274,"name":"XinXiaohui","email":"xiaohui.xin@intel.com","username":"XinXiaohui"},"change_message_id":"ab33223b44fd66e7850d1a35b7f6c8dc9535b0a3","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # Check image existence"},{"line_number":230,"context_line":"        if image_id is None:"},{"line_number":231,"context_line":"            return"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        image_meta \u003d self.image_service.show(context, image_id)"},{"line_number":234,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da6ed579_18e74c12","line":231,"range":{"start_line":231,"start_character":12,"end_line":231,"end_character":18},"updated":"2016-01-14 01:24:08.000000000","message":"Here, to be consistent, should return the same value as line 255?","commit_id":"da76a1913b76cc8ba0ae6c3edd4c93dafd1b65b8"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"7c08cea7eb9437c1cc68d1e2c093a393e1d3467d","unresolved":false,"context_lines":[{"line_number":228,"context_line":""},{"line_number":229,"context_line":"        # Check image existence"},{"line_number":230,"context_line":"        if image_id is None:"},{"line_number":231,"context_line":"            return"},{"line_number":232,"context_line":""},{"line_number":233,"context_line":"        image_meta \u003d self.image_service.show(context, image_id)"},{"line_number":234,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"da6ed579_5b237ea7","line":231,"range":{"start_line":231,"start_character":12,"end_line":231,"end_character":18},"in_reply_to":"da6ed579_18e74c12","updated":"2016-01-14 01:44:56.000000000","message":"Done","commit_id":"da76a1913b76cc8ba0ae6c3edd4c93dafd1b65b8"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"9f99a62205bea4ab442dc690d753f7c3c54ba085","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                   {\u0027image_id\u0027: image_id})"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        # Retrieve \u0027cinder_img_volume_type\u0027 property from glance image mtadata."},{"line_number":242,"context_line":"        image_volume_type \u003d \"cinder_img_volume_type\""},{"line_number":243,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":244,"context_line":"        if properties and properties.get(image_volume_type):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_d781ccfc","line":241,"range":{"start_line":241,"start_character":71,"end_line":241,"end_character":78},"updated":"2016-01-18 12:44:15.000000000","message":"s/mtadata/metadata","commit_id":"bd141c9a53b8545f4047580ab162a6570fde3683"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"3f0a4330cd14fa50540d10e2564623ff3ad8f6ed","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                   {\u0027image_id\u0027: image_id})"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        # Retrieve \u0027cinder_img_volume_type\u0027 property from glance image mtadata."},{"line_number":242,"context_line":"        image_volume_type \u003d \"cinder_img_volume_type\""},{"line_number":243,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":244,"context_line":"        if properties and properties.get(image_volume_type):"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_c2225aa3","line":241,"range":{"start_line":241,"start_character":71,"end_line":241,"end_character":78},"in_reply_to":"da6ed579_d781ccfc","updated":"2016-01-18 16:12:10.000000000","message":"If I need an update, will fix","commit_id":"bd141c9a53b8545f4047580ab162a6570fde3683"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"9f99a62205bea4ab442dc690d753f7c3c54ba085","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        # volume upon creation and propagate that information to each snapshot."},{"line_number":424,"context_line":"        # This strategy avoids any dependency upon the encrypted volume type."},{"line_number":425,"context_line":"        def_vol_type \u003d volume_types.get_default_volume_type()"},{"line_number":426,"context_line":"        image_volume_type \u003d self._get_image_volume_type(context, image_id)"},{"line_number":427,"context_line":"        if not volume_type and not source_volume and not snapshot:"},{"line_number":428,"context_line":"            volume_type \u003d (image_volume_type if image_volume_type else"},{"line_number":429,"context_line":"                           def_vol_type)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_17a1a4a9","line":426,"range":{"start_line":426,"start_character":0,"end_line":426,"end_character":74},"updated":"2016-01-18 12:44:15.000000000","message":"Wouldn\u0027t it be better to move this line into the if to save us an unnecessary call to Glance API?","commit_id":"bd141c9a53b8545f4047580ab162a6570fde3683"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"c163471fc4f5d0317da1e950cfeb43a470340f28","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        # volume upon creation and propagate that information to each snapshot."},{"line_number":424,"context_line":"        # This strategy avoids any dependency upon the encrypted volume type."},{"line_number":425,"context_line":"        def_vol_type \u003d volume_types.get_default_volume_type()"},{"line_number":426,"context_line":"        image_volume_type \u003d self._get_image_volume_type(context, image_id)"},{"line_number":427,"context_line":"        if not volume_type and not source_volume and not snapshot:"},{"line_number":428,"context_line":"            volume_type \u003d (image_volume_type if image_volume_type else"},{"line_number":429,"context_line":"                           def_vol_type)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba63e191_c55cedef","line":426,"range":{"start_line":426,"start_character":0,"end_line":426,"end_character":74},"in_reply_to":"ba63e191_0ef1cfcd","updated":"2016-01-18 20:09:33.000000000","message":"I understand. We can avoid the situation in order to move calling _get_image_volume_type under following if. Thanks.","commit_id":"bd141c9a53b8545f4047580ab162a6570fde3683"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"3f0a4330cd14fa50540d10e2564623ff3ad8f6ed","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        # volume upon creation and propagate that information to each snapshot."},{"line_number":424,"context_line":"        # This strategy avoids any dependency upon the encrypted volume type."},{"line_number":425,"context_line":"        def_vol_type \u003d volume_types.get_default_volume_type()"},{"line_number":426,"context_line":"        image_volume_type \u003d self._get_image_volume_type(context, image_id)"},{"line_number":427,"context_line":"        if not volume_type and not source_volume and not snapshot:"},{"line_number":428,"context_line":"            volume_type \u003d (image_volume_type if image_volume_type else"},{"line_number":429,"context_line":"                           def_vol_type)"}],"source_content_type":"text/x-python","patch_set":6,"id":"da6ed579_a2088629","line":426,"range":{"start_line":426,"start_character":0,"end_line":426,"end_character":74},"in_reply_to":"da6ed579_17a1a4a9","updated":"2016-01-18 16:12:10.000000000","message":"Hi Michal,\n\nThank you for your comment.\n\nIf the image_id is None, _get_image_volume_type() returns None at the first, therefore I think unnecessary call to Glance API doesn\u0027t happen here. Am I missing something?","commit_id":"bd141c9a53b8545f4047580ab162a6570fde3683"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"5cb8a69b8c880cd392317b10531b732068c4815c","unresolved":false,"context_lines":[{"line_number":423,"context_line":"        # volume upon creation and propagate that information to each snapshot."},{"line_number":424,"context_line":"        # This strategy avoids any dependency upon the encrypted volume type."},{"line_number":425,"context_line":"        def_vol_type \u003d volume_types.get_default_volume_type()"},{"line_number":426,"context_line":"        image_volume_type \u003d self._get_image_volume_type(context, image_id)"},{"line_number":427,"context_line":"        if not volume_type and not source_volume and not snapshot:"},{"line_number":428,"context_line":"            volume_type \u003d (image_volume_type if image_volume_type else"},{"line_number":429,"context_line":"                           def_vol_type)"}],"source_content_type":"text/x-python","patch_set":6,"id":"ba63e191_0ef1cfcd","line":426,"range":{"start_line":426,"start_character":0,"end_line":426,"end_character":74},"in_reply_to":"da6ed579_a2088629","updated":"2016-01-18 17:25:16.000000000","message":"What if both `image_id` and `volume_type` are set? Then we do an API call to Glance, result of which we discard right away.\n\nIs it\u0027s impossible to set both of these?","commit_id":"bd141c9a53b8545f4047580ab162a6570fde3683"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"e4cbad5ffa980b9cc5fd78d0fd86452de3c6c0d2","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                   {\u0027image_id\u0027: image_id})"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        # Retrieve \u0027cinder_img_volume_type\u0027 property from glance image mtadata."},{"line_number":242,"context_line":"        image_volume_type \u003d \"cinder_img_volume_type\""},{"line_number":243,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":244,"context_line":"        if properties and properties.get(image_volume_type):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_18a1f194","line":241,"range":{"start_line":241,"start_character":71,"end_line":241,"end_character":78},"updated":"2016-01-19 08:51:45.000000000","message":"Metadata typo. ;)","commit_id":"9c2a5408529963309f03b31c73e9252a0dad8e43"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"c6fba655cdb2fa28135d8816fe1cb33bcf1df123","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                   {\u0027image_id\u0027: image_id})"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        # Retrieve \u0027cinder_img_volume_type\u0027 property from glance image mtadata."},{"line_number":242,"context_line":"        image_volume_type \u003d \"cinder_img_volume_type\""},{"line_number":243,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":244,"context_line":"        if properties and properties.get(image_volume_type):"}],"source_content_type":"text/x-python","patch_set":7,"id":"ba63e191_e7b6a33c","line":241,"range":{"start_line":241,"start_character":71,"end_line":241,"end_character":78},"in_reply_to":"ba63e191_18a1f194","updated":"2016-01-19 15:48:53.000000000","message":"Done :)","commit_id":"9c2a5408529963309f03b31c73e9252a0dad8e43"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"534ce9cf79455565dad02ac776e5849dc27cd809","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                   {\u0027image_id\u0027: image_id})"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        # Retrieve \u0027cinder_img_volume_type\u0027 property from glance image metadata."},{"line_number":242,"context_line":"        image_volume_type \u003d \"cinder_img_volume_type\""},{"line_number":243,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":244,"context_line":"        if properties and properties.get(image_volume_type):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba63e191_fc09462d","line":241,"range":{"start_line":241,"start_character":8,"end_line":241,"end_character":80},"updated":"2016-01-19 20:26:54.000000000","message":"Aww, now this line is too long, rechecking won\u0027t help with pep8 check. :(","commit_id":"4f1b5c7d54190c4ab55eb79708ae522827abb3f8"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"9028c793e00f38f6fd5ebc86667154de576a0a6b","unresolved":false,"context_lines":[{"line_number":238,"context_line":"                   {\u0027image_id\u0027: image_id})"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        # Retrieve \u0027cinder_img_volume_type\u0027 property from glance image metadata."},{"line_number":242,"context_line":"        image_volume_type \u003d \"cinder_img_volume_type\""},{"line_number":243,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":244,"context_line":"        if properties and properties.get(image_volume_type):"}],"source_content_type":"text/x-python","patch_set":8,"id":"ba63e191_1c453a16","line":241,"range":{"start_line":241,"start_character":8,"end_line":241,"end_character":80},"in_reply_to":"ba63e191_fc09462d","updated":"2016-01-19 20:31:42.000000000","message":"Ah,,, I forgot pep8,","commit_id":"4f1b5c7d54190c4ab55eb79708ae522827abb3f8"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"36e523bf226b99b037ad59810d055b1d742c1084","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":245,"context_line":"        if properties and properties.get(image_volume_type):"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                img_vol_type \u003d properties.get(image_volume_type)"},{"line_number":248,"context_line":"                volume_type \u003d volume_types.get_volume_type_by_name("},{"line_number":249,"context_line":"                    context,"},{"line_number":250,"context_line":"                    img_vol_type)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba63e191_c8291d39","line":247,"range":{"start_line":247,"start_character":63,"end_line":247,"end_character":64},"updated":"2016-01-19 21:33:48.000000000","message":"As far as I can see, properties.get(image_volume_type) will run twice, Line 245 and 247.\nPlease try to merge it into one, e.g. use another variable to save properties.get(image_volume_type). That is my suggestion.","commit_id":"7c382be67047e6256c5adfd4e417ed302e90d8a7"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"036ae8b62a37ec357e46ddb2c3381abbee67a348","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":245,"context_line":"        if properties and properties.get(image_volume_type):"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                img_vol_type \u003d properties.get(image_volume_type)"},{"line_number":248,"context_line":"                volume_type \u003d volume_types.get_volume_type_by_name("},{"line_number":249,"context_line":"                    context,"},{"line_number":250,"context_line":"                    img_vol_type)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_b3d023cb","line":247,"range":{"start_line":247,"start_character":63,"end_line":247,"end_character":64},"in_reply_to":"9a68dd71_56dd1a6f","updated":"2016-01-20 14:36:11.000000000","message":"Hi Duncan,\n\nThank you for the explanation. I understand this might cause racy state and should avoid this kind of usage.\n\nVincent, Thanks.","commit_id":"7c382be67047e6256c5adfd4e417ed302e90d8a7"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"1771eb149f25b9238b7afc3ad826036009b77250","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":245,"context_line":"        if properties and properties.get(image_volume_type):"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                img_vol_type \u003d properties.get(image_volume_type)"},{"line_number":248,"context_line":"                volume_type \u003d volume_types.get_volume_type_by_name("},{"line_number":249,"context_line":"                    context,"},{"line_number":250,"context_line":"                    img_vol_type)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba63e191_36d7f6ee","line":247,"range":{"start_line":247,"start_character":63,"end_line":247,"end_character":64},"in_reply_to":"ba63e191_16f2f2d2","updated":"2016-01-19 22:31:58.000000000","message":"In that case, we will get LOG.warning if the image_volume_type is none. But it is not a warning case, just image doesn\u0027t have image_volume_type in the metadata. We need to return None quietly if image_volume_type is none.","commit_id":"7c382be67047e6256c5adfd4e417ed302e90d8a7"},{"author":{"_account_id":1207,"name":"Duncan Thomas","email":"duncan.thomas@gmail.com","username":"duncan-thomas"},"change_message_id":"dd025919d82a14ce78113f62c394a22b630d1e33","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":245,"context_line":"        if properties and properties.get(image_volume_type):"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                img_vol_type \u003d properties.get(image_volume_type)"},{"line_number":248,"context_line":"                volume_type \u003d volume_types.get_volume_type_by_name("},{"line_number":249,"context_line":"                    context,"},{"line_number":250,"context_line":"                    img_vol_type)"}],"source_content_type":"text/x-python","patch_set":9,"id":"9a68dd71_56dd1a6f","line":247,"range":{"start_line":247,"start_character":63,"end_line":247,"end_character":64},"in_reply_to":"ba63e191_36d7f6ee","updated":"2016-01-20 13:24:19.000000000","message":"So you want something like:\n\nif properties:\n    try:\n        img_vol_type \u003d properties.get(image_volume_type)\n        if img_vol_type is None:\n            return None\n\nCalling properties.get twice definitely seems wrong (and conceivably racy at some point in future)","commit_id":"7c382be67047e6256c5adfd4e417ed302e90d8a7"},{"author":{"_account_id":2861,"name":"Vincent Hou","email":"shou@us.ibm.com","username":"houshengbo"},"change_message_id":"78b9157b6bf024fedab368adc6d22241df9bd39c","unresolved":false,"context_lines":[{"line_number":244,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":245,"context_line":"        if properties and properties.get(image_volume_type):"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                img_vol_type \u003d properties.get(image_volume_type)"},{"line_number":248,"context_line":"                volume_type \u003d volume_types.get_volume_type_by_name("},{"line_number":249,"context_line":"                    context,"},{"line_number":250,"context_line":"                    img_vol_type)"}],"source_content_type":"text/x-python","patch_set":9,"id":"ba63e191_16f2f2d2","line":247,"range":{"start_line":247,"start_character":63,"end_line":247,"end_character":64},"in_reply_to":"ba63e191_c8291d39","updated":"2016-01-19 22:20:26.000000000","message":"if properties:\n    try:\n        volume_type \u003d volume_types.get_volume_type_by_name(\n                    context,       properties.get(image_volume_type))\n\nThis is my suggestion. Welcome comments from others. Thank you.","commit_id":"7c382be67047e6256c5adfd4e417ed302e90d8a7"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"3f58ac91c9703e09b4af858d0b6a2a69be909279","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        if image_meta[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":237,"context_line":"            msg \u003d (_(\u0027Image %(image_id)s is not active.\u0027) %"},{"line_number":238,"context_line":"                   {\u0027image_id\u0027: image_id})"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        # Retrieve \u0027cinder_img_volume_type\u0027 property from glance image"},{"line_number":242,"context_line":"        # metadata."}],"source_content_type":"text/x-python","patch_set":10,"id":"9a68dd71_92ba87e0","line":239,"updated":"2016-01-21 10:16:37.000000000","message":"Do we need a unit test for this case?","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"c4f93b9169dc5e77fdc3545a672e8863ac971bdc","unresolved":false,"context_lines":[{"line_number":236,"context_line":"        if image_meta[\u0027status\u0027] !\u003d \u0027active\u0027:"},{"line_number":237,"context_line":"            msg \u003d (_(\u0027Image %(image_id)s is not active.\u0027) %"},{"line_number":238,"context_line":"                   {\u0027image_id\u0027: image_id})"},{"line_number":239,"context_line":"            raise exception.InvalidInput(reason\u003dmsg)"},{"line_number":240,"context_line":""},{"line_number":241,"context_line":"        # Retrieve \u0027cinder_img_volume_type\u0027 property from glance image"},{"line_number":242,"context_line":"        # metadata."}],"source_content_type":"text/x-python","patch_set":10,"id":"9a68dd71_80368850","line":239,"in_reply_to":"9a68dd71_92ba87e0","updated":"2016-01-21 23:46:18.000000000","message":"Done","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"3f58ac91c9703e09b4af858d0b6a2a69be909279","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        # metadata."},{"line_number":243,"context_line":"        image_volume_type \u003d \"cinder_img_volume_type\""},{"line_number":244,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":245,"context_line":"        if properties:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                img_vol_type \u003d properties.get(image_volume_type)"},{"line_number":248,"context_line":"                if img_vol_type is None:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a68dd71_327abb25","line":245,"updated":"2016-01-21 10:16:37.000000000","message":"Do we need a unit test for the else part?","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"c4f93b9169dc5e77fdc3545a672e8863ac971bdc","unresolved":false,"context_lines":[{"line_number":242,"context_line":"        # metadata."},{"line_number":243,"context_line":"        image_volume_type \u003d \"cinder_img_volume_type\""},{"line_number":244,"context_line":"        properties \u003d image_meta.get(\u0027properties\u0027)"},{"line_number":245,"context_line":"        if properties:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                img_vol_type \u003d properties.get(image_volume_type)"},{"line_number":248,"context_line":"                if img_vol_type is None:"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a68dd71_a0394c43","line":245,"in_reply_to":"9a68dd71_327abb25","updated":"2016-01-21 23:46:18.000000000","message":"Done","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"3f58ac91c9703e09b4af858d0b6a2a69be909279","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        if properties:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                img_vol_type \u003d properties.get(image_volume_type)"},{"line_number":248,"context_line":"                if img_vol_type is None:"},{"line_number":249,"context_line":"                    return None"},{"line_number":250,"context_line":"                volume_type \u003d volume_types.get_volume_type_by_name("},{"line_number":251,"context_line":"                    context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a68dd71_32c87b55","line":248,"updated":"2016-01-21 10:16:37.000000000","message":"Do we need a unit test for this case?","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"},{"author":{"_account_id":10115,"name":"Mitsuhiro Tanino","email":"mitsuhiro.tanino@lycorp.co.jp","username":"mtanino"},"change_message_id":"c4f93b9169dc5e77fdc3545a672e8863ac971bdc","unresolved":false,"context_lines":[{"line_number":245,"context_line":"        if properties:"},{"line_number":246,"context_line":"            try:"},{"line_number":247,"context_line":"                img_vol_type \u003d properties.get(image_volume_type)"},{"line_number":248,"context_line":"                if img_vol_type is None:"},{"line_number":249,"context_line":"                    return None"},{"line_number":250,"context_line":"                volume_type \u003d volume_types.get_volume_type_by_name("},{"line_number":251,"context_line":"                    context,"}],"source_content_type":"text/x-python","patch_set":10,"id":"9a68dd71_404170a8","line":248,"in_reply_to":"9a68dd71_32c87b55","updated":"2016-01-21 23:46:18.000000000","message":"Done","commit_id":"ee9a2d4c93b6101c2d663ad30a6d9be2a7798cd3"}]}
