)]}'
{"nova/tests/virt/test_virt_disk.py":[{"author":{"_account_id":9420,"name":"Matthew Gilliard","email":"matthew.gilliard@hp.com","username":"gilliard"},"change_message_id":"8c3d7ae3410af6c1ca2832cfd14478a6fd5b6474","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                          \"content\": \"inject-file-contents\","},{"line_number":259,"context_line":"                          \"gid\": 100,"},{"line_number":260,"context_line":"                          \"uid\": 100,"},{"line_number":261,"context_line":"                          \"mode\": 448})"},{"line_number":262,"context_line":"        vfs.teardown()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BaEs%3D","line":261,"updated":"2014-01-27 09:14:55.000000000","message":"Better to write this as 0o700 as above, right?","commit_id":"4c83ee1f3f4a0417aeafe0406cb5f5a9ae6d0b2c"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"ca313c6037ef3191045a6cb191be010d25651a2c","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                          \"content\": \"inject-file-contents\","},{"line_number":259,"context_line":"                          \"gid\": 100,"},{"line_number":260,"context_line":"                          \"uid\": 100,"},{"line_number":261,"context_line":"                          \"mode\": 448})"},{"line_number":262,"context_line":"        vfs.teardown()"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BZ1s%3D","line":261,"in_reply_to":"AAAAUH%2F%2BaEs%3D","updated":"2014-01-27 09:58:20.000000000","message":"OK?I will change it.","commit_id":"4c83ee1f3f4a0417aeafe0406cb5f5a9ae6d0b2c"},{"author":{"_account_id":5652,"name":"David Ripton","email":"dripton@redhat.com","username":"dripton"},"change_message_id":"27686bd1274869a98a153020f0bf21ff90255d3f","unresolved":false,"context_lines":[{"line_number":259,"context_line":"                          \"gid\": 100,"},{"line_number":260,"context_line":"                          \"uid\": 100,"},{"line_number":261,"context_line":"                          \"mode\": 0o700})"},{"line_number":262,"context_line":"        vfs.teardown()"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAUX%2F%2FPnY%3D","line":262,"updated":"2014-02-14 15:29:05.000000000","message":"It would be nice to also test the case where the parent path already exists, by injecting a second file into the same directory after the first call creates it.","commit_id":"1c95c65d8674640660dfff02e997e5662a304d0d"}],"nova/virt/disk/api.py":[{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"8bb8ed29fd6d1d6746e8ec87cf2fe39a78e4552c","unresolved":false,"context_lines":[{"line_number":442,"context_line":"    for (path, contents) in files:"},{"line_number":443,"context_line":"        # NOTE(wangpan): Ensure the parent dir of injecting file exists"},{"line_number":444,"context_line":"        parent_dir \u003d os.path.dirname(path)"},{"line_number":445,"context_line":"        if len(parent_dir) \u003e 0 and parent_dir !\u003d \"/\":"},{"line_number":446,"context_line":"            fs.make_path(parent_dir)"},{"line_number":447,"context_line":"            fs.set_ownership(parent_dir, \"root\", \"root\")"},{"line_number":448,"context_line":"            fs.set_permissions(parent_dir, 0o700)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BZuY%3D","line":445,"updated":"2014-01-27 10:16:21.000000000","message":"The len(parent_dir) part of this check seems uneccessary - just check that it isn\u0027t the root dir.","commit_id":"4c83ee1f3f4a0417aeafe0406cb5f5a9ae6d0b2c"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"5c25f1dbf2c1adcb4057aeb73dfa4c1c9ed47b4e","unresolved":false,"context_lines":[{"line_number":442,"context_line":"    for (path, contents) in files:"},{"line_number":443,"context_line":"        # NOTE(wangpan): Ensure the parent dir of injecting file exists"},{"line_number":444,"context_line":"        parent_dir \u003d os.path.dirname(path)"},{"line_number":445,"context_line":"        if len(parent_dir) \u003e 0 and parent_dir !\u003d \"/\":"},{"line_number":446,"context_line":"            fs.make_path(parent_dir)"},{"line_number":447,"context_line":"            fs.set_ownership(parent_dir, \"root\", \"root\")"},{"line_number":448,"context_line":"            fs.set_permissions(parent_dir, 0o700)"}],"source_content_type":"text/x-python","patch_set":3,"id":"AAAAUH%2F%2BUY4%3D","line":445,"in_reply_to":"AAAAUH%2F%2BZuY%3D","updated":"2014-01-28 01:53:29.000000000","message":"I believe the len() \u003e 0 check is necessary, it is used for avoiding the case `path` is just a file name(e.g. rebuild.txt in tempest, yes, I add this check because the tempest test is failed), then the parent_dir is a empty string \u0027\u0027, if we make_path(\u0027\u0027), a exception will be raised in _canonical_path() method:\nraise exception.Invalid(_(\u0027File path %s not valid\u0027) % path)\nInvalid: File path  not valid(an empty string here)\nand if parent_dir is \u0027/\u0027, Invalid: File path / not valid will be raised.","commit_id":"4c83ee1f3f4a0417aeafe0406cb5f5a9ae6d0b2c"},{"author":{"_account_id":1779,"name":"Daniel Berrange","email":"berrange@redhat.com","username":"berrange"},"change_message_id":"553533abdb4a0eeeb14c04085e231e094be3c79d","unresolved":false,"context_lines":[{"line_number":450,"context_line":"    for (path, contents) in files:"},{"line_number":451,"context_line":"        # NOTE(wangpan): Ensure the parent dir of injecting file exists"},{"line_number":452,"context_line":"        parent_dir \u003d os.path.dirname(path)"},{"line_number":453,"context_line":"        if len(parent_dir) \u003e 0 and parent_dir !\u003d \"/\":"},{"line_number":454,"context_line":"            fs.make_path(parent_dir)"},{"line_number":455,"context_line":"            fs.set_ownership(parent_dir, \"root\", \"root\")"},{"line_number":456,"context_line":"            fs.set_permissions(parent_dir, 0o700)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BS%2Fg%3D","line":453,"updated":"2014-01-28 09:32:10.000000000","message":"just add in  \u0027and not fs.has_file(parent_dir)\u0027 here and then all jichenjc\u0027s comments will be addressed.","commit_id":"18f8fb847b00c98855c558572b7759495859678d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"fea8b545c02d666e6c1b3fc3833e5bab758ee4db","unresolved":false,"context_lines":[{"line_number":451,"context_line":"        # NOTE(wangpan): Ensure the parent dir of injecting file exists"},{"line_number":452,"context_line":"        parent_dir \u003d os.path.dirname(path)"},{"line_number":453,"context_line":"        if len(parent_dir) \u003e 0 and parent_dir !\u003d \"/\":"},{"line_number":454,"context_line":"            fs.make_path(parent_dir)"},{"line_number":455,"context_line":"            fs.set_ownership(parent_dir, \"root\", \"root\")"},{"line_number":456,"context_line":"            fs.set_permissions(parent_dir, 0o700)"},{"line_number":457,"context_line":"        _inject_file_into_fs(fs, path, contents)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BT6k%3D","line":454,"updated":"2014-01-28 04:09:42.000000000","message":"should we create the directory every time?","commit_id":"18f8fb847b00c98855c558572b7759495859678d"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"2ad275131e174e5fd43e6f4b50685c93bf43eb35","unresolved":false,"context_lines":[{"line_number":451,"context_line":"        # NOTE(wangpan): Ensure the parent dir of injecting file exists"},{"line_number":452,"context_line":"        parent_dir \u003d os.path.dirname(path)"},{"line_number":453,"context_line":"        if len(parent_dir) \u003e 0 and parent_dir !\u003d \"/\":"},{"line_number":454,"context_line":"            fs.make_path(parent_dir)"},{"line_number":455,"context_line":"            fs.set_ownership(parent_dir, \"root\", \"root\")"},{"line_number":456,"context_line":"            fs.set_permissions(parent_dir, 0o700)"},{"line_number":457,"context_line":"        _inject_file_into_fs(fs, path, contents)"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BTjY%3D","line":454,"in_reply_to":"AAAAUH%2F%2BT6k%3D","updated":"2014-01-28 06:45:13.000000000","message":"yes, but it just a `mkdir -p` operation, no error will be raised here. I think your later question is more important.","commit_id":"18f8fb847b00c98855c558572b7759495859678d"},{"author":{"_account_id":6062,"name":"jichenjc","email":"jichenjc@cn.ibm.com","username":"jichenjc"},"change_message_id":"fea8b545c02d666e6c1b3fc3833e5bab758ee4db","unresolved":false,"context_lines":[{"line_number":452,"context_line":"        parent_dir \u003d os.path.dirname(path)"},{"line_number":453,"context_line":"        if len(parent_dir) \u003e 0 and parent_dir !\u003d \"/\":"},{"line_number":454,"context_line":"            fs.make_path(parent_dir)"},{"line_number":455,"context_line":"            fs.set_ownership(parent_dir, \"root\", \"root\")"},{"line_number":456,"context_line":"            fs.set_permissions(parent_dir, 0o700)"},{"line_number":457,"context_line":"        _inject_file_into_fs(fs, path, contents)"},{"line_number":458,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BT6Y%3D","line":455,"updated":"2014-01-28 04:09:42.000000000","message":"in this case, if the directory already exist and has different gid/uid, will the directory\u0027s gid and uid be modified?\n\nalso, set_ownership only modify the last level directory\nlet\u0027s say you create /a/b/c/d\nonly d will be updated to \u0027root\u0027 \u0027root\u0027\nhow about a, b ,c ? \nchown and chgrp should have -R option to do it I think","commit_id":"18f8fb847b00c98855c558572b7759495859678d"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"2ad275131e174e5fd43e6f4b50685c93bf43eb35","unresolved":false,"context_lines":[{"line_number":452,"context_line":"        parent_dir \u003d os.path.dirname(path)"},{"line_number":453,"context_line":"        if len(parent_dir) \u003e 0 and parent_dir !\u003d \"/\":"},{"line_number":454,"context_line":"            fs.make_path(parent_dir)"},{"line_number":455,"context_line":"            fs.set_ownership(parent_dir, \"root\", \"root\")"},{"line_number":456,"context_line":"            fs.set_permissions(parent_dir, 0o700)"},{"line_number":457,"context_line":"        _inject_file_into_fs(fs, path, contents)"},{"line_number":458,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BTf0%3D","line":455,"in_reply_to":"AAAAUH%2F%2BT6Y%3D","updated":"2014-01-28 06:45:13.000000000","message":"really good question, I just copying the codes from _inject_key_*() method, and don\u0027t focus on this yet. I have two ways to change this: (1) chown/chmod the deepest dir if it is new created here; (2) chown/chmod all new created dirs, may use a loop to do this instead of `-P` because we don\u0027t support it now.\nwhat\u0027s your opinion?","commit_id":"18f8fb847b00c98855c558572b7759495859678d"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"e25678f8b082b69de887f5e1d1c6111b686da28c","unresolved":false,"context_lines":[{"line_number":452,"context_line":"        parent_dir \u003d os.path.dirname(path)"},{"line_number":453,"context_line":"        if len(parent_dir) \u003e 0 and parent_dir !\u003d \"/\":"},{"line_number":454,"context_line":"            fs.make_path(parent_dir)"},{"line_number":455,"context_line":"            fs.set_ownership(parent_dir, \"root\", \"root\")"},{"line_number":456,"context_line":"            fs.set_permissions(parent_dir, 0o700)"},{"line_number":457,"context_line":"        _inject_file_into_fs(fs, path, contents)"},{"line_number":458,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BTeM%3D","line":455,"in_reply_to":"AAAAUH%2F%2BTf0%3D","updated":"2014-01-28 06:53:22.000000000","message":"I also want to hear Daniel\u0027s voice about this question.","commit_id":"18f8fb847b00c98855c558572b7759495859678d"},{"author":{"_account_id":4468,"name":"Wangpan","email":"hzwangpan@corp.netease.com","username":"hzwangpan"},"change_message_id":"2ad275131e174e5fd43e6f4b50685c93bf43eb35","unresolved":false,"context_lines":[{"line_number":453,"context_line":"        if len(parent_dir) \u003e 0 and parent_dir !\u003d \"/\":"},{"line_number":454,"context_line":"            fs.make_path(parent_dir)"},{"line_number":455,"context_line":"            fs.set_ownership(parent_dir, \"root\", \"root\")"},{"line_number":456,"context_line":"            fs.set_permissions(parent_dir, 0o700)"},{"line_number":457,"context_line":"        _inject_file_into_fs(fs, path, contents)"},{"line_number":458,"context_line":""},{"line_number":459,"context_line":""}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAAUH%2F%2BTfo%3D","line":456,"updated":"2014-01-28 06:45:13.000000000","message":"this `mode` should be better to change to 0o744.","commit_id":"18f8fb847b00c98855c558572b7759495859678d"}]}
