)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"dc20c7bb4c24b1b9562e30939f7d1103728bda4b","unresolved":false,"context_lines":[{"line_number":14,"context_line":"In addition, _create_image function is to create disk file when it\u0027s not exist, but config-drive file is not"},{"line_number":15,"context_line":"do this judgment."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"Change-Id: I50cdd5bac0f201f3f378e42b36f2284a4e2603bf"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":1,"id":"7af24918_24f1b26b","line":17,"updated":"2016-03-04 10:06:53.000000000","message":"The commit message doesn\u0027t fit the structure we are aiming\nfor. Please read [1] and change it accordingly.\n\n[1] https://wiki.openstack.org/wiki/GitCommitMessages#Summary_of_Git_commit_message_structure","commit_id":"f8238c90290ffc532ef67a224fa9cff011cefbff"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"35d6fa83f43c2786e8a3880ef295973b6c585c75","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zte-hanrong \u003chan.rong3@zte.com.cn\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-03-05 07:53:17 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix the content of \"disk.config\" lost after migrate/resize"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"1. cdrom disk\u0027s format is raw, it named \"disk.config\" in nova,"},{"line_number":10,"context_line":" and CONF.use_cow_images is true. When in finish_migration"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5aef4532_cf3529db","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":58},"updated":"2016-03-08 09:15:36.000000000","message":"better to add libvirt prefix.","commit_id":"fee715955f958b0d4be89a3fef074e7f187e5968"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"168823fde3d0dce60c6c346b0d7247a888202ac0","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     zte-hanrong \u003chan.rong3@zte.com.cn\u003e"},{"line_number":5,"context_line":"CommitDate: 2016-03-05 07:53:17 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Fix the content of \"disk.config\" lost after migrate/resize"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"1. cdrom disk\u0027s format is raw, it named \"disk.config\" in nova,"},{"line_number":10,"context_line":" and CONF.use_cow_images is true. When in finish_migration"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"5aef4532_2de90b15","line":7,"range":{"start_line":7,"start_character":0,"end_line":7,"end_character":58},"in_reply_to":"5aef4532_cf3529db","updated":"2016-03-09 02:01:39.000000000","message":"Done","commit_id":"fee715955f958b0d4be89a3fef074e7f187e5968"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6c1fce26677991c30cf69449bbcaa49d39f88c42","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"libvirt: Fix the content of \"disk.config\" lost after migrate/resize"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"_create_image function is due to create a disk file when it\u0027s not"},{"line_number":10,"context_line":"exist, but config-drive file has not done this judgment. As a result,"},{"line_number":11,"context_line":"when it is invoked in finish_migration function, it create a new"},{"line_number":12,"context_line":"empty disk.config file which take place of the original disk.config."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"5aef4532_a7d15825","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":56},"updated":"2016-03-10 12:16:24.000000000","message":"you could just explain that create_image doesn\u0027t check if an existing configdrive is there, so as a result, blah...","commit_id":"cde45973d64f34e6521c98cfb28e1c32bd9db96b"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"f80326388eb317610d77103a6c3fbba24f7e80e8","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"libvirt: Fix the content of \"disk.config\" lost after migrate/resize"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"_create_image function is due to create a disk file when it\u0027s not"},{"line_number":10,"context_line":"exist, but config-drive file has not done this judgment. As a result,"},{"line_number":11,"context_line":"when it is invoked in finish_migration function, it create a new"},{"line_number":12,"context_line":"empty disk.config file which take place of the original disk.config."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"fa0719c6_8e340bdf","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":56},"in_reply_to":"5aef4532_a7d15825","updated":"2016-03-20 13:39:29.000000000","message":"Done","commit_id":"cde45973d64f34e6521c98cfb28e1c32bd9db96b"},{"author":{"_account_id":12440,"name":"lingchen1314","email":"lingchen1314@gmail.com","username":"lingchen"},"change_message_id":"5991a810524f702676323e3bec0150318f63d080","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"libvirt: Fix the content of \"disk.config\" lost after migrate/resize"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"_create_image doesn\u0027t check if an existing configdrive is there."},{"line_number":10,"context_line":"As a result, when it is invoked in finish_migration function, it"},{"line_number":11,"context_line":"create a new empty disk.config file which take place of the original"},{"line_number":12,"context_line":"disk.config."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7aa08908_88db32ed","line":9,"range":{"start_line":9,"start_character":42,"end_line":9,"end_character":54},"updated":"2016-06-06 07:42:03.000000000","message":"should be config drive","commit_id":"216e1c1e0d3a64474194b13777b9fb86b2e93314"}],"nova/tests/unit/virt/libvirt/test_driver.py":[{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"35d6fa83f43c2786e8a3880ef295973b6c585c75","unresolved":false,"context_lines":[{"line_number":9467,"context_line":"        def fake_none(*args, **kwargs):"},{"line_number":9468,"context_line":"            return"},{"line_number":9469,"context_line":""},{"line_number":9470,"context_line":"        self.stubs.Set(os.path, \u0027exists\u0027, fake_path_exists)"},{"line_number":9471,"context_line":"        self.stubs.Set(instance_metadata, \u0027InstanceMetadata\u0027, fake_none)"},{"line_number":9472,"context_line":"        self.stubs.Set("},{"line_number":9473,"context_line":"            nova.virt.libvirt.imagebackend.Image, \u0027cache\u0027, fake_none)"},{"line_number":9474,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_af19bd7b","line":9471,"range":{"start_line":9470,"start_character":0,"end_line":9471,"end_character":72},"updated":"2016-03-08 09:15:36.000000000","message":"hi, can you use mock to rewrite this?","commit_id":"fee715955f958b0d4be89a3fef074e7f187e5968"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"168823fde3d0dce60c6c346b0d7247a888202ac0","unresolved":false,"context_lines":[{"line_number":9467,"context_line":"        def fake_none(*args, **kwargs):"},{"line_number":9468,"context_line":"            return"},{"line_number":9469,"context_line":""},{"line_number":9470,"context_line":"        self.stubs.Set(os.path, \u0027exists\u0027, fake_path_exists)"},{"line_number":9471,"context_line":"        self.stubs.Set(instance_metadata, \u0027InstanceMetadata\u0027, fake_none)"},{"line_number":9472,"context_line":"        self.stubs.Set("},{"line_number":9473,"context_line":"            nova.virt.libvirt.imagebackend.Image, \u0027cache\u0027, fake_none)"},{"line_number":9474,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_0dbb6f0f","line":9471,"range":{"start_line":9470,"start_character":0,"end_line":9471,"end_character":72},"in_reply_to":"5aef4532_af19bd7b","updated":"2016-03-09 02:01:39.000000000","message":"Done","commit_id":"fee715955f958b0d4be89a3fef074e7f187e5968"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"e725b8fd69c5550dee057b0faac853c124ea384f","unresolved":false,"context_lines":[{"line_number":9457,"context_line":"        drvr.image_backend.image.return_value \u003d drvr.image_backend"},{"line_number":9458,"context_line":"        instance \u003d objects.Instance(**self.test_instance)"},{"line_number":9459,"context_line":"        instance.task_state \u003d task_states.RESIZE_FINISH"},{"line_number":9460,"context_line":"        instance.config_drive \u003d \u0027true\u0027"},{"line_number":9461,"context_line":"        image_meta \u003d objects.ImageMeta.from_dict(self.test_image_meta)"},{"line_number":9462,"context_line":"        disk_info \u003d blockinfo.get_disk_info(CONF.libvirt.virt_type,"},{"line_number":9463,"context_line":"                                            instance,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_5030709e","line":9460,"range":{"start_line":9460,"start_character":32,"end_line":9460,"end_character":38},"updated":"2016-03-09 02:38:15.000000000","message":"True","commit_id":"78503a2e187e1cfeaee91156d867cd9c23111c1d"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"4a5d92b13139fa6f46cec1c7d6439d7477f889ca","unresolved":false,"context_lines":[{"line_number":9457,"context_line":"        drvr.image_backend.image.return_value \u003d drvr.image_backend"},{"line_number":9458,"context_line":"        instance \u003d objects.Instance(**self.test_instance)"},{"line_number":9459,"context_line":"        instance.task_state \u003d task_states.RESIZE_FINISH"},{"line_number":9460,"context_line":"        instance.config_drive \u003d \u0027true\u0027"},{"line_number":9461,"context_line":"        image_meta \u003d objects.ImageMeta.from_dict(self.test_image_meta)"},{"line_number":9462,"context_line":"        disk_info \u003d blockinfo.get_disk_info(CONF.libvirt.virt_type,"},{"line_number":9463,"context_line":"                                            instance,"}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_9b105903","line":9460,"range":{"start_line":9460,"start_character":32,"end_line":9460,"end_character":38},"in_reply_to":"5aef4532_5030709e","updated":"2016-03-09 03:15:33.000000000","message":"Done","commit_id":"78503a2e187e1cfeaee91156d867cd9c23111c1d"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"e725b8fd69c5550dee057b0faac853c124ea384f","unresolved":false,"context_lines":[{"line_number":9470,"context_line":""},{"line_number":9471,"context_line":"        mock_exist.side_effect \u003d fake_path_exists"},{"line_number":9472,"context_line":""},{"line_number":9473,"context_line":"        with mock.patch.object(nova.virt.configdrive.ConfigDriveBuilder,"},{"line_number":9474,"context_line":"                               \u0027make_drive\u0027) as mock_make_drive:"},{"line_number":9475,"context_line":"            drvr._create_image(self.context, instance, disk_info[\u0027mapping\u0027])"},{"line_number":9476,"context_line":"            mock_make_drive.assert_not_called()"},{"line_number":9477,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_101708ee","line":9474,"range":{"start_line":9473,"start_character":0,"end_line":9474,"end_character":64},"updated":"2016-03-09 02:38:15.000000000","message":"this can be a decorator, move to line 9453","commit_id":"78503a2e187e1cfeaee91156d867cd9c23111c1d"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"4a5d92b13139fa6f46cec1c7d6439d7477f889ca","unresolved":false,"context_lines":[{"line_number":9470,"context_line":""},{"line_number":9471,"context_line":"        mock_exist.side_effect \u003d fake_path_exists"},{"line_number":9472,"context_line":""},{"line_number":9473,"context_line":"        with mock.patch.object(nova.virt.configdrive.ConfigDriveBuilder,"},{"line_number":9474,"context_line":"                               \u0027make_drive\u0027) as mock_make_drive:"},{"line_number":9475,"context_line":"            drvr._create_image(self.context, instance, disk_info[\u0027mapping\u0027])"},{"line_number":9476,"context_line":"            mock_make_drive.assert_not_called()"},{"line_number":9477,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"5aef4532_dbfae1bc","line":9474,"range":{"start_line":9473,"start_character":0,"end_line":9474,"end_character":64},"in_reply_to":"5aef4532_101708ee","updated":"2016-03-09 03:15:33.000000000","message":"Done","commit_id":"78503a2e187e1cfeaee91156d867cd9c23111c1d"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6c1fce26677991c30cf69449bbcaa49d39f88c42","unresolved":false,"context_lines":[{"line_number":9451,"context_line":"    @mock.patch.object(nova.virt.libvirt.imagebackend.Image, \u0027cache\u0027)"},{"line_number":9452,"context_line":"    @mock.patch.object(instance_metadata, \u0027InstanceMetadata\u0027)"},{"line_number":9453,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027)"},{"line_number":9454,"context_line":"    def test_create_image_with_configdrive_and_config_disk_is_exist("},{"line_number":9455,"context_line":"            self, mock_exist, mock_instance_metadata, mock_image_cache,"},{"line_number":9456,"context_line":"            mock_make_drive):"},{"line_number":9457,"context_line":"        drvr \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)"}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_1c9b4319","line":9454,"range":{"start_line":9454,"start_character":59,"end_line":9454,"end_character":67},"updated":"2016-03-10 12:16:24.000000000","message":"nit: I would have said _and_config_drive_exists","commit_id":"cde45973d64f34e6521c98cfb28e1c32bd9db96b"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"a3bb5ca83354e4735c6fecc0685f92a43d87cef2","unresolved":false,"context_lines":[{"line_number":9451,"context_line":"    @mock.patch.object(nova.virt.libvirt.imagebackend.Image, \u0027cache\u0027)"},{"line_number":9452,"context_line":"    @mock.patch.object(instance_metadata, \u0027InstanceMetadata\u0027)"},{"line_number":9453,"context_line":"    @mock.patch.object(os.path, \u0027exists\u0027)"},{"line_number":9454,"context_line":"    def test_create_image_with_configdrive_and_config_disk_is_exist("},{"line_number":9455,"context_line":"            self, mock_exist, mock_instance_metadata, mock_image_cache,"},{"line_number":9456,"context_line":"            mock_make_drive):"},{"line_number":9457,"context_line":"        drvr \u003d libvirt_driver.LibvirtDriver(fake.FakeVirtAPI(), False)"}],"source_content_type":"text/x-python","patch_set":4,"id":"1af94dfe_d11bd4c8","line":9454,"range":{"start_line":9454,"start_character":59,"end_line":9454,"end_character":67},"in_reply_to":"5aef4532_1c9b4319","updated":"2016-03-20 13:35:53.000000000","message":"Done","commit_id":"cde45973d64f34e6521c98cfb28e1c32bd9db96b"},{"author":{"_account_id":7166,"name":"Sylvain Bauza","email":"sbauza@redhat.com","username":"sbauza"},"change_message_id":"6c1fce26677991c30cf69449bbcaa49d39f88c42","unresolved":false,"context_lines":[{"line_number":9466,"context_line":"                                            image_meta)"},{"line_number":9467,"context_line":""},{"line_number":9468,"context_line":"        def fake_path_exists(path_name):"},{"line_number":9469,"context_line":"            if path_name.endswith(\u0027/disk.config\u0027):"},{"line_number":9470,"context_line":"                return True"},{"line_number":9471,"context_line":"            return False"},{"line_number":9472,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"5aef4532_a7231855","line":9469,"range":{"start_line":9469,"start_character":35,"end_line":9469,"end_character":48},"updated":"2016-03-10 12:16:24.000000000","message":"I don\u0027t like this kind of string that could be modified later and which would need to modify this test in that case.\n\nSince os.path.exists() is only called once in _create_image(), you don\u0027t need to provide a side_effect method but just return True.","commit_id":"cde45973d64f34e6521c98cfb28e1c32bd9db96b"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"a3bb5ca83354e4735c6fecc0685f92a43d87cef2","unresolved":false,"context_lines":[{"line_number":9466,"context_line":"                                            image_meta)"},{"line_number":9467,"context_line":""},{"line_number":9468,"context_line":"        def fake_path_exists(path_name):"},{"line_number":9469,"context_line":"            if path_name.endswith(\u0027/disk.config\u0027):"},{"line_number":9470,"context_line":"                return True"},{"line_number":9471,"context_line":"            return False"},{"line_number":9472,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa0719c6_ee24a7b0","line":9469,"range":{"start_line":9469,"start_character":35,"end_line":9469,"end_character":48},"in_reply_to":"3afc51ec_56ce1484","updated":"2016-03-20 13:35:53.000000000","message":"Done","commit_id":"cde45973d64f34e6521c98cfb28e1c32bd9db96b"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"a3bb5ca83354e4735c6fecc0685f92a43d87cef2","unresolved":false,"context_lines":[{"line_number":9466,"context_line":"                                            image_meta)"},{"line_number":9467,"context_line":""},{"line_number":9468,"context_line":"        def fake_path_exists(path_name):"},{"line_number":9469,"context_line":"            if path_name.endswith(\u0027/disk.config\u0027):"},{"line_number":9470,"context_line":"                return True"},{"line_number":9471,"context_line":"            return False"},{"line_number":9472,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"fa0719c6_ce2563af","line":9469,"range":{"start_line":9469,"start_character":35,"end_line":9469,"end_character":48},"in_reply_to":"5aef4532_a7231855","updated":"2016-03-20 13:35:53.000000000","message":"Done","commit_id":"cde45973d64f34e6521c98cfb28e1c32bd9db96b"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"72cc8c7674ea22a8e7a963121cb5adb1d37c3f8d","unresolved":false,"context_lines":[{"line_number":9466,"context_line":"                                            image_meta)"},{"line_number":9467,"context_line":""},{"line_number":9468,"context_line":"        def fake_path_exists(path_name):"},{"line_number":9469,"context_line":"            if path_name.endswith(\u0027/disk.config\u0027):"},{"line_number":9470,"context_line":"                return True"},{"line_number":9471,"context_line":"            return False"},{"line_number":9472,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"3afc51ec_56ce1484","line":9469,"range":{"start_line":9469,"start_character":35,"end_line":9469,"end_character":48},"in_reply_to":"5aef4532_a7231855","updated":"2016-03-11 12:48:32.000000000","message":"I completely agree with Sylvain that I don\u0027t like hardcoding this stuff all over the place. However we don\u0027t yet have an abstraction for people to use, so it\u0027s this or nothing. When we eventually fix this we\u0027re going to have to fix it methodically everywhere, so in the grand scheme this is a very small evil.\n\nUnconditionally return True has its own pitfalls, because the code might also be changed to have more than 1 call to os.path.exists.\n\nI\u0027m personally neutral on this. Neither solution is ideal, but they\u0027re both ok. I\u0027d probably personally err towards \u0027disk.config\u0027, because it\u0027s widely used and at least it\u0027s easy to grep if we ever fix it.","commit_id":"cde45973d64f34e6521c98cfb28e1c32bd9db96b"},{"author":{"_account_id":18247,"name":"Mark Doffman","email":"mdoffman@linux.vnet.ibm.com","username":"doffm"},"change_message_id":"bd10429f625ff3ab6a253cf71f413d029e153c7e","unresolved":false,"context_lines":[{"line_number":9467,"context_line":""},{"line_number":9468,"context_line":"        mock_exist.return_value \u003d True"},{"line_number":9469,"context_line":"        drvr._create_image(self.context, instance, disk_info[\u0027mapping\u0027])"},{"line_number":9470,"context_line":"        mock_make_drive.assert_not_called()"},{"line_number":9471,"context_line":""},{"line_number":9472,"context_line":"    @mock.patch.object(nova.virt.libvirt.imagebackend.Image, \u0027cache\u0027,"},{"line_number":9473,"context_line":"                       side_effect\u003dexception.ImageNotFound(image_id\u003d\u0027fake-id\u0027))"}],"source_content_type":"text/x-python","patch_set":5,"id":"9a061dce_30569a5c","line":9470,"updated":"2016-04-05 19:51:49.000000000","message":"The _create_image function is huge and messy. Could you convince me that the right code path is being tested? Possibly by asserting the \u0027os.exists\u0027 has been called?","commit_id":"9e339dc81a9e6d2f0625fbfde5f8c537a431ced3"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"6530849153ff65ce5be005055e22879ee551e6c1","unresolved":false,"context_lines":[{"line_number":9467,"context_line":""},{"line_number":9468,"context_line":"        mock_exist.return_value \u003d True"},{"line_number":9469,"context_line":"        drvr._create_image(self.context, instance, disk_info[\u0027mapping\u0027])"},{"line_number":9470,"context_line":"        mock_make_drive.assert_not_called()"},{"line_number":9471,"context_line":""},{"line_number":9472,"context_line":"    @mock.patch.object(nova.virt.libvirt.imagebackend.Image, \u0027cache\u0027,"},{"line_number":9473,"context_line":"                       side_effect\u003dexception.ImageNotFound(image_id\u003d\u0027fake-id\u0027))"}],"source_content_type":"text/x-python","patch_set":5,"id":"1a122d0e_18bc41ba","line":9470,"in_reply_to":"9a061dce_30569a5c","updated":"2016-04-26 08:51:17.000000000","message":"Added a judgment over the use of \u0027os.exists\u0027 with parameter of disk.config file.","commit_id":"9e339dc81a9e6d2f0625fbfde5f8c537a431ced3"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"c6b0da683a2725eeb8bf60a1de22ea6ad42bce8d","unresolved":false,"context_lines":[{"line_number":9637,"context_line":"        mock_make_drive.assert_not_called()"},{"line_number":9638,"context_line":"        mock_exist.assert_any_call("},{"line_number":9639,"context_line":"            os.path.join(libvirt_utils.get_instance_path(instance),"},{"line_number":9640,"context_line":"                         \u0027disk.config\u0027))"},{"line_number":9641,"context_line":""},{"line_number":9642,"context_line":"    @mock.patch.object(nova.virt.libvirt.imagebackend.Image, \u0027cache\u0027,"},{"line_number":9643,"context_line":"                       side_effect\u003dexception.ImageNotFound(image_id\u003d\u0027fake-id\u0027))"}],"source_content_type":"text/x-python","patch_set":7,"id":"9abb7d3a_005f100f","line":9640,"updated":"2016-06-02 18:04:02.000000000","message":"Can you add another test case to this to make sure that when os.exists() returns false that we _do_ create the configdrive? From inspection of the surrounding tests that _might_ already be covered, but it would be good to be explicit I think. You can probably just tack on another call to _create_image() right after this with a different mock_exist return value and be good.","commit_id":"3daff2a18bea24f2beb03517f7f0e68ed7330daa"}],"nova/virt/libvirt/driver.py":[{"author":{"_account_id":11303,"name":"Markus Zoeller (markus_z)","email":"mzoeller@linux.vnet.ibm.com","username":"mzoeller"},"change_message_id":"dc20c7bb4c24b1b9562e30939f7d1103728bda4b","unresolved":false,"context_lines":[{"line_number":3257,"context_line":"                         {\u0027path\u0027: configdrive_path}, instance\u003dinstance)"},{"line_number":3258,"context_line":""},{"line_number":3259,"context_line":"                try:"},{"line_number":3260,"context_line":"                    if not os.path.exists(configdrive_path):"},{"line_number":3261,"context_line":"                        cdb.make_drive(configdrive_path)"},{"line_number":3262,"context_line":"                except processutils.ProcessExecutionError as e:"},{"line_number":3263,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_a4578256","line":3260,"updated":"2016-03-04 10:06:53.000000000","message":"Please add a unit test for this.","commit_id":"f8238c90290ffc532ef67a224fa9cff011cefbff"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"eeace3c225133faaeca864cda35029da242c7495","unresolved":false,"context_lines":[{"line_number":3257,"context_line":"                         {\u0027path\u0027: configdrive_path}, instance\u003dinstance)"},{"line_number":3258,"context_line":""},{"line_number":3259,"context_line":"                try:"},{"line_number":3260,"context_line":"                    if not os.path.exists(configdrive_path):"},{"line_number":3261,"context_line":"                        cdb.make_drive(configdrive_path)"},{"line_number":3262,"context_line":"                except processutils.ProcessExecutionError as e:"},{"line_number":3263,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":1,"id":"7af24918_32726aae","line":3260,"in_reply_to":"7af24918_a4578256","updated":"2016-03-04 23:57:48.000000000","message":"I will add unit test for this, thanks.","commit_id":"f8238c90290ffc532ef67a224fa9cff011cefbff"},{"author":{"_account_id":5754,"name":"Alex Xu","email":"hejie.xu@intel.com","username":"xuhj"},"change_message_id":"e7b5361bc0fda0979b31311369fc5b2a24b94013","unresolved":false,"context_lines":[{"line_number":7340,"context_line":"                image \u003d imgmodel.LocalFileImage(info[\u0027path\u0027],"},{"line_number":7341,"context_line":"                                                info[\u0027type\u0027])"},{"line_number":7342,"context_line":"                self._disk_resize(image, size)"},{"line_number":7343,"context_line":"            if info[\u0027type\u0027] \u003d\u003d \u0027raw\u0027 and CONF.use_cow_images:"},{"line_number":7344,"context_line":"                self._disk_raw_to_qcow2(info[\u0027path\u0027])"},{"line_number":7345,"context_line":""},{"line_number":7346,"context_line":"        disk_info \u003d blockinfo.get_disk_info(CONF.libvirt.virt_type,"},{"line_number":7347,"context_line":"                                            instance,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_c4ab501c","side":"PARENT","line":7344,"range":{"start_line":7343,"start_character":12,"end_line":7344,"end_character":53},"updated":"2016-03-08 09:11:12.000000000","message":"I didn\u0027t find this two rows related to this bug","commit_id":"4b47b5b6c69a8f111a91ea1ff83d245c886923e7"},{"author":{"_account_id":12175,"name":"Eli Qiao","email":"qiaoliyong@gmail.com","username":"Eli"},"change_message_id":"35d6fa83f43c2786e8a3880ef295973b6c585c75","unresolved":false,"context_lines":[{"line_number":7340,"context_line":"                image \u003d imgmodel.LocalFileImage(info[\u0027path\u0027],"},{"line_number":7341,"context_line":"                                                info[\u0027type\u0027])"},{"line_number":7342,"context_line":"                self._disk_resize(image, size)"},{"line_number":7343,"context_line":"            if info[\u0027type\u0027] \u003d\u003d \u0027raw\u0027 and CONF.use_cow_images:"},{"line_number":7344,"context_line":"                self._disk_raw_to_qcow2(info[\u0027path\u0027])"},{"line_number":7345,"context_line":""},{"line_number":7346,"context_line":"        disk_info \u003d blockinfo.get_disk_info(CONF.libvirt.virt_type,"},{"line_number":7347,"context_line":"                                            instance,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_645a3c52","side":"PARENT","line":7344,"range":{"start_line":7343,"start_character":12,"end_line":7344,"end_character":53},"in_reply_to":"5aef4532_c4ab501c","updated":"2016-03-08 09:15:36.000000000","message":"+1 for alex","commit_id":"4b47b5b6c69a8f111a91ea1ff83d245c886923e7"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"168823fde3d0dce60c6c346b0d7247a888202ac0","unresolved":false,"context_lines":[{"line_number":7340,"context_line":"                image \u003d imgmodel.LocalFileImage(info[\u0027path\u0027],"},{"line_number":7341,"context_line":"                                                info[\u0027type\u0027])"},{"line_number":7342,"context_line":"                self._disk_resize(image, size)"},{"line_number":7343,"context_line":"            if info[\u0027type\u0027] \u003d\u003d \u0027raw\u0027 and CONF.use_cow_images:"},{"line_number":7344,"context_line":"                self._disk_raw_to_qcow2(info[\u0027path\u0027])"},{"line_number":7345,"context_line":""},{"line_number":7346,"context_line":"        disk_info \u003d blockinfo.get_disk_info(CONF.libvirt.virt_type,"},{"line_number":7347,"context_line":"                                            instance,"}],"source_content_type":"text/x-python","patch_set":2,"id":"5aef4532_6d5f93e5","side":"PARENT","line":7344,"range":{"start_line":7343,"start_character":12,"end_line":7344,"end_character":53},"in_reply_to":"5aef4532_c4ab501c","updated":"2016-03-09 02:01:39.000000000","message":"Done","commit_id":"4b47b5b6c69a8f111a91ea1ff83d245c886923e7"},{"author":{"_account_id":7730,"name":"Sahid Orentino Ferdjaoui","email":"sahid.ferdjaoui@industrialdiscipline.com","username":"sahid"},"change_message_id":"871cd7facbb9246960d2c3a1fa459d75875cb410","unresolved":false,"context_lines":[{"line_number":7350,"context_line":"        # qcow2 from host which uses raw."},{"line_number":7351,"context_line":"        # TODO(mbooth): Handle resize of multiple ephemeral disks, and"},{"line_number":7352,"context_line":"        #               ephemeral disks not called disk.local."},{"line_number":7353,"context_line":"        disk_info \u003d jsonutils.loads(disk_info)"},{"line_number":7354,"context_line":"        for info in disk_info:"},{"line_number":7355,"context_line":"            path \u003d info[\u0027path\u0027]"},{"line_number":7356,"context_line":"            disk_name \u003d os.path.basename(path)"}],"source_content_type":"text/x-python","patch_set":5,"id":"fa0719c6_3a156b9b","line":7353,"updated":"2016-03-24 12:09:29.000000000","message":"The the problem you are suffering is coming from here, we should to add confidion to only resize the root, first ephemeral and swap disk.\n\n  if path.endswith(\u0027disk\u0027) or \\\n     path.endswith(\u0027disk.root\u0027) or \\ \n     path.endswith(\u0027disk.swap\u0027):\n\nAt least so far we should just try to convert root disk and the first eph because it\u0027s not really clear how we handle resize so far.","commit_id":"9e339dc81a9e6d2f0625fbfde5f8c537a431ced3"},{"author":{"_account_id":12813,"name":"Rong Han","email":"han.rong3@zte.com.cn","username":"hanrong-zte"},"change_message_id":"3d024a3a313626967b950e6c6af21c9036f185ce","unresolved":false,"context_lines":[{"line_number":7350,"context_line":"        # qcow2 from host which uses raw."},{"line_number":7351,"context_line":"        # TODO(mbooth): Handle resize of multiple ephemeral disks, and"},{"line_number":7352,"context_line":"        #               ephemeral disks not called disk.local."},{"line_number":7353,"context_line":"        disk_info \u003d jsonutils.loads(disk_info)"},{"line_number":7354,"context_line":"        for info in disk_info:"},{"line_number":7355,"context_line":"            path \u003d info[\u0027path\u0027]"},{"line_number":7356,"context_line":"            disk_name \u003d os.path.basename(path)"}],"source_content_type":"text/x-python","patch_set":5,"id":"ba0121b8_c14a0683","line":7353,"in_reply_to":"fa0719c6_3a156b9b","updated":"2016-03-30 02:32:25.000000000","message":"Thank you for your suggestions.\nroot disk is named \u0027disk\u0027,\nfirst ephemeral is named \u0027disk.eph0\u0027, old version is \u0027disk.local\u0027\nswap is named \u0027disk.swap\u0027\n\nCurrently, we only resize this three kinds of disk by judging condition resize_instnace is true . So I think problem is not from here.\n\n        old_instance_type_id !\u003d new_instance_type_id:\n            instance_type \u003d instance.get_flavor(\u0027new\u0027)\n            self._set_instance_info(instance, instance_type)\n            for key in (\u0027root_gb\u0027, \u0027swap\u0027, \u0027ephemeral_gb\u0027):\n                if old_instance_type[key] !\u003d instance_type[key]:\n                    resize_instance \u003d True","commit_id":"9e339dc81a9e6d2f0625fbfde5f8c537a431ced3"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"7d4672154da1ef96bd35e31cf681c90e7ac033cc","unresolved":false,"context_lines":[{"line_number":2960,"context_line":"                         {\u0027path\u0027: configdrive_path}, instance\u003dinstance)"},{"line_number":2961,"context_line":""},{"line_number":2962,"context_line":"                try:"},{"line_number":2963,"context_line":"                    if not os.path.exists(configdrive_path):"},{"line_number":2964,"context_line":"                        cdb.make_drive(configdrive_path)"},{"line_number":2965,"context_line":"                except processutils.ProcessExecutionError as e:"},{"line_number":2966,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":8,"id":"9abb7d3a_70c5e93b","line":2963,"updated":"2016-06-03 08:43:18.000000000","message":"This isn\u0027t going to catch config drives on Rbd because they will exist in Rbd but not on the filesystem (note that configdrive_path is deleted below for Rbd). Rbd config drives would still be double imported.\n\nWe can keep the idea, though. If we promote the config_drive_image object from below up here (but not the import), we can do:\n\n  if config_drive_image.exists():\n    ...\n\nhere instead. This will behave correctly for both Rbd and Flat.\n\nNote that we still need configdrive_path to be manually hacked up because it acts as a temporary file for Rbd.","commit_id":"5ac2412dd99659fd0726f35a11f7b91e9f17f190"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"6b7ad6b6fcc406cf235ff59fb2c987048411a4cf","unresolved":false,"context_lines":[{"line_number":2960,"context_line":"                         {\u0027path\u0027: configdrive_path}, instance\u003dinstance)"},{"line_number":2961,"context_line":""},{"line_number":2962,"context_line":"                try:"},{"line_number":2963,"context_line":"                    if not os.path.exists(configdrive_path):"},{"line_number":2964,"context_line":"                        cdb.make_drive(configdrive_path)"},{"line_number":2965,"context_line":"                except processutils.ProcessExecutionError as e:"},{"line_number":2966,"context_line":"                    with excutils.save_and_reraise_exception():"}],"source_content_type":"text/x-python","patch_set":8,"id":"9abb7d3a_782f7e88","line":2963,"in_reply_to":"9abb7d3a_70c5e93b","updated":"2016-06-03 13:39:06.000000000","message":"Per discussion on IRC, we\u0027re going to slap a comment on this and stack the rbd fix on top of this.","commit_id":"5ac2412dd99659fd0726f35a11f7b91e9f17f190"},{"author":{"_account_id":9555,"name":"Matthew Booth","email":"mbooth@redhat.com","username":"MatthewBooth"},"change_message_id":"607ea89a4861ae087d0dc88f7575c6560c89022d","unresolved":false,"context_lines":[{"line_number":2962,"context_line":"                try:"},{"line_number":2963,"context_line":"                    # FIXME(danms): This is (and was) broken for configdrive"},{"line_number":2964,"context_line":"                    # on RBD. A slightly more complicated refactor needs to"},{"line_number":2965,"context_line":"                    # happen to make it work in that case."},{"line_number":2966,"context_line":"                    if not os.path.exists(configdrive_path):"},{"line_number":2967,"context_line":"                        cdb.make_drive(configdrive_path)"},{"line_number":2968,"context_line":"                except processutils.ProcessExecutionError as e:"}],"source_content_type":"text/x-python","patch_set":9,"id":"9abb7d3a_e3cc5e63","line":2965,"updated":"2016-06-03 14:47:05.000000000","message":"As discussed on IRC, this works for me.","commit_id":"216e1c1e0d3a64474194b13777b9fb86b2e93314"}]}
