)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"3cb9b3ed9bbdfa13b4f82b33afa86ab378a14f52","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     Chang Bo Guo \u003cguochbo@cn.ibm.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2013-04-27 19:42:31 -0700"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Cleanup inconsistent file with powervm driver"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When deploy one instance with powervm driver ,need transfer the image"},{"line_number":10,"context_line":"file to host, if file transfer fails , will leave the file on host in"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAAOn%2F%2FsTM%3D","line":7,"updated":"2013-04-28 03:31:27.000000000","message":"Full stop at the end of this sentence please.","commit_id":"a74396bac62ddb4edc11cba13fab29c03494a59b"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"3cb9b3ed9bbdfa13b4f82b33afa86ab378a14f52","unresolved":false,"context_lines":[{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When deploy one instance with powervm driver ,need transfer the image"},{"line_number":10,"context_line":"file to host, if file transfer fails , will leave the file on host in"},{"line_number":11,"context_line":"current logic, need cleanup it in this situation."},{"line_number":12,"context_line":""},{"line_number":13,"context_line":"Fixes bug #1173017"},{"line_number":14,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":4,"id":"AAAAOn%2F%2FsTE%3D","line":11,"updated":"2013-04-28 03:31:27.000000000","message":"The punctuation here can do with some tweaking. It can be shorter as well. Something like:\n\n\"Clean up failed image transfers that may occur during instance spawn.\"","commit_id":"a74396bac62ddb4edc11cba13fab29c03494a59b"}],"nova/tests/test_powervm.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7e419e9a0757390b70cbccd6e3c48dcde104906c","unresolved":false,"context_lines":[{"line_number":549,"context_line":"        super(PowerVMLocalVolumeAdapterTestCase, self).setUp()"},{"line_number":550,"context_line":"        self._disk_adapter \u003d powervm_operator.get_powervm_disk_adapter()"},{"line_number":551,"context_line":""},{"line_number":552,"context_line":"    def test_run_vios_command_as_root(self):"},{"line_number":553,"context_line":"        executed_command \u003d []"},{"line_number":554,"context_line":"        final_path \u003d \"/images/image.gz\""},{"line_number":555,"context_line":"        exp_cmd \u003d \"/usr/bin/rm -f %s\" % final_path"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FrKU%3D","line":552,"updated":"2013-04-29 16:37:07.000000000","message":"I don\u0027t see how this tests anything useful at all.","commit_id":"f6d480acb4680b7f9355060bb32d4d1ebb2b4e29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7e419e9a0757390b70cbccd6e3c48dcde104906c","unresolved":false,"context_lines":[{"line_number":555,"context_line":"        exp_cmd \u003d \"/usr/bin/rm -f %s\" % final_path"},{"line_number":556,"context_line":""},{"line_number":557,"context_line":"        def fake_run_vios_command_as_root(command, check_exit_code\u003dTrue):"},{"line_number":558,"context_line":"            executed_command.append(command)"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        fake_op \u003d self._disk_adapter"},{"line_number":561,"context_line":"        self.stubs.Set(fake_op, \u0027run_vios_command_as_root\u0027,"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FrKQ%3D","line":558,"updated":"2013-04-29 16:37:07.000000000","message":"You define a fake version of this function...","commit_id":"f6d480acb4680b7f9355060bb32d4d1ebb2b4e29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7e419e9a0757390b70cbccd6e3c48dcde104906c","unresolved":false,"context_lines":[{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        fake_op \u003d self._disk_adapter"},{"line_number":561,"context_line":"        self.stubs.Set(fake_op, \u0027run_vios_command_as_root\u0027,"},{"line_number":562,"context_line":"                       fake_run_vios_command_as_root)"},{"line_number":563,"context_line":"        self._disk_adapter.run_vios_command_as_root(exp_cmd)"},{"line_number":564,"context_line":"        self.assertEqual(executed_command[0], exp_cmd)"},{"line_number":565,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FrKM%3D","line":562,"updated":"2013-04-29 16:37:07.000000000","message":"...stub out self._disk_adapter.run_vios_command_as_root...","commit_id":"f6d480acb4680b7f9355060bb32d4d1ebb2b4e29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7e419e9a0757390b70cbccd6e3c48dcde104906c","unresolved":false,"context_lines":[{"line_number":560,"context_line":"        fake_op \u003d self._disk_adapter"},{"line_number":561,"context_line":"        self.stubs.Set(fake_op, \u0027run_vios_command_as_root\u0027,"},{"line_number":562,"context_line":"                       fake_run_vios_command_as_root)"},{"line_number":563,"context_line":"        self._disk_adapter.run_vios_command_as_root(exp_cmd)"},{"line_number":564,"context_line":"        self.assertEqual(executed_command[0], exp_cmd)"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"    def test_copy_image_file_wrong_checksum(self):"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FrKI%3D","line":563,"updated":"2013-04-29 16:37:07.000000000","message":"...call your stub directly...","commit_id":"f6d480acb4680b7f9355060bb32d4d1ebb2b4e29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7e419e9a0757390b70cbccd6e3c48dcde104906c","unresolved":false,"context_lines":[{"line_number":561,"context_line":"        self.stubs.Set(fake_op, \u0027run_vios_command_as_root\u0027,"},{"line_number":562,"context_line":"                       fake_run_vios_command_as_root)"},{"line_number":563,"context_line":"        self._disk_adapter.run_vios_command_as_root(exp_cmd)"},{"line_number":564,"context_line":"        self.assertEqual(executed_command[0], exp_cmd)"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"    def test_copy_image_file_wrong_checksum(self):"},{"line_number":567,"context_line":"        file_path \u003d \u0027/images/image.gz\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FrKE%3D","line":564,"updated":"2013-04-29 16:37:07.000000000","message":"...and verify that your stub did what you expected. Unless I\u0027m missing something, this tests nothing but the test itself.","commit_id":"f6d480acb4680b7f9355060bb32d4d1ebb2b4e29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7e419e9a0757390b70cbccd6e3c48dcde104906c","unresolved":false,"context_lines":[{"line_number":563,"context_line":"        self._disk_adapter.run_vios_command_as_root(exp_cmd)"},{"line_number":564,"context_line":"        self.assertEqual(executed_command[0], exp_cmd)"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"    def test_copy_image_file_wrong_checksum(self):"},{"line_number":567,"context_line":"        file_path \u003d \u0027/images/image.gz\u0027"},{"line_number":568,"context_line":"        remote_path \u003d \u0027/mnt/openstack/images/\u0027"},{"line_number":569,"context_line":"        self.exp_checksum \u003d \u00273229026618\u0027"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FrKA%3D","line":566,"updated":"2013-04-29 16:37:07.000000000","message":"The same goes for this function.","commit_id":"f6d480acb4680b7f9355060bb32d4d1ebb2b4e29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7e419e9a0757390b70cbccd6e3c48dcde104906c","unresolved":false,"context_lines":[{"line_number":589,"context_line":""},{"line_number":590,"context_line":"        fake_op \u003d self._disk_adapter"},{"line_number":591,"context_line":"        self.stubs.Set(fake_op, \u0027_copy_image_file\u0027,"},{"line_number":592,"context_line":"                       fake_copy_image_file)"},{"line_number":593,"context_line":"        self.stubs.Set(fake_op, \u0027_md5sum_remote_file\u0027,"},{"line_number":594,"context_line":"                       fake_md5sum_remote_file)"},{"line_number":595,"context_line":""}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FrJ8%3D","line":592,"updated":"2013-04-29 16:37:07.000000000","message":"You stub out self._disk_adapter._copy_image_file...","commit_id":"f6d480acb4680b7f9355060bb32d4d1ebb2b4e29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7e419e9a0757390b70cbccd6e3c48dcde104906c","unresolved":false,"context_lines":[{"line_number":594,"context_line":"                       fake_md5sum_remote_file)"},{"line_number":595,"context_line":""},{"line_number":596,"context_line":"        try:"},{"line_number":597,"context_line":"            self._disk_adapter._copy_image_file(file_path, remote_path)"},{"line_number":598,"context_line":""},{"line_number":599,"context_line":"        except exception.PowerVMFileTransferFailed:"},{"line_number":600,"context_line":"            self.exception_caught \u003d True"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FrJ4%3D","line":597,"updated":"2013-04-29 16:37:07.000000000","message":"...and then call it here.","commit_id":"f6d480acb4680b7f9355060bb32d4d1ebb2b4e29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"7e419e9a0757390b70cbccd6e3c48dcde104906c","unresolved":false,"context_lines":[{"line_number":600,"context_line":"            self.exception_caught \u003d True"},{"line_number":601,"context_line":""},{"line_number":602,"context_line":"        self.assertTrue(self.cleanup_called)"},{"line_number":603,"context_line":"        self.assertTrue(self.exception_caught)"}],"source_content_type":"text/x-python","patch_set":5,"id":"AAAAOn%2F%2FrJs%3D","line":603,"updated":"2013-04-29 16:37:07.000000000","message":"These confirm nothing!","commit_id":"f6d480acb4680b7f9355060bb32d4d1ebb2b4e29"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d99e936f3076384051871fdd1941cf9a7478e843","unresolved":false,"context_lines":[{"line_number":551,"context_line":"        self._disk_adapter \u003d powervm_operator.get_powervm_disk_adapter()"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def test_copy_image_file_wrong_checksum(self):"},{"line_number":554,"context_line":"        file_path \u003d \u0027/tmp/image.gz\u0027"},{"line_number":555,"context_line":"        remote_path \u003d \u0027/mnt/openstack/images\u0027"},{"line_number":556,"context_line":"        self.wrong_checksum \u003d \u00273202937169\u0027"},{"line_number":557,"context_line":"        self.exception_caught \u003d False"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjYM%3D","line":554,"updated":"2013-05-04 14:33:53.000000000","message":"If you must create a file, could you at least use a tempfile-provided filename?","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"414b29b37ff9ec3979eb4e313efaf4c42835ffb0","unresolved":false,"context_lines":[{"line_number":551,"context_line":"        self._disk_adapter \u003d powervm_operator.get_powervm_disk_adapter()"},{"line_number":552,"context_line":""},{"line_number":553,"context_line":"    def test_copy_image_file_wrong_checksum(self):"},{"line_number":554,"context_line":"        file_path \u003d \u0027/tmp/image.gz\u0027"},{"line_number":555,"context_line":"        remote_path \u003d \u0027/mnt/openstack/images\u0027"},{"line_number":556,"context_line":"        self.wrong_checksum \u003d \u00273202937169\u0027"},{"line_number":557,"context_line":"        self.exception_caught \u003d False"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjHw%3D","line":554,"in_reply_to":"AAAAOn%2F%2FjYM%3D","updated":"2013-05-05 10:11:01.000000000","message":"Done","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d99e936f3076384051871fdd1941cf9a7478e843","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        file_path \u003d \u0027/tmp/image.gz\u0027"},{"line_number":555,"context_line":"        remote_path \u003d \u0027/mnt/openstack/images\u0027"},{"line_number":556,"context_line":"        self.wrong_checksum \u003d \u00273202937169\u0027"},{"line_number":557,"context_line":"        self.exception_caught \u003d False"},{"line_number":558,"context_line":"        fake_noop \u003d lambda *args, **kwargs: None"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        def fake_run_vios_command_as_root(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjX8%3D","line":557,"updated":"2013-05-04 14:33:53.000000000","message":"This doesn\u0027t need to be an instance variable, AFAICT","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"414b29b37ff9ec3979eb4e313efaf4c42835ffb0","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        file_path \u003d \u0027/tmp/image.gz\u0027"},{"line_number":555,"context_line":"        remote_path \u003d \u0027/mnt/openstack/images\u0027"},{"line_number":556,"context_line":"        self.wrong_checksum \u003d \u00273202937169\u0027"},{"line_number":557,"context_line":"        self.exception_caught \u003d False"},{"line_number":558,"context_line":"        fake_noop \u003d lambda *args, **kwargs: None"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        def fake_run_vios_command_as_root(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjHs%3D","line":557,"in_reply_to":"AAAAOn%2F%2FjX8%3D","updated":"2013-05-05 10:11:01.000000000","message":"Done","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d99e936f3076384051871fdd1941cf9a7478e843","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            cmd \u003d args[0]"},{"line_number":562,"context_line":"            exp_cmd \u003d \u0027 \u0027.join([\u0027/usr/bin/rm -f\u0027,"},{"line_number":563,"context_line":"                                \u0027/mnt/openstack/images/image.gz\u0027])"},{"line_number":564,"context_line":"            self.assertEqual(exp_cmd, cmd)"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"        def fake_md5sum_remote_file(remote_path):"},{"line_number":567,"context_line":"            return self.wrong_checksum"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjYQ%3D","line":564,"updated":"2013-05-04 14:33:53.000000000","message":"IMHO, this would be better verified by using self.mox.StubOutWithMock()","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"414b29b37ff9ec3979eb4e313efaf4c42835ffb0","unresolved":false,"context_lines":[{"line_number":561,"context_line":"            cmd \u003d args[0]"},{"line_number":562,"context_line":"            exp_cmd \u003d \u0027 \u0027.join([\u0027/usr/bin/rm -f\u0027,"},{"line_number":563,"context_line":"                                \u0027/mnt/openstack/images/image.gz\u0027])"},{"line_number":564,"context_line":"            self.assertEqual(exp_cmd, cmd)"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"        def fake_md5sum_remote_file(remote_path):"},{"line_number":567,"context_line":"            return self.wrong_checksum"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjHE%3D","line":564,"in_reply_to":"AAAAOn%2F%2FjYQ%3D","updated":"2013-05-05 10:11:01.000000000","message":"I want to ensure that  the command is what I want to execute here, just follow line 468.","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d99e936f3076384051871fdd1941cf9a7478e843","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        # Create fake image file"},{"line_number":578,"context_line":"        img_file \u003d file(file_path, \u0027w\u0027)"},{"line_number":579,"context_line":"        img_file.write(\u0027this is a test fake image file\u0027)"},{"line_number":580,"context_line":"        img_file.close()"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"        try:"},{"line_number":583,"context_line":"            self._disk_adapter._copy_image_file(file_path, remote_path)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjYE%3D","line":580,"updated":"2013-05-04 14:33:53.000000000","message":"I would *really* try to restructure the code being tested so that you don\u0027t have to write a temporary file just to test some new exception handling in adjacent code. Perhaps breaking up the part of that function that does the md5sum of the local file would help?","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"414b29b37ff9ec3979eb4e313efaf4c42835ffb0","unresolved":false,"context_lines":[{"line_number":577,"context_line":"        # Create fake image file"},{"line_number":578,"context_line":"        img_file \u003d file(file_path, \u0027w\u0027)"},{"line_number":579,"context_line":"        img_file.write(\u0027this is a test fake image file\u0027)"},{"line_number":580,"context_line":"        img_file.close()"},{"line_number":581,"context_line":""},{"line_number":582,"context_line":"        try:"},{"line_number":583,"context_line":"            self._disk_adapter._copy_image_file(file_path, remote_path)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjHo%3D","line":580,"in_reply_to":"AAAAOn%2F%2FjYE%3D","updated":"2013-05-05 10:11:01.000000000","message":"Done","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"d99e936f3076384051871fdd1941cf9a7478e843","unresolved":false,"context_lines":[{"line_number":583,"context_line":"            self._disk_adapter._copy_image_file(file_path, remote_path)"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"        except exception.PowerVMFileTransferFailed:"},{"line_number":586,"context_line":"            self.exception_caught \u003d True"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"        # Clean up fake image file"},{"line_number":589,"context_line":"        os.remove(file_path)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjYA%3D","line":586,"updated":"2013-05-04 14:33:53.000000000","message":"You should be using self.assertRaises() instead of doing it this way.","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"414b29b37ff9ec3979eb4e313efaf4c42835ffb0","unresolved":false,"context_lines":[{"line_number":583,"context_line":"            self._disk_adapter._copy_image_file(file_path, remote_path)"},{"line_number":584,"context_line":""},{"line_number":585,"context_line":"        except exception.PowerVMFileTransferFailed:"},{"line_number":586,"context_line":"            self.exception_caught \u003d True"},{"line_number":587,"context_line":""},{"line_number":588,"context_line":"        # Clean up fake image file"},{"line_number":589,"context_line":"        os.remove(file_path)"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAAOn%2F%2FjHk%3D","line":586,"in_reply_to":"AAAAOn%2F%2FjYA%3D","updated":"2013-05-05 10:11:01.000000000","message":"Done","commit_id":"58d14681dfbd5cda45fd514cd86bdd3cda013dd9"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b7b3275479212dd17a549ea0dd38745b012e49d4","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        self.file_path \u003d os.tempnam(\u0027/tmp\u0027, \u0027image\u0027)"},{"line_number":555,"context_line":"        self.remote_path \u003d \u0027/mnt/openstack/images\u0027"},{"line_number":556,"context_line":"        self.wrong_checksum \u003d \u00273202937169\u0027"},{"line_number":557,"context_line":"        self.exp_checksum \u003d \u00273229026618\u0027"},{"line_number":558,"context_line":"        fake_noop \u003d lambda *args, **kwargs: None"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        def fake_run_vios_command_as_root(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2FjA8%3D","line":557,"updated":"2013-05-05 16:42:53.000000000","message":"Why are all of these instance variables?","commit_id":"d323dd7d6a33a8afda2891cff8dd1b442584929e"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"5063806d030cce4bb399d77674182fd2b0f93744","unresolved":false,"context_lines":[{"line_number":554,"context_line":"        self.file_path \u003d os.tempnam(\u0027/tmp\u0027, \u0027image\u0027)"},{"line_number":555,"context_line":"        self.remote_path \u003d \u0027/mnt/openstack/images\u0027"},{"line_number":556,"context_line":"        self.wrong_checksum \u003d \u00273202937169\u0027"},{"line_number":557,"context_line":"        self.exp_checksum \u003d \u00273229026618\u0027"},{"line_number":558,"context_line":"        fake_noop \u003d lambda *args, **kwargs: None"},{"line_number":559,"context_line":""},{"line_number":560,"context_line":"        def fake_run_vios_command_as_root(*args, **kwargs):"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2Fing%3D","line":557,"in_reply_to":"AAAAOn%2F%2FjA8%3D","updated":"2013-05-06 09:20:26.000000000","message":"Done","commit_id":"d323dd7d6a33a8afda2891cff8dd1b442584929e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b7b3275479212dd17a549ea0dd38745b012e49d4","unresolved":false,"context_lines":[{"line_number":563,"context_line":"                                           os.path.basename(self.file_path))"},{"line_number":564,"context_line":"            exp_cmd \u003d \u0027 \u0027.join([\u0027/usr/bin/rm -f\u0027,"},{"line_number":565,"context_line":"                                exp_remote_path])"},{"line_number":566,"context_line":"            self.assertEqual(exp_cmd, cmd)"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        def fake_md5sum_remote_file(remote_path):"},{"line_number":569,"context_line":"            return self.wrong_checksum"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2FjA4%3D","line":566,"updated":"2013-05-05 16:42:53.000000000","message":"I still think this should be done with self.mox.StubOutWithMock()\n\nIf the code you\u0027re testing fails to call this function, this test will not fail as you have it now.","commit_id":"d323dd7d6a33a8afda2891cff8dd1b442584929e"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"5063806d030cce4bb399d77674182fd2b0f93744","unresolved":false,"context_lines":[{"line_number":563,"context_line":"                                           os.path.basename(self.file_path))"},{"line_number":564,"context_line":"            exp_cmd \u003d \u0027 \u0027.join([\u0027/usr/bin/rm -f\u0027,"},{"line_number":565,"context_line":"                                exp_remote_path])"},{"line_number":566,"context_line":"            self.assertEqual(exp_cmd, cmd)"},{"line_number":567,"context_line":""},{"line_number":568,"context_line":"        def fake_md5sum_remote_file(remote_path):"},{"line_number":569,"context_line":"            return self.wrong_checksum"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2Fink%3D","line":566,"in_reply_to":"AAAAOn%2F%2FjA4%3D","updated":"2013-05-06 09:20:26.000000000","message":"Done","commit_id":"d323dd7d6a33a8afda2891cff8dd1b442584929e"}],"nova/virt/powervm/blockdev.py":[{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b7b3275479212dd17a549ea0dd38745b012e49d4","unresolved":false,"context_lines":[{"line_number":393,"context_line":"                hasher.update(buf)"},{"line_number":394,"context_line":"                buf \u003d img_file.read(block_size)"},{"line_number":395,"context_line":"            source_cksum \u003d hasher.hexdigest()"},{"line_number":396,"context_line":"        return source_cksum"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    def _copy_image_file(self, source_path, remote_path, decompress\u003dFalse):"},{"line_number":399,"context_line":"        \"\"\"Copy file to VIOS, decompress it, and return its new size and name."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2FjAs%3D","line":396,"updated":"2013-05-05 16:42:53.000000000","message":"Thanks for breaking this out. Please add a test for it.","commit_id":"d323dd7d6a33a8afda2891cff8dd1b442584929e"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"5063806d030cce4bb399d77674182fd2b0f93744","unresolved":false,"context_lines":[{"line_number":393,"context_line":"                hasher.update(buf)"},{"line_number":394,"context_line":"                buf \u003d img_file.read(block_size)"},{"line_number":395,"context_line":"            source_cksum \u003d hasher.hexdigest()"},{"line_number":396,"context_line":"        return source_cksum"},{"line_number":397,"context_line":""},{"line_number":398,"context_line":"    def _copy_image_file(self, source_path, remote_path, decompress\u003dFalse):"},{"line_number":399,"context_line":"        \"\"\"Copy file to VIOS, decompress it, and return its new size and name."}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2Fins%3D","line":396,"in_reply_to":"AAAAOn%2F%2FjAs%3D","updated":"2013-05-06 09:20:26.000000000","message":"Done","commit_id":"d323dd7d6a33a8afda2891cff8dd1b442584929e"},{"author":{"_account_id":4393,"name":"Dan Smith","email":"dms@danplanet.com","username":"danms"},"change_message_id":"b7b3275479212dd17a549ea0dd38745b012e49d4","unresolved":false,"context_lines":[{"line_number":525,"context_line":"                               local_file_path)"},{"line_number":526,"context_line":""},{"line_number":527,"context_line":"        # Calculate copied image checksum"},{"line_number":528,"context_line":"        dest_chksum \u003d self._checksum_local_file(local_file_path)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"        # do comparison"},{"line_number":531,"context_line":"        if source_chksum and dest_chksum !\u003d source_chksum:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2FjAw%3D","line":528,"updated":"2013-05-05 16:42:53.000000000","message":"This is not tested, AFAICT.","commit_id":"d323dd7d6a33a8afda2891cff8dd1b442584929e"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"5063806d030cce4bb399d77674182fd2b0f93744","unresolved":false,"context_lines":[{"line_number":525,"context_line":"                               local_file_path)"},{"line_number":526,"context_line":""},{"line_number":527,"context_line":"        # Calculate copied image checksum"},{"line_number":528,"context_line":"        dest_chksum \u003d self._checksum_local_file(local_file_path)"},{"line_number":529,"context_line":""},{"line_number":530,"context_line":"        # do comparison"},{"line_number":531,"context_line":"        if source_chksum and dest_chksum !\u003d source_chksum:"}],"source_content_type":"text/x-python","patch_set":9,"id":"AAAAOn%2F%2Fino%3D","line":528,"in_reply_to":"AAAAOn%2F%2FjAw%3D","updated":"2013-05-06 09:20:26.000000000","message":"Done","commit_id":"d323dd7d6a33a8afda2891cff8dd1b442584929e"},{"author":{"_account_id":6981,"name":"Yang Yu","email":"yangyu@vmware.com","username":"yuyangbj"},"change_message_id":"36f3ea310ccf720cbd7429b622352767c270fc19","unresolved":false,"context_lines":[{"line_number":531,"context_line":"        if source_chksum and dest_chksum !\u003d source_chksum:"},{"line_number":532,"context_line":"            LOG.error(_(\"Image checksums do not match\"))"},{"line_number":533,"context_line":"            msg_args \u003d {\u0027file_path\u0027: local_file_path}"},{"line_number":534,"context_line":"            raise exception.PowerVMFileTransferFailed(msg_args)"},{"line_number":535,"context_line":""},{"line_number":536,"context_line":"        # Cleanup transferred remote file"},{"line_number":537,"context_line":"        cmd \u003d \"/usr/bin/rm -f %s\" % copy_from_path"}],"source_content_type":"text/x-python","patch_set":11,"id":"AAAAOn%2F%2FfEY%3D","line":534,"updated":"2013-05-08 07:37:08.000000000","message":"I think here should be exception.PowerVMFileTransferFailed(**msg_args)","commit_id":"816bcf19c873a56200d760ee5b3d97cd8a95013b"},{"author":{"_account_id":5652,"name":"David Ripton","email":"dripton@redhat.com","username":"dripton"},"change_message_id":"e44c8aef352197e667387438ca27a85095dac30f","unresolved":false,"context_lines":[{"line_number":436,"context_line":"                self.run_vios_command_as_root(cmd)"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"                msg_args \u003d {\u0027file_path\u0027: final_path}"},{"line_number":439,"context_line":"                raise exception.PowerVMFileTransferFailed(**msg_args)"},{"line_number":440,"context_line":"            if source_cksum !\u003d output.split(\u0027 \u0027)[0]:"},{"line_number":441,"context_line":"                LOG.error(_(\"Image checksums do not match\"))"},{"line_number":442,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAOn%2F%2FcdE%3D","line":439,"updated":"2013-05-09 13:58:03.000000000","message":"Why use the dictionary and ** syntax when there\u0027s only one keyword argument?","commit_id":"428c16af7c6272042f2d0aa587180e741657ceaa"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"12f8a31f15aaf60739b3a37624f7d13dc2273d95","unresolved":false,"context_lines":[{"line_number":436,"context_line":"                self.run_vios_command_as_root(cmd)"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"                msg_args \u003d {\u0027file_path\u0027: final_path}"},{"line_number":439,"context_line":"                raise exception.PowerVMFileTransferFailed(**msg_args)"},{"line_number":440,"context_line":"            if source_cksum !\u003d output.split(\u0027 \u0027)[0]:"},{"line_number":441,"context_line":"                LOG.error(_(\"Image checksums do not match\"))"},{"line_number":442,"context_line":""}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAOn%2F%2FcbA%3D","line":439,"in_reply_to":"AAAAOn%2F%2FcdE%3D","updated":"2013-05-09 14:25:17.000000000","message":"Just want to keep consistent with other places in this file.  will use one keyword argument .thanks","commit_id":"428c16af7c6272042f2d0aa587180e741657ceaa"},{"author":{"_account_id":5652,"name":"David Ripton","email":"dripton@redhat.com","username":"dripton"},"change_message_id":"e44c8aef352197e667387438ca27a85095dac30f","unresolved":false,"context_lines":[{"line_number":445,"context_line":"                self.run_vios_command_as_root(cmd)"},{"line_number":446,"context_line":""},{"line_number":447,"context_line":"                msg_args \u003d {\u0027file_path\u0027: final_path}"},{"line_number":448,"context_line":"                raise exception.PowerVMFileTransferFailed(**msg_args)"},{"line_number":449,"context_line":""},{"line_number":450,"context_line":"            if decompress:"},{"line_number":451,"context_line":"                # Unzip the image"}],"source_content_type":"text/x-python","patch_set":12,"id":"AAAAOn%2F%2FcdA%3D","line":448,"updated":"2013-05-09 13:58:03.000000000","message":"Why use the dict and ** syntax here?","commit_id":"428c16af7c6272042f2d0aa587180e741657ceaa"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"238f0ef5e414afa8211bdbfe73ad4335c591e581","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    def _checksum_local_file(self, source_path):"},{"line_number":384,"context_line":"        \"\"\"Calculate local file checksum."},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"        :param source_path: source file path"},{"line_number":387,"context_line":"        \"\"\""},{"line_number":388,"context_line":"        with open(source_path, \u0027r\u0027) as img_file:"},{"line_number":389,"context_line":"            hasher \u003d hashlib.md5()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOn%2F%2Fcaw%3D","line":386,"updated":"2013-05-09 14:44:48.000000000","message":"This is a nit, but I like to see :return in the method doc for what to expect to get back from a method.","commit_id":"85c257b8391233747de490f06896dff97ed2c70b"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"050cc47a229080c4b62ab6f4f3d2a969007b140c","unresolved":false,"context_lines":[{"line_number":383,"context_line":"    def _checksum_local_file(self, source_path):"},{"line_number":384,"context_line":"        \"\"\"Calculate local file checksum."},{"line_number":385,"context_line":""},{"line_number":386,"context_line":"        :param source_path: source file path"},{"line_number":387,"context_line":"        \"\"\""},{"line_number":388,"context_line":"        with open(source_path, \u0027r\u0027) as img_file:"},{"line_number":389,"context_line":"            hasher \u003d hashlib.md5()"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOn%2F%2FcPc%3D","line":386,"in_reply_to":"AAAAOn%2F%2Fcaw%3D","updated":"2013-05-09 15:46:31.000000000","message":"Done","commit_id":"85c257b8391233747de490f06896dff97ed2c70b"},{"author":{"_account_id":6873,"name":"Matt Riedemann","email":"mriedem.os@gmail.com","username":"mriedem"},"change_message_id":"238f0ef5e414afa8211bdbfe73ad4335c591e581","unresolved":false,"context_lines":[{"line_number":431,"context_line":"            if not output:"},{"line_number":432,"context_line":"                LOG.error(_(\"Unable to get checksum\"))"},{"line_number":433,"context_line":"                # Cleanup inconsistent remote file"},{"line_number":434,"context_line":"                cmd \u003d \"/usr/bin/rm -f %s\" % final_path"},{"line_number":435,"context_line":"                self.run_vios_command_as_root(cmd)"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"                raise exception.PowerVMFileTransferFailed(file_path\u003dfinal_path)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOn%2F%2Fcak%3D","line":434,"updated":"2013-05-09 14:44:48.000000000","message":"Is /usr/bin not on the PATH?","commit_id":"85c257b8391233747de490f06896dff97ed2c70b"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"050cc47a229080c4b62ab6f4f3d2a969007b140c","unresolved":false,"context_lines":[{"line_number":431,"context_line":"            if not output:"},{"line_number":432,"context_line":"                LOG.error(_(\"Unable to get checksum\"))"},{"line_number":433,"context_line":"                # Cleanup inconsistent remote file"},{"line_number":434,"context_line":"                cmd \u003d \"/usr/bin/rm -f %s\" % final_path"},{"line_number":435,"context_line":"                self.run_vios_command_as_root(cmd)"},{"line_number":436,"context_line":""},{"line_number":437,"context_line":"                raise exception.PowerVMFileTransferFailed(file_path\u003dfinal_path)"}],"source_content_type":"text/x-python","patch_set":13,"id":"AAAAOn%2F%2FcPI%3D","line":434,"in_reply_to":"AAAAOn%2F%2Fcak%3D","updated":"2013-05-09 15:46:31.000000000","message":"Using absolute path for the sake of safety , avoid  using  someone\u0027s rm script  to do other things","commit_id":"85c257b8391233747de490f06896dff97ed2c70b"},{"author":{"_account_id":2271,"name":"Michael Still","email":"mikal@stillhq.com","username":"mikalstill"},"change_message_id":"7d7f1eaa87367d4afb047c1b5675ddd80deb7688","unresolved":false,"context_lines":[{"line_number":394,"context_line":"                hasher.update(buf)"},{"line_number":395,"context_line":"                buf \u003d img_file.read(block_size)"},{"line_number":396,"context_line":"            source_cksum \u003d hasher.hexdigest()"},{"line_number":397,"context_line":"        return source_cksum"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":"    def _copy_image_file(self, source_path, remote_path, decompress\u003dFalse):"},{"line_number":400,"context_line":"        \"\"\"Copy file to VIOS, decompress it, and return its new size and name."}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAOn%2F%2FTr0%3D","line":397,"updated":"2013-05-15 05:08:41.000000000","message":"We have code similar to this in libvirt, and people complain about it all the time. The big problem is that if an image is large, nova-compute is going to lock up calculating this checksum. Because nova-compute is single threaded, you wont process any other work while performing this calculation.\n\nI wonder if you should add some time.sleep(0) calls? This would act as a yield of the thread for eventlet.\n\nHow big is a \"average\" powervm image?","commit_id":"aad1dd7b7b9a0f8465aacff9b7d6cfaf989db8cc"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"5538bb0e7ecccb1fc8744cd4c5e8433451c24335","unresolved":false,"context_lines":[{"line_number":394,"context_line":"                hasher.update(buf)"},{"line_number":395,"context_line":"                buf \u003d img_file.read(block_size)"},{"line_number":396,"context_line":"            source_cksum \u003d hasher.hexdigest()"},{"line_number":397,"context_line":"        return source_cksum"},{"line_number":398,"context_line":""},{"line_number":399,"context_line":"    def _copy_image_file(self, source_path, remote_path, decompress\u003dFalse):"},{"line_number":400,"context_line":"        \"\"\"Copy file to VIOS, decompress it, and return its new size and name."}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAO3%2F%2F9dY%3D","line":397,"in_reply_to":"AAAAOn%2F%2FTr0%3D","updated":"2013-05-16 02:40:11.000000000","message":"Thanks for your suggestion , average size is less than 10G . This patch  is only for clean up failed image transfers .  We\u0027d better have another patch for performance issue if we meet the issue that you metioned ,will keep one eye at that .","commit_id":"aad1dd7b7b9a0f8465aacff9b7d6cfaf989db8cc"},{"author":{"_account_id":1812,"name":"p-draigbrady","email":"P@draigBrady.com","username":"p-draigbrady"},"change_message_id":"87e0828e46a56c5f818ac43e4006d2ddde9a4ccd","unresolved":false,"context_lines":[{"line_number":432,"context_line":"            if not output:"},{"line_number":433,"context_line":"                LOG.error(_(\"Unable to get checksum\"))"},{"line_number":434,"context_line":"                # Cleanup inconsistent remote file"},{"line_number":435,"context_line":"                cmd \u003d \"/usr/bin/rm -f %s\" % final_path"},{"line_number":436,"context_line":"                self.run_vios_command_as_root(cmd)"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"                raise exception.PowerVMFileTransferFailed(file_path\u003dfinal_path)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPH%2F%2Fo2Y%3D","line":435,"updated":"2013-05-28 19:48:06.000000000","message":"It would be better to not specify an explicit path of /usr/bin if possible\n\nAre we absolutely sure final_path couldn\u0027t be \"something -r ~\"\nI\u0027d be happier if it was shell quoted.\nIf we didn\u0027t have to run this as root it would be better to use remove_path_on_error as is done elsewhere in nova","commit_id":"aad1dd7b7b9a0f8465aacff9b7d6cfaf989db8cc"},{"author":{"_account_id":6722,"name":"ChangBo Guo(gcb)","email":"guochbo@cn.ibm.com","username":"guochbo"},"change_message_id":"c52cb1a6541b0570954334bbf83686ee92fc9d43","unresolved":false,"context_lines":[{"line_number":432,"context_line":"            if not output:"},{"line_number":433,"context_line":"                LOG.error(_(\"Unable to get checksum\"))"},{"line_number":434,"context_line":"                # Cleanup inconsistent remote file"},{"line_number":435,"context_line":"                cmd \u003d \"/usr/bin/rm -f %s\" % final_path"},{"line_number":436,"context_line":"                self.run_vios_command_as_root(cmd)"},{"line_number":437,"context_line":""},{"line_number":438,"context_line":"                raise exception.PowerVMFileTransferFailed(file_path\u003dfinal_path)"}],"source_content_type":"text/x-python","patch_set":14,"id":"AAAAPH%2F%2Fn6U%3D","line":435,"in_reply_to":"AAAAPH%2F%2Fo2Y%3D","updated":"2013-05-29 01:51:11.000000000","message":"For the sake of safety, using  absolute path to avoid running other executive application named  rm in current work directory.\n\nYes , We\u0027re sure the final_path  couldn\u0027t be \"something -r ~\",  and  we need run this command as root on power host(IVM).\n\nThanks.","commit_id":"aad1dd7b7b9a0f8465aacff9b7d6cfaf989db8cc"}]}
