)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fba24da9fe560b52d8338dfcb68be7ef268a56d4","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Hyper-V: Fixes cold migration / resize issue"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Commit https://review.openstack.org/#/c/162999/ changed where the Hyper-V"},{"line_number":10,"context_line":"VM configuration files are stored. The files are being stored in the same"},{"line_number":11,"context_line":"folder as the instance. Performing a cold resize / migration will cause a"},{"line_number":12,"context_line":"os.rename call on the instance\u0027s folder, which fails as long as there are"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a016987_ab17e943","line":9,"range":{"start_line":9,"start_character":7,"end_line":9,"end_character":47},"updated":"2015-05-28 18:22:47.000000000","message":"Can you change this to the short git hash instead of the gerrit link please?","commit_id":"c477afc13200be44c3c4533f2b9bd98cd0c5ae18"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"2c7779ebb1da27f27de5b3f18a1e460e3c042aac","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Hyper-V: Fixes cold migration / resize issue"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"Commit https://review.openstack.org/#/c/162999/ changed where the Hyper-V"},{"line_number":10,"context_line":"VM configuration files are stored. The files are being stored in the same"},{"line_number":11,"context_line":"folder as the instance. Performing a cold resize / migration will cause a"},{"line_number":12,"context_line":"os.rename call on the instance\u0027s folder, which fails as long as there are"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":8,"id":"7a016987_1dc6449a","line":9,"in_reply_to":"7a016987_ab17e943","updated":"2015-05-28 19:00:18.000000000","message":"Done","commit_id":"c477afc13200be44c3c4533f2b9bd98cd0c5ae18"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cfe3ad10239d986d51e033decc5b3a1d030a4a55","unresolved":false,"context_lines":[{"line_number":13,"context_line":"configuration files used by Hyper-V in that folder, thus resulting in a"},{"line_number":14,"context_line":"failed migration and the instance ending up in ERROR state."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Hyper-V configuration files are stored in a subfolder of the instance\u0027s"},{"line_number":17,"context_line":"folder (e.g.: C:\\OpenStack\\Instances\\instance-000000b6\\Virtual Machines)."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This commit makes sure that Hyper-V configuration files are not being"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7a016987_20df936a","line":16,"updated":"2015-05-28 19:32:23.000000000","message":"Is it *only* hyper-v config files that are stored in sub-folders in the instance\u0027s folder?  Would it be safer to explicitly filter out anything that contains hyper-v config files/folders rather than assume all subfolders are for hyper-v config and can\u0027t be moved?","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"70d9f93cc8d874d89723a7c7b8020224a4c26bc5","unresolved":false,"context_lines":[{"line_number":13,"context_line":"configuration files used by Hyper-V in that folder, thus resulting in a"},{"line_number":14,"context_line":"failed migration and the instance ending up in ERROR state."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Hyper-V configuration files are stored in a subfolder of the instance\u0027s"},{"line_number":17,"context_line":"folder (e.g.: C:\\OpenStack\\Instances\\instance-000000b6\\Virtual Machines)."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This commit makes sure that Hyper-V configuration files are not being"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7a016987_d3489b5e","line":16,"in_reply_to":"7a016987_20df936a","updated":"2015-05-28 20:16:48.000000000","message":"So the contents are as follows:\n\n    C:\\OpenStack\\Instances\\instance-0000005c\u003els -liaR\n    .:\n    total 10977\n    6722487 drwxr-xr-x    6 Administ Administ        0 May 26 14:40 .\n      67827 drwxr-xr-x   57 Administ Administ    16384 May 26 16:04 ..\n    4887595 drwxr-xr-x    1 Administ Administ        0 May 26 14:40 Virtual Machines\n     377651 -rw-r--r--    1 Administ Administ   419840 May 26 14:40 configdrive.iso\n    3774851 -rw-r--r--    1 Administ Administ    23040 May 26 14:41 console.log\n    5936116 -rw-r--r--    1 Administ Administ 22020096 May 27 21:27 root.vhdx\n\n    ./Virtual Machines:\n    total 28\n    4887595 drwxr-xr-x    1 Administ Administ        0 May 26 14:40 .\n    6722487 drwxr-xr-x    1 Administ Administ        0 May 26 14:40 ..\n    1415280 drwxr-xr-x    4 Administ Administ        0 May 26 14:40 CBDDAE82-9278-4E82-8F68-076AB5E00147\n    2135733 -rw-r--r--    1 Administ Administ    56326 May 28 22:52 CBDDAE82-9278-4E82-8F68-076AB5E00147.xml\n    ^ VM configuration file.\n\n    ./Virtual Machines/CBDDAE82-9278-4E82-8F68-076AB5E00147:\n    total 43542\n    1415280 drwxr-xr-x    4 Administ Administ        0 May 26 14:40 .\n    4887595 drwxr-xr-x    1 Administ Administ        0 May 26 14:40 ..\n    NOTE: those files only exist while the instance is running. When the instance is off, the files are removed.\n    1087848 -rw-r--r--    1 Administ Administ 68202496 May 26 14:47 CBDDAE82-9278-4E82-8F68-076AB5E00147.bin\n    1481052 -rw-r--r--    1 Administ Administ 20971520 May 26 14:47 CBDDAE82-9278-4E82-8F68-076AB5E00147.vsv","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"8cd29a0e6b702c3027bcec9f7ba929ae397a6537","unresolved":false,"context_lines":[{"line_number":13,"context_line":"configuration files used by Hyper-V in that folder, thus resulting in a"},{"line_number":14,"context_line":"failed migration and the instance ending up in ERROR state."},{"line_number":15,"context_line":""},{"line_number":16,"context_line":"Hyper-V configuration files are stored in a subfolder of the instance\u0027s"},{"line_number":17,"context_line":"folder (e.g.: C:\\OpenStack\\Instances\\instance-000000b6\\Virtual Machines)."},{"line_number":18,"context_line":""},{"line_number":19,"context_line":"This commit makes sure that Hyper-V configuration files are not being"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":9,"id":"7a016987_134193a9","line":16,"in_reply_to":"7a016987_d3489b5e","updated":"2015-05-28 20:19:54.000000000","message":"So, there are no other files that are of interest to be moved.","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"}],"nova/tests/unit/virt/hyperv/test_pathutils.py":[{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c2b351915b102d5428e8ea6af10b7f89bd2b8baa","unresolved":false,"context_lines":[{"line_number":35,"context_line":"        self._pathutils \u003d pathutils.PathUtils()"},{"line_number":36,"context_line":""},{"line_number":37,"context_line":"    @mock.patch.object(pathutils.PathUtils, \u0027rename\u0027)"},{"line_number":38,"context_line":"    def check_move_folder_contents(self, mock_rename):"},{"line_number":39,"context_line":"        with contextlib.nested(utils.tempdir(),"},{"line_number":40,"context_line":"                               utils.tempdir()) as (src_dir, dest_dir):"},{"line_number":41,"context_line":"            src_fname \u003d os.path.join(src_dir, \u0027tmp_file.txt\u0027)"}],"source_content_type":"text/x-python","patch_set":2,"id":"7ad8896b_eebb3f74","line":38,"updated":"2015-05-11 16:34:01.000000000","message":"Is this even running?  Should be prefixed with test_ in the method name.","commit_id":"f4bba9749f9d2e6a1cfa68be9267f20c33606526"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"fba24da9fe560b52d8338dfcb68be7ef268a56d4","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    @mock.patch.object(pathutils.PathUtils, \u0027rename\u0027)"},{"line_number":38,"context_line":"    def test_move_folder_contents(self, mock_rename):"},{"line_number":39,"context_line":"        with contextlib.nested(utils.tempdir(),"},{"line_number":40,"context_line":"                               utils.tempdir()) as (src_dir, dest_dir):"},{"line_number":41,"context_line":"            src_fname \u003d os.path.join(src_dir, \u0027tmp_file.txt\u0027)"},{"line_number":42,"context_line":"            dest_fname \u003d os.path.join(dest_dir, \u0027tmp_file.txt\u0027)"},{"line_number":43,"context_line":"            test_file \u003d open(src_fname, \u0027w\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a016987_503824ee","line":40,"updated":"2015-05-28 18:22:47.000000000","message":"Is there any reason you can\u0027t just mock out the call to list the files? In general, we try to avoid unit tests that actually affect (or depend on) the state of the machine they\u0027re running on. If you can\u0027t get around this in some way, then this is okay, but if you can achieve the same result by mocking the list method, we should do that IMHO.","commit_id":"c477afc13200be44c3c4533f2b9bd98cd0c5ae18"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"2c7779ebb1da27f27de5b3f18a1e460e3c042aac","unresolved":false,"context_lines":[{"line_number":37,"context_line":"    @mock.patch.object(pathutils.PathUtils, \u0027rename\u0027)"},{"line_number":38,"context_line":"    def test_move_folder_contents(self, mock_rename):"},{"line_number":39,"context_line":"        with contextlib.nested(utils.tempdir(),"},{"line_number":40,"context_line":"                               utils.tempdir()) as (src_dir, dest_dir):"},{"line_number":41,"context_line":"            src_fname \u003d os.path.join(src_dir, \u0027tmp_file.txt\u0027)"},{"line_number":42,"context_line":"            dest_fname \u003d os.path.join(dest_dir, \u0027tmp_file.txt\u0027)"},{"line_number":43,"context_line":"            test_file \u003d open(src_fname, \u0027w\u0027)"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a016987_2bd3f9d6","line":40,"in_reply_to":"7a016987_503824ee","updated":"2015-05-28 19:00:18.000000000","message":"Previously, I had a different implementation, using os.path.walk and I had a smaller amount of control over what happens in that call and I was a little bit paranoid.\n\nBut now, there is a much simpler implementation, thanks to Lucian.","commit_id":"c477afc13200be44c3c4533f2b9bd98cd0c5ae18"}],"nova/virt/hyperv/migrationops.py":[{"author":{"_account_id":12604,"name":"Adelina Tuvenie","email":"atuvenie@cloudbasesolutions.com","username":"atuvenie"},"change_message_id":"fde7631c1c08151bd79f5aa5c9bee1c242f57624","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        instance_path \u003d self._pathutils.get_instance_dir(instance_name)"},{"line_number":58,"context_line":"        revert_path \u003d self._pathutils.get_instance_migr_revert_dir("},{"line_number":59,"context_line":"            instance_name, remove_dir\u003dTrue, create_dir\u003dTrue)"},{"line_number":60,"context_line":"        dest_path \u003d None"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a016987_44ce6db5","line":59,"updated":"2015-05-27 09:34:00.000000000","message":"Why always create revert dir here?","commit_id":"c477afc13200be44c3c4533f2b9bd98cd0c5ae18"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"7402c0044d7cb38bbcce9a7cfccf1b015b599a44","unresolved":false,"context_lines":[{"line_number":56,"context_line":""},{"line_number":57,"context_line":"        instance_path \u003d self._pathutils.get_instance_dir(instance_name)"},{"line_number":58,"context_line":"        revert_path \u003d self._pathutils.get_instance_migr_revert_dir("},{"line_number":59,"context_line":"            instance_name, remove_dir\u003dTrue, create_dir\u003dTrue)"},{"line_number":60,"context_line":"        dest_path \u003d None"},{"line_number":61,"context_line":""},{"line_number":62,"context_line":"        try:"}],"source_content_type":"text/x-python","patch_set":8,"id":"7a016987_4439cd40","line":59,"in_reply_to":"7a016987_44ce6db5","updated":"2015-05-27 09:41:28.000000000","message":"So, previously, the folder was moved entirely. Now, the folder contents are moved individually. The problem is, if the dest_dir does not exist, moving the items from src_dir would cause an exception. Thus, creating the dir is necessary.","commit_id":"c477afc13200be44c3c4533f2b9bd98cd0c5ae18"}],"nova/virt/hyperv/pathutils.py":[{"author":{"_account_id":8543,"name":"Lucian Petrut","email":"lpetrut@cloudbasesolutions.com","username":"plucian"},"change_message_id":"8212278fba58bc8c75cd740c92b6f085db6b1d90","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        :param dest_dir: Folder to which to move files."},{"line_number":92,"context_line":"        \"\"\""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        def _move_contents(arg, dirname, fnames):"},{"line_number":95,"context_line":"            # Called by os.path.walk. Must pop the contents of the list fnames,"},{"line_number":96,"context_line":"            # otherwise, this method will be called again for each subdir in"},{"line_number":97,"context_line":"            # fnames."}],"source_content_type":"text/x-python","patch_set":7,"id":"7a016987_e55d777a","line":94,"updated":"2015-05-26 15:03:53.000000000","message":"I think using os.listdir instead would make this a lot more readable.","commit_id":"bfa2584091c30ea66b4ff00594d39343bae461e1"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"e15ca87c1a7495bc2ce4fe7c9b2ae0ce6a77649e","unresolved":false,"context_lines":[{"line_number":91,"context_line":"        :param dest_dir: Folder to which to move files."},{"line_number":92,"context_line":"        \"\"\""},{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        def _move_contents(arg, dirname, fnames):"},{"line_number":95,"context_line":"            # Called by os.path.walk. Must pop the contents of the list fnames,"},{"line_number":96,"context_line":"            # otherwise, this method will be called again for each subdir in"},{"line_number":97,"context_line":"            # fnames."}],"source_content_type":"text/x-python","patch_set":7,"id":"7a016987_dfc7e362","line":94,"in_reply_to":"7a016987_e55d777a","updated":"2015-05-26 18:26:30.000000000","message":"Done","commit_id":"bfa2584091c30ea66b4ff00594d39343bae461e1"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cfe3ad10239d986d51e033decc5b3a1d030a4a55","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            raise IOError(_(\u0027The file copy from %(src)s to %(dest)s failed\u0027)"},{"line_number":84,"context_line":"                           % {\u0027src\u0027: src, \u0027dest\u0027: dest})"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def move_folder_contents(self, src_dir, dest_dir):"},{"line_number":87,"context_line":"        \"\"\"Moves the contents of the given src_dir to dest_dir by using"},{"line_number":88,"context_line":"        os.path.walk. It will ignore any nested folders."},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_e0485b5e","line":86,"updated":"2015-05-28 19:32:23.000000000","message":"nit: the name of this utility method is a bit confusing given a sub-folder could be consider folder contents.  move_folder_files might be a bit more clear, but not much better.","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"c992a2569cf48b6586c89419646b15afb20eb02c","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            raise IOError(_(\u0027The file copy from %(src)s to %(dest)s failed\u0027)"},{"line_number":84,"context_line":"                           % {\u0027src\u0027: src, \u0027dest\u0027: dest})"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def move_folder_contents(self, src_dir, dest_dir):"},{"line_number":87,"context_line":"        \"\"\"Moves the contents of the given src_dir to dest_dir by using"},{"line_number":88,"context_line":"        os.path.walk. It will ignore any nested folders."},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_937a23f0","line":86,"in_reply_to":"7a016987_d35f7b0d","updated":"2015-05-28 20:21:58.000000000","message":"Just thought of this now after you changed it, but move_folder_contents with a boolean to skip/include/filter subdirs might have also been good, but I wouldn\u0027t block on that now.","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"70d9f93cc8d874d89723a7c7b8020224a4c26bc5","unresolved":false,"context_lines":[{"line_number":83,"context_line":"            raise IOError(_(\u0027The file copy from %(src)s to %(dest)s failed\u0027)"},{"line_number":84,"context_line":"                           % {\u0027src\u0027: src, \u0027dest\u0027: dest})"},{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def move_folder_contents(self, src_dir, dest_dir):"},{"line_number":87,"context_line":"        \"\"\"Moves the contents of the given src_dir to dest_dir by using"},{"line_number":88,"context_line":"        os.path.walk. It will ignore any nested folders."},{"line_number":89,"context_line":""}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_d35f7b0d","line":86,"in_reply_to":"7a016987_e0485b5e","updated":"2015-05-28 20:16:48.000000000","message":"I know, this name is a bit terrible. move_folder_files sounds better.","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cfe3ad10239d986d51e033decc5b3a1d030a4a55","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def move_folder_contents(self, src_dir, dest_dir):"},{"line_number":87,"context_line":"        \"\"\"Moves the contents of the given src_dir to dest_dir by using"},{"line_number":88,"context_line":"        os.path.walk. It will ignore any nested folders."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        :param src_dir: Given folder from which to move files."},{"line_number":91,"context_line":"        :param dest_dir: Folder to which to move files."}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_2015533f","line":88,"updated":"2015-05-28 19:32:23.000000000","message":"os.path.walk isn\u0027t used here.","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"70d9f93cc8d874d89723a7c7b8020224a4c26bc5","unresolved":false,"context_lines":[{"line_number":85,"context_line":""},{"line_number":86,"context_line":"    def move_folder_contents(self, src_dir, dest_dir):"},{"line_number":87,"context_line":"        \"\"\"Moves the contents of the given src_dir to dest_dir by using"},{"line_number":88,"context_line":"        os.path.walk. It will ignore any nested folders."},{"line_number":89,"context_line":""},{"line_number":90,"context_line":"        :param src_dir: Given folder from which to move files."},{"line_number":91,"context_line":"        :param dest_dir: Folder to which to move files."}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_536b8bb9","line":88,"in_reply_to":"7a016987_2015533f","updated":"2015-05-28 20:16:48.000000000","message":"Ah, didn\u0027t see this after I changed the implementation. Ack.","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"cfe3ad10239d986d51e033decc5b3a1d030a4a55","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        for fname in os.listdir(src_dir):"},{"line_number":95,"context_line":"            src \u003d os.path.join(src_dir, fname)"},{"line_number":96,"context_line":"            if os.path.isdir(src):"},{"line_number":97,"context_line":"                # ignore subdirs."},{"line_number":98,"context_line":"                continue"},{"line_number":99,"context_line":"            self.rename(src, os.path.join(dest_dir, fname))"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_8053e716","line":96,"updated":"2015-05-28 19:32:23.000000000","message":"Why not just use os.path.isfile(src) so you don\u0027t need the continue?  This is just a style nit for me.","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"},{"author":{"_account_id":8213,"name":"Claudiu Belu","email":"cbelu@cloudbasesolutions.com","username":"claudiub"},"change_message_id":"70d9f93cc8d874d89723a7c7b8020224a4c26bc5","unresolved":false,"context_lines":[{"line_number":93,"context_line":""},{"line_number":94,"context_line":"        for fname in os.listdir(src_dir):"},{"line_number":95,"context_line":"            src \u003d os.path.join(src_dir, fname)"},{"line_number":96,"context_line":"            if os.path.isdir(src):"},{"line_number":97,"context_line":"                # ignore subdirs."},{"line_number":98,"context_line":"                continue"},{"line_number":99,"context_line":"            self.rename(src, os.path.join(dest_dir, fname))"}],"source_content_type":"text/x-python","patch_set":9,"id":"7a016987_b35cff19","line":96,"in_reply_to":"7a016987_8053e716","updated":"2015-05-28 20:16:48.000000000","message":"Done","commit_id":"aa17f57cd7c6ac4a2062ec624c9341405a37c93d"}]}
