)]}'
{"cinder/image/image_utils.py":[{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"dae9fc4168515e4e4ab371ae4767a6cff19d5d59","unresolved":false,"context_lines":[{"line_number":323,"context_line":"        # raising an exception because of this."},{"line_number":324,"context_line":"        acceptable_formats \u003d [volume_format]"},{"line_number":325,"context_line":"        if volume_format \u003d\u003d \u0027vhd\u0027:"},{"line_number":326,"context_line":"            acceptable_formats +\u003d \u0027vpc\u0027"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"        if data.file_format not in acceptable_formats:"},{"line_number":329,"context_line":"            raise exception.ImageUnacceptable("}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_34e2bd03","line":326,"updated":"2015-03-05 21:36:08.000000000","message":"If i did\u0027t miss anything, this code won\u0027t work as expected:\n\n\u003e\u003e\u003e volume_format \u003d \u0027vhd\u0027\n\n\u003e\u003e\u003e acceptable_formats \u003d [volume_format]\n\n\u003e\u003e\u003e acceptable_formats +\u003d \u0027vpc\u0027\n\n\u003e\u003e\u003e acceptable_formats\n\n[\u0027vhd\u0027, \u0027v\u0027, \u0027p\u0027, \u0027c\u0027]\n\n\nPlease, add unit tests for it","commit_id":"213bba6d12fafa01dc68a54ccb3b585c6a7913e0"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"b62d59f30a317189a06567dd750fae86eca8c09a","unresolved":false,"context_lines":[{"line_number":323,"context_line":"        # raising an exception because of this."},{"line_number":324,"context_line":"        acceptable_formats \u003d [volume_format]"},{"line_number":325,"context_line":"        if volume_format \u003d\u003d \u0027vhd\u0027:"},{"line_number":326,"context_line":"            acceptable_formats +\u003d \u0027vpc\u0027"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"        if data.file_format not in acceptable_formats:"},{"line_number":329,"context_line":"            raise exception.ImageUnacceptable("}],"source_content_type":"text/x-python","patch_set":1,"id":"9a80dd14_a091f048","line":326,"in_reply_to":"9a80dd14_34e2bd03","updated":"2015-03-06 10:52:41.000000000","message":"You are right. I don\u0027t know why I\u0027ve switch from simply using append. I\u0027ll add an unit test for this.\n\nThanks a lot for pointing this out!","commit_id":"213bba6d12fafa01dc68a54ccb3b585c6a7913e0"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"0b2c94927a8e2babdcc93f5d4ca3cf763cb541e4","unresolved":false,"context_lines":[{"line_number":320,"context_line":""},{"line_number":321,"context_line":"        # qemu-img still uses the legacy \u0027vpc\u0027 name for the vhd format. Avoid"},{"line_number":322,"context_line":"        # raising an exception because of this."},{"line_number":323,"context_line":"        acceptable_formats \u003d [volume_format]"},{"line_number":324,"context_line":"        if volume_format \u003d\u003d \u0027vhd\u0027:"},{"line_number":325,"context_line":"            acceptable_formats.append(\u0027vpc\u0027)"},{"line_number":326,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"bab921fb_c321404f","line":323,"updated":"2015-04-23 22:55:31.000000000","message":"I\u0027m not sure I follow the create/append of the list here as opposed to just adding an explicit check.\n\nif volume_format \u003d\u003d \u0027vhd\u0027 and data.file_format \u003d\u003d \u0027vpc\u0027:\n    pass\nelif data.file_format !\u003d volume_format:\n    raise exception.ImageUnacceptable....\n\nEven better maybe a dedicated helper method to check formats?\n\ndef _validate_format(self, data, volume_format):\n    if data.file_format \u003d\u003d volume_format:\n        return True\n    elif data.file_format \u003d\u003d vhd:\n        return True\n    else:\n        return False\n......\n\nif not self._validate_format(data, volume_format):\n    raise xxxxxx\n\n.....\n\nIt just seems like we could be more explicit here, but maybe it\u0027s just me.","commit_id":"104f55652fc1899d357a061f1ddd61e852e500d3"},{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"5ce6b4984912e99ef03ebf74864d99b736e30290","unresolved":false,"context_lines":[{"line_number":322,"context_line":"        # raising an exception because of this."},{"line_number":323,"context_line":"        acceptable_formats \u003d [volume_format]"},{"line_number":324,"context_line":"        if volume_format \u003d\u003d \u0027vhd\u0027:"},{"line_number":325,"context_line":"            acceptable_formats.append(\u0027vpc\u0027)"},{"line_number":326,"context_line":""},{"line_number":327,"context_line":"        if data.file_format not in acceptable_formats:"},{"line_number":328,"context_line":"            raise exception.ImageUnacceptable("}],"source_content_type":"text/x-python","patch_set":7,"id":"bab921fb_ed5898fc","line":325,"updated":"2015-04-24 10:23:24.000000000","message":"Agreed with John. Appending a new acceptable format based on if, makes things a bit confusing here.","commit_id":"104f55652fc1899d357a061f1ddd61e852e500d3"}],"cinder/tests/test_image_utils.py":[{"author":{"_account_id":13900,"name":"Accela Zhao","email":"accelazh@gmail.com","username":"accelazh"},"change_message_id":"28630856788a3cadc206da100f2b03a95be8f79f","unresolved":false,"context_lines":[{"line_number":945,"context_line":"        image_service \u003d mock.Mock()"},{"line_number":946,"context_line":"        image_id \u003d mock.sentinel.image_id"},{"line_number":947,"context_line":"        dest \u003d mock.sentinel.dest"},{"line_number":948,"context_line":"        volume_format \u003d \u0027vhd\u0027"},{"line_number":949,"context_line":"        blocksize \u003d mock.sentinel.blocksize"},{"line_number":950,"context_line":"        user_id \u003d mock.sentinel.user_id"},{"line_number":951,"context_line":"        project_id \u003d mock.sentinel.project_id"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa041b7_047a84f1","line":948,"updated":"2015-04-03 13:53:33.000000000","message":"Can volume_format be other types?","commit_id":"828cae5ce1eee33d1791c661d263556f9b49219a"},{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"9d8c3edcdcd8a926cb8ce21660aeb096f1903e57","unresolved":false,"context_lines":[{"line_number":945,"context_line":"        image_service \u003d mock.Mock()"},{"line_number":946,"context_line":"        image_id \u003d mock.sentinel.image_id"},{"line_number":947,"context_line":"        dest \u003d mock.sentinel.dest"},{"line_number":948,"context_line":"        volume_format \u003d \u0027vhd\u0027"},{"line_number":949,"context_line":"        blocksize \u003d mock.sentinel.blocksize"},{"line_number":950,"context_line":"        user_id \u003d mock.sentinel.user_id"},{"line_number":951,"context_line":"        project_id \u003d mock.sentinel.project_id"}],"source_content_type":"text/x-python","patch_set":6,"id":"baa041b7_df07c57f","line":948,"in_reply_to":"baa041b7_047a84f1","updated":"2015-04-03 14:12:26.000000000","message":"Sure. I\u0027ve used \u0027vhd\u0027 in this test helper to make it easier to test the case when although the format names are not the same, they are equivalent (one is the legacy name of the same format) as well as the case when there trully is a format mismatch.\n\nAt the moment, as far as I know, the only format having this naming issue is vhd (vpc being the \"legacy\" name).","commit_id":"828cae5ce1eee33d1791c661d263556f9b49219a"}]}
