)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"dca2eef0527528fe6e27a4faab4dac2535e0c072","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-12-15 11:49:38 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Clean up image tmp file if c-vol get restarted"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When create volume from image, and then restart the"},{"line_number":10,"context_line":"cinder-volume process during image is downloading,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a7e1126_fa44ee74","line":7,"range":{"start_line":7,"start_character":33,"end_line":7,"end_character":36},"updated":"2015-12-17 16:10:40.000000000","message":"get-\u003e gets","commit_id":"915bc895e68510a53ae790eda3a72505764ff841"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"7b9daf8ad0a60a6adbf2ebe33c4279b691776100","unresolved":false,"context_lines":[{"line_number":4,"context_line":"Commit:     wanghao \u003cwanghao749@huawei.com\u003e"},{"line_number":5,"context_line":"CommitDate: 2015-12-15 11:49:38 +0800"},{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Clean up image tmp file if c-vol get restarted"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When create volume from image, and then restart the"},{"line_number":10,"context_line":"cinder-volume process during image is downloading,"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa69d971_36909d95","line":7,"range":{"start_line":7,"start_character":33,"end_line":7,"end_character":36},"in_reply_to":"3a7e1126_fa44ee74","updated":"2015-12-30 07:01:20.000000000","message":"Done","commit_id":"915bc895e68510a53ae790eda3a72505764ff841"},{"author":{"_account_id":16708,"name":"Kendall Nelson","display_name":"Kendall (diablo_rojo)","email":"kennelson11@gmail.com","username":"kjnelson"},"change_message_id":"dca2eef0527528fe6e27a4faab4dac2535e0c072","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Clean up image tmp file if c-vol get restarted"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When create volume from image, and then restart the"},{"line_number":10,"context_line":"cinder-volume process during image is downloading,"},{"line_number":11,"context_line":"cinder can\u0027t clean up the image tmp file under image"},{"line_number":12,"context_line":"conversion dir."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a7e1126_d5ab03d5","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":49},"updated":"2015-12-17 16:10:40.000000000","message":"Suggest: \"When creating a volume from an image and then restarting the cinder-volume process while the image is downloading,... \"","commit_id":"915bc895e68510a53ae790eda3a72505764ff841"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"7b9daf8ad0a60a6adbf2ebe33c4279b691776100","unresolved":false,"context_lines":[{"line_number":6,"context_line":""},{"line_number":7,"context_line":"Clean up image tmp file if c-vol get restarted"},{"line_number":8,"context_line":""},{"line_number":9,"context_line":"When create volume from image, and then restart the"},{"line_number":10,"context_line":"cinder-volume process during image is downloading,"},{"line_number":11,"context_line":"cinder can\u0027t clean up the image tmp file under image"},{"line_number":12,"context_line":"conversion dir."},{"line_number":13,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa69d971_969389a3","line":10,"range":{"start_line":9,"start_character":0,"end_line":10,"end_character":49},"in_reply_to":"3a7e1126_d5ab03d5","updated":"2015-12-30 07:01:20.000000000","message":"Done","commit_id":"915bc895e68510a53ae790eda3a72505764ff841"}],"cinder/image/image_utils.py":[{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"83eb819dad1430ea2f833d8c59ba12b831ebcaed","unresolved":false,"context_lines":[{"line_number":452,"context_line":"    if (CONF.image_conversion_dir and not"},{"line_number":453,"context_line":"            os.path.exists(CONF.image_conversion_dir)):"},{"line_number":454,"context_line":"        return"},{"line_number":455,"context_line":"    conf_dir \u003d CONF.image_conversion_dir"},{"line_number":456,"context_line":"    temp_dir \u003d conf_dir if conf_dir else tempfile.gettempdir()"},{"line_number":457,"context_line":"    files \u003d os.listdir(temp_dir)"},{"line_number":458,"context_line":"    for file in files:"},{"line_number":459,"context_line":"        if volume_id in file:"}],"source_content_type":"text/x-python","patch_set":9,"id":"7af24918_536c6636","line":456,"range":{"start_line":455,"start_character":4,"end_line":456,"end_character":62},"updated":"2016-03-04 19:40:30.000000000","message":"Not following this code.  image_conversion_dir should if nothing else have the default ($state_path/conversion).  If the config var is not set, wouldn\u0027t it be better to fail the request here?","commit_id":"e4cda8525d84a7772dd0748cb836e5afb5936dd6"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"e7be6748b34021140ddfda4618107a839f574132","unresolved":false,"context_lines":[{"line_number":452,"context_line":"    if (CONF.image_conversion_dir and not"},{"line_number":453,"context_line":"            os.path.exists(CONF.image_conversion_dir)):"},{"line_number":454,"context_line":"        return"},{"line_number":455,"context_line":"    conf_dir \u003d CONF.image_conversion_dir"},{"line_number":456,"context_line":"    temp_dir \u003d conf_dir if conf_dir else tempfile.gettempdir()"},{"line_number":457,"context_line":"    files \u003d os.listdir(temp_dir)"},{"line_number":458,"context_line":"    for file in files:"},{"line_number":459,"context_line":"        if volume_id in file:"}],"source_content_type":"text/x-python","patch_set":9,"id":"5aef4532_244cc241","line":456,"range":{"start_line":455,"start_character":4,"end_line":456,"end_character":62},"in_reply_to":"7af24918_536c6636","updated":"2016-03-08 01:44:35.000000000","message":"yes, it\u0027s better. I prefer to log some message and return.","commit_id":"e4cda8525d84a7772dd0748cb836e5afb5936dd6"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"83eb819dad1430ea2f833d8c59ba12b831ebcaed","unresolved":false,"context_lines":[{"line_number":541,"context_line":""},{"line_number":542,"context_line":"    @classmethod"},{"line_number":543,"context_line":"    @contextlib.contextmanager"},{"line_number":544,"context_line":"    def fetch(cls, image_service, context, image_id, volume_id\u003d\u0027\u0027):"},{"line_number":545,"context_line":"        tmp_images \u003d cls.for_image_service(image_service).temporary_images"},{"line_number":546,"context_line":"        with temporary_file(prefix\u003d\u0027tmp\u0027 + volume_id) as tmp:"},{"line_number":547,"context_line":"            fetch_verify_image(context, image_service, image_id, tmp)"}],"source_content_type":"text/x-python","patch_set":9,"id":"7af24918_335a7a51","line":544,"range":{"start_line":544,"start_character":53,"end_line":544,"end_character":62},"updated":"2016-03-04 19:40:30.000000000","message":"do we need to add the volume_id?  Not opposed just curious?  Seems like we should be able to just delete the contents of $state_path/conversion on an init and be good.  There shouldn\u0027t be anything there that we would trust after a restart I don\u0027t think.","commit_id":"e4cda8525d84a7772dd0748cb836e5afb5936dd6"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"e7be6748b34021140ddfda4618107a839f574132","unresolved":false,"context_lines":[{"line_number":541,"context_line":""},{"line_number":542,"context_line":"    @classmethod"},{"line_number":543,"context_line":"    @contextlib.contextmanager"},{"line_number":544,"context_line":"    def fetch(cls, image_service, context, image_id, volume_id\u003d\u0027\u0027):"},{"line_number":545,"context_line":"        tmp_images \u003d cls.for_image_service(image_service).temporary_images"},{"line_number":546,"context_line":"        with temporary_file(prefix\u003d\u0027tmp\u0027 + volume_id) as tmp:"},{"line_number":547,"context_line":"            fetch_verify_image(context, image_service, image_id, tmp)"}],"source_content_type":"text/x-python","patch_set":9,"id":"5aef4532_e4cadaa0","line":544,"range":{"start_line":544,"start_character":53,"end_line":544,"end_character":62},"in_reply_to":"7af24918_335a7a51","updated":"2016-03-08 01:44:35.000000000","message":"originally, I just want to delete those tmp file that their volumes have downloading or deleting state, but you\u0027re right, we just need to clear the tmp dir.","commit_id":"e4cda8525d84a7772dd0748cb836e5afb5936dd6"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"4f55ff13b852606745e0957ae7605447b1171bc4","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"def cleanup_temporary_file(backend_name):"},{"line_number":452,"context_line":"    if (CONF.image_conversion_dir is None or not"},{"line_number":453,"context_line":"            os.path.exists(CONF.image_conversion_dir)):"},{"line_number":454,"context_line":"        LOG.debug(\"Configuration image_conversion_dir is None or the path \""},{"line_number":455,"context_line":"                  \"isn\u0027t existing.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afc51ec_894041a7","line":452,"updated":"2016-03-14 09:41:03.000000000","message":"We need a test case for this case and the exception in line 468.","commit_id":"3eb6c6afeb48a4a4138a4fc15c7864d40a87eb79"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"11bc4ee2ec48602f86acf22e57dd651e8e2343c0","unresolved":false,"context_lines":[{"line_number":449,"context_line":""},{"line_number":450,"context_line":""},{"line_number":451,"context_line":"def cleanup_temporary_file(backend_name):"},{"line_number":452,"context_line":"    if (CONF.image_conversion_dir is None or not"},{"line_number":453,"context_line":"            os.path.exists(CONF.image_conversion_dir)):"},{"line_number":454,"context_line":"        LOG.debug(\"Configuration image_conversion_dir is None or the path \""},{"line_number":455,"context_line":"                  \"isn\u0027t existing.\")"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afc51ec_60baf16f","line":452,"in_reply_to":"3afc51ec_894041a7","updated":"2016-03-15 03:48:15.000000000","message":"Done","commit_id":"3eb6c6afeb48a4a4138a4fc15c7864d40a87eb79"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"4f55ff13b852606745e0957ae7605447b1171bc4","unresolved":false,"context_lines":[{"line_number":466,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":467,"context_line":"                os.remove(path)"},{"line_number":468,"context_line":"    except Exception as e:"},{"line_number":469,"context_line":"        LOG.exception(_LE(\"Clear temporary file catching exception %s\"), e)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"@contextlib.contextmanager"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afc51ec_49b599ec","line":469,"updated":"2016-03-14 09:41:03.000000000","message":"This should only be an info or warning.","commit_id":"3eb6c6afeb48a4a4138a4fc15c7864d40a87eb79"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"11bc4ee2ec48602f86acf22e57dd651e8e2343c0","unresolved":false,"context_lines":[{"line_number":466,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":467,"context_line":"                os.remove(path)"},{"line_number":468,"context_line":"    except Exception as e:"},{"line_number":469,"context_line":"        LOG.exception(_LE(\"Clear temporary file catching exception %s\"), e)"},{"line_number":470,"context_line":""},{"line_number":471,"context_line":""},{"line_number":472,"context_line":"@contextlib.contextmanager"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afc51ec_c0b14591","line":469,"in_reply_to":"3afc51ec_49b599ec","updated":"2016-03-15 03:48:15.000000000","message":"Done","commit_id":"3eb6c6afeb48a4a4138a4fc15c7864d40a87eb79"},{"author":{"_account_id":12732,"name":"Bin Zhou","email":"zhou.bin9@zte.com.cn","username":"BinZhou"},"change_message_id":"21d51b77f91ddf52247ff2cb73317ad532b920e0","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"bab6814e_764f5d6b","updated":"2016-05-20 06:50:54.000000000","message":"I think the logic here is not rigorous. If one backend_name is \u0027test\u0027 and the other is \u0027test_back\u0027, when the backend \u0027test\u0027 is up, it would clean the tmp files which belongs to \u0027test_back\u0027.","commit_id":"a02ddd3f86c1bf7bce506b2bfe4432fb110c130c"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"22ce273a50aa63f22d9e9cebc51279f6557f65fb","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":17,"id":"bab6814e_c8f65af8","in_reply_to":"bab6814e_764f5d6b","updated":"2016-05-20 12:25:41.000000000","message":"Emm, this could happen, maybe name + hash value could fix this, thoughts?","commit_id":"a02ddd3f86c1bf7bce506b2bfe4432fb110c130c"},{"author":{"_account_id":1736,"name":"Ivan Kolodyazhny","email":"e0ne@e0ne.info","username":"e0ne"},"change_message_id":"6df8dc3691ef100f730527fceb614ed3367423de","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":509,"context_line":"                os.remove(path)"},{"line_number":510,"context_line":"    except Exception as e:"},{"line_number":511,"context_line":"        LOG.warning(_LW(\"Clear temporary file catching exception %s\"), e)"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"@contextlib.contextmanager"}],"source_content_type":"text/x-python","patch_set":20,"id":"ba5da102_3f4daf6c","line":511,"updated":"2016-10-31 12:23:15.000000000","message":"Can we catch more specific exception here?","commit_id":"163196481d25ab72f3b45a40497957963ca74824"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"7b0ccb7dcd4a7d1f4c5b153d5ebebbc6b9800969","unresolved":false,"context_lines":[{"line_number":508,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":509,"context_line":"                os.remove(path)"},{"line_number":510,"context_line":"    except Exception as e:"},{"line_number":511,"context_line":"        LOG.warning(_LW(\"Clear temporary file catching exception %s\"), e)"},{"line_number":512,"context_line":""},{"line_number":513,"context_line":""},{"line_number":514,"context_line":"@contextlib.contextmanager"}],"source_content_type":"text/x-python","patch_set":20,"id":"9a629dbe_2fe154ff","line":511,"in_reply_to":"ba5da102_3f4daf6c","updated":"2016-11-14 07:33:33.000000000","message":"Sure.","commit_id":"163196481d25ab72f3b45a40497957963ca74824"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"9acdb8d5917ac9948c14641eda826ddfb3be3c03","unresolved":false,"context_lines":[{"line_number":495,"context_line":"    if (CONF.image_conversion_dir is None or not"},{"line_number":496,"context_line":"            os.path.exists(CONF.image_conversion_dir)):"},{"line_number":497,"context_line":"        LOG.debug(\"Configuration image_conversion_dir is None or the path \""},{"line_number":498,"context_line":"                  \"isn\u0027t existing.\")"},{"line_number":499,"context_line":"        return"},{"line_number":500,"context_line":"    try:"},{"line_number":501,"context_line":"        files \u003d os.listdir(CONF.image_conversion_dir)"}],"source_content_type":"text/x-python","patch_set":22,"id":"5a74a57a_3ff4d9cd","line":498,"range":{"start_line":498,"start_character":19,"end_line":498,"end_character":33},"updated":"2016-12-01 01:50:15.000000000","message":"s/isn\u0027t existing/doesn\u0027t exist/","commit_id":"4a28d624217d6be1a7f90f6c6b264fb54bb27705"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"9ca9fe6b237318192988b6d470a32ef0dcbdd1be","unresolved":false,"context_lines":[{"line_number":495,"context_line":"    if (CONF.image_conversion_dir is None or not"},{"line_number":496,"context_line":"            os.path.exists(CONF.image_conversion_dir)):"},{"line_number":497,"context_line":"        LOG.debug(\"Configuration image_conversion_dir is None or the path \""},{"line_number":498,"context_line":"                  \"isn\u0027t existing.\")"},{"line_number":499,"context_line":"        return"},{"line_number":500,"context_line":"    try:"},{"line_number":501,"context_line":"        files \u003d os.listdir(CONF.image_conversion_dir)"}],"source_content_type":"text/x-python","patch_set":22,"id":"5a74a57a_fa142f4e","line":498,"range":{"start_line":498,"start_character":19,"end_line":498,"end_character":33},"in_reply_to":"5a74a57a_3ff4d9cd","updated":"2016-12-01 02:57:41.000000000","message":"Done","commit_id":"4a28d624217d6be1a7f90f6c6b264fb54bb27705"},{"author":{"_account_id":11904,"name":"Sean McGinnis","email":"sean.mcginnis@gmail.com","username":"SeanM"},"change_message_id":"9acdb8d5917ac9948c14641eda826ddfb3be3c03","unresolved":false,"context_lines":[{"line_number":509,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":510,"context_line":"                os.remove(path)"},{"line_number":511,"context_line":"    except OSError as e:"},{"line_number":512,"context_line":"        LOG.warning(_LW(\"Clear temporary file catching exception %s\"),"},{"line_number":513,"context_line":"                    six.text_type(e))"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"5a74a57a_dfdcc548","line":512,"range":{"start_line":512,"start_character":25,"end_line":512,"end_character":64},"updated":"2016-12-01 01:50:15.000000000","message":"I think this would sound better changed to something like:\n\nException caught while clearing temporary image files: %s","commit_id":"4a28d624217d6be1a7f90f6c6b264fb54bb27705"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"9ca9fe6b237318192988b6d470a32ef0dcbdd1be","unresolved":false,"context_lines":[{"line_number":509,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":510,"context_line":"                os.remove(path)"},{"line_number":511,"context_line":"    except OSError as e:"},{"line_number":512,"context_line":"        LOG.warning(_LW(\"Clear temporary file catching exception %s\"),"},{"line_number":513,"context_line":"                    six.text_type(e))"},{"line_number":514,"context_line":""},{"line_number":515,"context_line":""}],"source_content_type":"text/x-python","patch_set":22,"id":"5a74a57a_2513e85d","line":512,"range":{"start_line":512,"start_character":25,"end_line":512,"end_character":64},"in_reply_to":"5a74a57a_dfdcc548","updated":"2016-12-01 02:57:41.000000000","message":"Sure","commit_id":"4a28d624217d6be1a7f90f6c6b264fb54bb27705"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"531823d44265ad535b0718ee385f541d12fea0f8","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        # starting but another backend is up and doing an image conversion,"},{"line_number":505,"context_line":"        # init_host should only clean the tmp files which belongs to its"},{"line_number":506,"context_line":"        # backend."},{"line_number":507,"context_line":"        for tmp_file in files:"},{"line_number":508,"context_line":"            if backend_name in tmp_file:"},{"line_number":509,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":510,"context_line":"                os.remove(path)"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a71b18c_e17d9fb2","line":507,"updated":"2016-12-07 21:39:42.000000000","message":"This should be:\n\n    for tmp_file in os.scandir(CONF.image_conversion_dir):\n\nThis will use an iterator instead of a list and perform better if something has created many files in this directory.\n\nThis code also fails if any subdirectories exist here that match the search criteria, because it includes dirs and not just files.","commit_id":"c331ff710ab416c109a7a98ab9e33bbf52eec89d"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"ddb13b31293d444ff1b4e6960d005b5994d05207","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        # starting but another backend is up and doing an image conversion,"},{"line_number":505,"context_line":"        # init_host should only clean the tmp files which belongs to its"},{"line_number":506,"context_line":"        # backend."},{"line_number":507,"context_line":"        for tmp_file in files:"},{"line_number":508,"context_line":"            if backend_name in tmp_file:"},{"line_number":509,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":510,"context_line":"                os.remove(path)"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a6eadb0_7be62ab1","line":507,"in_reply_to":"1a6eadb0_ec536ae0","updated":"2016-12-15 00:57:32.000000000","message":"Sure.","commit_id":"c331ff710ab416c109a7a98ab9e33bbf52eec89d"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"17a93ef8b7f5a74fcb2a5358c94692bdb51194a2","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        # starting but another backend is up and doing an image conversion,"},{"line_number":505,"context_line":"        # init_host should only clean the tmp files which belongs to its"},{"line_number":506,"context_line":"        # backend."},{"line_number":507,"context_line":"        for tmp_file in files:"},{"line_number":508,"context_line":"            if backend_name in tmp_file:"},{"line_number":509,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":510,"context_line":"                os.remove(path)"}],"source_content_type":"text/x-python","patch_set":24,"id":"1a6eadb0_ec536ae0","line":507,"in_reply_to":"3a71b18c_dad2085b","updated":"2016-12-14 22:09:02.000000000","message":"Hmm.  I may settle for a #TODO here for now if there isn\u0027t a straightforward way to do this.","commit_id":"c331ff710ab416c109a7a98ab9e33bbf52eec89d"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"b22a12e2e49590ee6fed3a1b77e3a3a47917e3ef","unresolved":false,"context_lines":[{"line_number":504,"context_line":"        # starting but another backend is up and doing an image conversion,"},{"line_number":505,"context_line":"        # init_host should only clean the tmp files which belongs to its"},{"line_number":506,"context_line":"        # backend."},{"line_number":507,"context_line":"        for tmp_file in files:"},{"line_number":508,"context_line":"            if backend_name in tmp_file:"},{"line_number":509,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":510,"context_line":"                os.remove(path)"}],"source_content_type":"text/x-python","patch_set":24,"id":"3a71b18c_dad2085b","line":507,"in_reply_to":"3a71b18c_e17d9fb2","updated":"2016-12-09 06:51:20.000000000","message":"Thanks Eric,  but I tested scandir() and os.listdir, they\u0027re both can\u0027t find files in subdirectories,  and when only using Python version 3.5+, os.scandir() are available in the standard library.\n\nSo I think should we use os.walk() to solve subdirectories issue?","commit_id":"c331ff710ab416c109a7a98ab9e33bbf52eec89d"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"daa745a8bcf028d6742fca221ff285da1e436bd4","unresolved":false,"context_lines":[{"line_number":492,"context_line":""},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"def cleanup_temporary_file(backend_name):"},{"line_number":495,"context_line":"    if (CONF.image_conversion_dir is None or not"},{"line_number":496,"context_line":"            os.path.exists(CONF.image_conversion_dir)):"},{"line_number":497,"context_line":"        LOG.debug(\"Configuration image_conversion_dir is None or the path \""},{"line_number":498,"context_line":"                  \"doesn\u0027t exist.\")"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_af6fea90","line":495,"range":{"start_line":495,"start_character":8,"end_line":495,"end_character":41},"updated":"2017-01-13 16:10:11.000000000","message":"nit: Better to cover here the \u0027\u0027 case as well using `not CONF.image_conversion_dir` instead","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"424929c036d4743c518654d08e49af296d755fff","unresolved":false,"context_lines":[{"line_number":492,"context_line":""},{"line_number":493,"context_line":""},{"line_number":494,"context_line":"def cleanup_temporary_file(backend_name):"},{"line_number":495,"context_line":"    if (CONF.image_conversion_dir is None or not"},{"line_number":496,"context_line":"            os.path.exists(CONF.image_conversion_dir)):"},{"line_number":497,"context_line":"        LOG.debug(\"Configuration image_conversion_dir is None or the path \""},{"line_number":498,"context_line":"                  \"doesn\u0027t exist.\")"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_54915946","line":495,"range":{"start_line":495,"start_character":8,"end_line":495,"end_character":41},"in_reply_to":"7a3c09a3_af6fea90","updated":"2017-01-17 02:26:47.000000000","message":"Sure","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"daa745a8bcf028d6742fca221ff285da1e436bd4","unresolved":false,"context_lines":[{"line_number":498,"context_line":"                  \"doesn\u0027t exist.\")"},{"line_number":499,"context_line":"        return"},{"line_number":500,"context_line":"    try:"},{"line_number":501,"context_line":"        # TODO(wanghao): Consider to use os.scandir for better performance in"},{"line_number":502,"context_line":"        # further when cinder only supports Python version 3.5+."},{"line_number":503,"context_line":"        files \u003d os.listdir(CONF.image_conversion_dir)"},{"line_number":504,"context_line":"        temp_dir \u003d CONF.image_conversion_dir"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_4f41260b","line":501,"range":{"start_line":501,"start_character":34,"end_line":501,"end_character":40},"updated":"2017-01-13 16:10:11.000000000","message":"nit: using","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"424929c036d4743c518654d08e49af296d755fff","unresolved":false,"context_lines":[{"line_number":498,"context_line":"                  \"doesn\u0027t exist.\")"},{"line_number":499,"context_line":"        return"},{"line_number":500,"context_line":"    try:"},{"line_number":501,"context_line":"        # TODO(wanghao): Consider to use os.scandir for better performance in"},{"line_number":502,"context_line":"        # further when cinder only supports Python version 3.5+."},{"line_number":503,"context_line":"        files \u003d os.listdir(CONF.image_conversion_dir)"},{"line_number":504,"context_line":"        temp_dir \u003d CONF.image_conversion_dir"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_54b879c8","line":501,"range":{"start_line":501,"start_character":34,"end_line":501,"end_character":40},"in_reply_to":"7a3c09a3_4f41260b","updated":"2017-01-17 02:26:47.000000000","message":"Done","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"0934823f143e3c258599abc8d4be73596015db64","unresolved":false,"context_lines":[{"line_number":499,"context_line":"        return"},{"line_number":500,"context_line":"    try:"},{"line_number":501,"context_line":"        # TODO(wanghao): Consider to use os.scandir for better performance in"},{"line_number":502,"context_line":"        # further when cinder only supports Python version 3.5+."},{"line_number":503,"context_line":"        files \u003d os.listdir(CONF.image_conversion_dir)"},{"line_number":504,"context_line":"        temp_dir \u003d CONF.image_conversion_dir"},{"line_number":505,"context_line":"        # NOTE(wanghao): For multi-backend case, if one backend was slow"}],"source_content_type":"text/x-python","patch_set":25,"id":"da4df55a_6456022b","line":502,"range":{"start_line":502,"start_character":10,"end_line":502,"end_character":17},"updated":"2016-12-22 18:36:18.000000000","message":"further -\u003e future","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"424929c036d4743c518654d08e49af296d755fff","unresolved":false,"context_lines":[{"line_number":499,"context_line":"        return"},{"line_number":500,"context_line":"    try:"},{"line_number":501,"context_line":"        # TODO(wanghao): Consider to use os.scandir for better performance in"},{"line_number":502,"context_line":"        # further when cinder only supports Python version 3.5+."},{"line_number":503,"context_line":"        files \u003d os.listdir(CONF.image_conversion_dir)"},{"line_number":504,"context_line":"        temp_dir \u003d CONF.image_conversion_dir"},{"line_number":505,"context_line":"        # NOTE(wanghao): For multi-backend case, if one backend was slow"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_74bd75b6","line":502,"range":{"start_line":502,"start_character":10,"end_line":502,"end_character":17},"in_reply_to":"da4df55a_6456022b","updated":"2017-01-17 02:26:47.000000000","message":"Done","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"daa745a8bcf028d6742fca221ff285da1e436bd4","unresolved":false,"context_lines":[{"line_number":501,"context_line":"        # TODO(wanghao): Consider to use os.scandir for better performance in"},{"line_number":502,"context_line":"        # further when cinder only supports Python version 3.5+."},{"line_number":503,"context_line":"        files \u003d os.listdir(CONF.image_conversion_dir)"},{"line_number":504,"context_line":"        temp_dir \u003d CONF.image_conversion_dir"},{"line_number":505,"context_line":"        # NOTE(wanghao): For multi-backend case, if one backend was slow"},{"line_number":506,"context_line":"        # starting but another backend is up and doing an image conversion,"},{"line_number":507,"context_line":"        # init_host should only clean the tmp files which belongs to its"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_efbbb20c","line":504,"updated":"2017-01-13 16:10:11.000000000","message":"nit: Set this at L495 and use in L496","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"424929c036d4743c518654d08e49af296d755fff","unresolved":false,"context_lines":[{"line_number":501,"context_line":"        # TODO(wanghao): Consider to use os.scandir for better performance in"},{"line_number":502,"context_line":"        # further when cinder only supports Python version 3.5+."},{"line_number":503,"context_line":"        files \u003d os.listdir(CONF.image_conversion_dir)"},{"line_number":504,"context_line":"        temp_dir \u003d CONF.image_conversion_dir"},{"line_number":505,"context_line":"        # NOTE(wanghao): For multi-backend case, if one backend was slow"},{"line_number":506,"context_line":"        # starting but another backend is up and doing an image conversion,"},{"line_number":507,"context_line":"        # init_host should only clean the tmp files which belongs to its"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_14c35139","line":504,"in_reply_to":"7a3c09a3_efbbb20c","updated":"2017-01-17 02:26:47.000000000","message":"Done","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"daa745a8bcf028d6742fca221ff285da1e436bd4","unresolved":false,"context_lines":[{"line_number":507,"context_line":"        # init_host should only clean the tmp files which belongs to its"},{"line_number":508,"context_line":"        # backend."},{"line_number":509,"context_line":"        for tmp_file in files:"},{"line_number":510,"context_line":"            if backend_name in tmp_file:"},{"line_number":511,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":512,"context_line":"                os.remove(path)"},{"line_number":513,"context_line":"    except OSError as e:"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_ef1732eb","line":510,"updated":"2017-01-13 16:10:11.000000000","message":"-1: This kind of check seems dangerous to me, what if we have 2 different backends and one is a substring of the other?   Since the backend_name is a suffix we should be using backend_name.endswith","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"424929c036d4743c518654d08e49af296d755fff","unresolved":false,"context_lines":[{"line_number":507,"context_line":"        # init_host should only clean the tmp files which belongs to its"},{"line_number":508,"context_line":"        # backend."},{"line_number":509,"context_line":"        for tmp_file in files:"},{"line_number":510,"context_line":"            if backend_name in tmp_file:"},{"line_number":511,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":512,"context_line":"                os.remove(path)"},{"line_number":513,"context_line":"    except OSError as e:"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_cfc69299","line":510,"in_reply_to":"7a3c09a3_ef1732eb","updated":"2017-01-17 02:26:47.000000000","message":"yes, it\u0027s a issue,  tmp_file.endswith(backend_name) could fix this. thanks Gorka.","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"daa745a8bcf028d6742fca221ff285da1e436bd4","unresolved":false,"context_lines":[{"line_number":512,"context_line":"                os.remove(path)"},{"line_number":513,"context_line":"    except OSError as e:"},{"line_number":514,"context_line":"        LOG.warning(_LW(\"Exception caught while clearing temporary image \""},{"line_number":515,"context_line":"                        \"files: %s\"), six.text_type(e))"},{"line_number":516,"context_line":""},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"@contextlib.contextmanager"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_8f95ce41","line":515,"range":{"start_line":515,"start_character":38,"end_line":515,"end_character":51},"updated":"2017-01-13 16:10:11.000000000","message":"-1: We shouldn\u0027t use six.text_type here as indicated in the guidelines","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"424929c036d4743c518654d08e49af296d755fff","unresolved":false,"context_lines":[{"line_number":512,"context_line":"                os.remove(path)"},{"line_number":513,"context_line":"    except OSError as e:"},{"line_number":514,"context_line":"        LOG.warning(_LW(\"Exception caught while clearing temporary image \""},{"line_number":515,"context_line":"                        \"files: %s\"), six.text_type(e))"},{"line_number":516,"context_line":""},{"line_number":517,"context_line":""},{"line_number":518,"context_line":"@contextlib.contextmanager"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_2f1636f1","line":515,"range":{"start_line":515,"start_character":38,"end_line":515,"end_character":51},"in_reply_to":"7a3c09a3_8f95ce41","updated":"2017-01-17 02:26:47.000000000","message":"Done","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"77331260d49af715dadc2e921ab26cd2c035ce70","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        # starting but another backend is up and doing an image conversion,"},{"line_number":506,"context_line":"        # init_host should only clean the tmp files which belongs to its"},{"line_number":507,"context_line":"        # backend."},{"line_number":508,"context_line":"        for tmp_file in files:"},{"line_number":509,"context_line":"            if tmp_file.endswith(backend_name):"},{"line_number":510,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":511,"context_line":"                os.remove(path)"},{"line_number":512,"context_line":"    except OSError as e:"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_2c2556c0","line":509,"range":{"start_line":508,"start_character":0,"end_line":509,"end_character":47},"updated":"2017-01-17 09:51:09.000000000","message":"What if one of the backends is called \"bar\" and second one is called \"foobar\"? \"bar\" will match files from both backends.","commit_id":"def9485d8d8a2fd7f83873f54ac318c1968c0811"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"2830ba022a052fd95adc866235ba3177b874bf47","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        # starting but another backend is up and doing an image conversion,"},{"line_number":506,"context_line":"        # init_host should only clean the tmp files which belongs to its"},{"line_number":507,"context_line":"        # backend."},{"line_number":508,"context_line":"        for tmp_file in files:"},{"line_number":509,"context_line":"            if tmp_file.endswith(backend_name):"},{"line_number":510,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":511,"context_line":"                os.remove(path)"},{"line_number":512,"context_line":"    except OSError as e:"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_38f11096","line":509,"range":{"start_line":508,"start_character":0,"end_line":509,"end_character":47},"in_reply_to":"7a3c09a3_2c2556c0","updated":"2017-01-17 11:14:10.000000000","message":"That\u0027s not possible, because for that to be possible we would have to have 2 different backends with the same name and then the host of one of them to be a substring of the other one.  And while the second one is possible, we cannot have 2 different backends with the same name on the same config.\n\nWhat we would need:\n\n coolhostname@backend\n hostname@backend\n\nAnd we can use backend_host configuration option to have those values, but we cannot have 2 different elements of enabled_backends having the same value.","commit_id":"def9485d8d8a2fd7f83873f54ac318c1968c0811"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"fff8d51caa563080ed2ca6463e966fd2fc02c8c2","unresolved":false,"context_lines":[{"line_number":505,"context_line":"        # starting but another backend is up and doing an image conversion,"},{"line_number":506,"context_line":"        # init_host should only clean the tmp files which belongs to its"},{"line_number":507,"context_line":"        # backend."},{"line_number":508,"context_line":"        for tmp_file in files:"},{"line_number":509,"context_line":"            if tmp_file.endswith(backend_name):"},{"line_number":510,"context_line":"                path \u003d os.path.join(temp_dir, tmp_file)"},{"line_number":511,"context_line":"                os.remove(path)"},{"line_number":512,"context_line":"    except OSError as e:"}],"source_content_type":"text/x-python","patch_set":27,"id":"7a3c09a3_4298a6c0","line":509,"range":{"start_line":508,"start_character":0,"end_line":509,"end_character":47},"in_reply_to":"7a3c09a3_38f11096","updated":"2017-01-17 11:21:39.000000000","message":"Oh, okay, this will be in host@backend form, not backend. Then it\u0027s fine, thanks!","commit_id":"def9485d8d8a2fd7f83873f54ac318c1968c0811"}],"cinder/tests/unit/test_image_utils.py":[{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"4f55ff13b852606745e0957ae7605447b1171bc4","unresolved":false,"context_lines":[{"line_number":1384,"context_line":"    @mock.patch(\u0027cinder.image.image_utils.CONF\u0027)"},{"line_number":1385,"context_line":"    @mock.patch(\u0027cinder.image.image_utils.os.listdir\u0027)"},{"line_number":1386,"context_line":"    @mock.patch(\u0027cinder.image.image_utils.os.path.exists\u0027, return_value\u003dTrue)"},{"line_number":1387,"context_line":"    def test_cleanup_temporary_file(self, mock_patch, mock_listdir, mock_conf,"},{"line_number":1388,"context_line":"                                    mock_join, mock_remove):"},{"line_number":1389,"context_line":"        mock_listdir.return_value \u003d [\u0027tmphost@backend1\u0027]"},{"line_number":1390,"context_line":"        conv_dir \u003d mock.sentinel.image_conversion_dir"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afc51ec_4983d904","line":1387,"range":{"start_line":1387,"start_character":47,"end_line":1387,"end_character":52},"updated":"2016-03-14 09:41:03.000000000","message":"patch -\u003e path","commit_id":"3eb6c6afeb48a4a4138a4fc15c7864d40a87eb79"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"11bc4ee2ec48602f86acf22e57dd651e8e2343c0","unresolved":false,"context_lines":[{"line_number":1384,"context_line":"    @mock.patch(\u0027cinder.image.image_utils.CONF\u0027)"},{"line_number":1385,"context_line":"    @mock.patch(\u0027cinder.image.image_utils.os.listdir\u0027)"},{"line_number":1386,"context_line":"    @mock.patch(\u0027cinder.image.image_utils.os.path.exists\u0027, return_value\u003dTrue)"},{"line_number":1387,"context_line":"    def test_cleanup_temporary_file(self, mock_patch, mock_listdir, mock_conf,"},{"line_number":1388,"context_line":"                                    mock_join, mock_remove):"},{"line_number":1389,"context_line":"        mock_listdir.return_value \u003d [\u0027tmphost@backend1\u0027]"},{"line_number":1390,"context_line":"        conv_dir \u003d mock.sentinel.image_conversion_dir"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afc51ec_a07359e6","line":1387,"range":{"start_line":1387,"start_character":47,"end_line":1387,"end_character":52},"in_reply_to":"3afc51ec_4983d904","updated":"2016-03-15 03:48:15.000000000","message":"Done","commit_id":"3eb6c6afeb48a4a4138a4fc15c7864d40a87eb79"},{"author":{"_account_id":9171,"name":"Vipin Balachandran","email":"vipin.bl@gmail.com","username":"vbala"},"change_message_id":"4f55ff13b852606745e0957ae7605447b1171bc4","unresolved":false,"context_lines":[{"line_number":1386,"context_line":"    @mock.patch(\u0027cinder.image.image_utils.os.path.exists\u0027, return_value\u003dTrue)"},{"line_number":1387,"context_line":"    def test_cleanup_temporary_file(self, mock_patch, mock_listdir, mock_conf,"},{"line_number":1388,"context_line":"                                    mock_join, mock_remove):"},{"line_number":1389,"context_line":"        mock_listdir.return_value \u003d [\u0027tmphost@backend1\u0027]"},{"line_number":1390,"context_line":"        conv_dir \u003d mock.sentinel.image_conversion_dir"},{"line_number":1391,"context_line":"        mock_conf.image_conversion_dir \u003d conv_dir"},{"line_number":1392,"context_line":"        mock_join.return_value \u003d \u0027/test/tmp/tmphost@backend1\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afc51ec_29100da8","line":1389,"updated":"2016-03-14 09:41:03.000000000","message":"We can also add files corr. to a different backend.","commit_id":"3eb6c6afeb48a4a4138a4fc15c7864d40a87eb79"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"11bc4ee2ec48602f86acf22e57dd651e8e2343c0","unresolved":false,"context_lines":[{"line_number":1386,"context_line":"    @mock.patch(\u0027cinder.image.image_utils.os.path.exists\u0027, return_value\u003dTrue)"},{"line_number":1387,"context_line":"    def test_cleanup_temporary_file(self, mock_patch, mock_listdir, mock_conf,"},{"line_number":1388,"context_line":"                                    mock_join, mock_remove):"},{"line_number":1389,"context_line":"        mock_listdir.return_value \u003d [\u0027tmphost@backend1\u0027]"},{"line_number":1390,"context_line":"        conv_dir \u003d mock.sentinel.image_conversion_dir"},{"line_number":1391,"context_line":"        mock_conf.image_conversion_dir \u003d conv_dir"},{"line_number":1392,"context_line":"        mock_join.return_value \u003d \u0027/test/tmp/tmphost@backend1\u0027"}],"source_content_type":"text/x-python","patch_set":13,"id":"3afc51ec_00832d99","line":1389,"in_reply_to":"3afc51ec_29100da8","updated":"2016-03-15 03:48:15.000000000","message":"Done","commit_id":"3eb6c6afeb48a4a4138a4fc15c7864d40a87eb79"}],"cinder/volume/flows/manager/create_volume.py":[{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"daa745a8bcf028d6742fca221ff285da1e436bd4","unresolved":false,"context_lines":[{"line_number":752,"context_line":"        # Fall back to default behavior of creating volume,"},{"line_number":753,"context_line":"        # download the image data and copy it into the volume."},{"line_number":754,"context_line":"        original_size \u003d volume.size"},{"line_number":755,"context_line":"        backend_name \u003d volume_utils.extract_host(volume.host)"},{"line_number":756,"context_line":"        try:"},{"line_number":757,"context_line":"            if not cloned:"},{"line_number":758,"context_line":"                with image_utils.TemporaryImages.fetch("}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_5220ed9b","line":755,"range":{"start_line":755,"start_character":49,"end_line":755,"end_character":60},"updated":"2017-01-13 16:10:11.000000000","message":"-1: volume.service_topic_queue","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"424929c036d4743c518654d08e49af296d755fff","unresolved":false,"context_lines":[{"line_number":752,"context_line":"        # Fall back to default behavior of creating volume,"},{"line_number":753,"context_line":"        # download the image data and copy it into the volume."},{"line_number":754,"context_line":"        original_size \u003d volume.size"},{"line_number":755,"context_line":"        backend_name \u003d volume_utils.extract_host(volume.host)"},{"line_number":756,"context_line":"        try:"},{"line_number":757,"context_line":"            if not cloned:"},{"line_number":758,"context_line":"                with image_utils.TemporaryImages.fetch("}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_efcd0e86","line":755,"range":{"start_line":755,"start_character":49,"end_line":755,"end_character":60},"in_reply_to":"7a3c09a3_5220ed9b","updated":"2017-01-17 02:26:47.000000000","message":"Done","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"}],"cinder/volume/manager.py":[{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"f8528fbff25bc77374cfded06f604642d06d3993","unresolved":false,"context_lines":[{"line_number":483,"context_line":""},{"line_number":484,"context_line":"        # Keep the image tmp file clean when init host."},{"line_number":485,"context_line":"        image_utils.cleanup_temporary_file(vol_utils.extract_host(self.host,"},{"line_number":486,"context_line":"                                                                  \u0027backend\u0027))"},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"        # collect and publish service capabilities"},{"line_number":489,"context_line":"        self.publish_service_capabilities(ctxt)"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_55034976","line":486,"updated":"2016-10-18 18:45:44.000000000","message":"I don\u0027t believe doing this this way is compatible with our goal of running active-active c-vol.","commit_id":"cdf97098c4644fefa1e01ac0e1ce51194b1c14da"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"68de535cbdb07984caa818963a82272da6f8128f","unresolved":false,"context_lines":[{"line_number":483,"context_line":""},{"line_number":484,"context_line":"        # Keep the image tmp file clean when init host."},{"line_number":485,"context_line":"        image_utils.cleanup_temporary_file(vol_utils.extract_host(self.host,"},{"line_number":486,"context_line":"                                                                  \u0027backend\u0027))"},{"line_number":487,"context_line":""},{"line_number":488,"context_line":"        # collect and publish service capabilities"},{"line_number":489,"context_line":"        self.publish_service_capabilities(ctxt)"}],"source_content_type":"text/x-python","patch_set":19,"id":"fa6399be_4c2e26fb","line":486,"in_reply_to":"fa6399be_55034976","updated":"2016-10-20 00:53:56.000000000","message":"I didn\u0027t get your point, even running c-vol cluster, we still can make temporary file clean in each c-vol node,  is there any problem which I didn\u0027t notice ?","commit_id":"cdf97098c4644fefa1e01ac0e1ce51194b1c14da"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"daa745a8bcf028d6742fca221ff285da1e436bd4","unresolved":false,"context_lines":[{"line_number":459,"context_line":"        self.driver.set_initialized()"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        # Keep the image tmp file clean when init host."},{"line_number":462,"context_line":"        image_utils.cleanup_temporary_file(vol_utils.extract_host(self.host,"},{"line_number":463,"context_line":"                                                                  \u0027backend\u0027))"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        # collect and publish service capabilities"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_32a0c1f4","line":462,"range":{"start_line":462,"start_character":66,"end_line":462,"end_character":75},"updated":"2017-01-13 16:10:11.000000000","message":"-1: self.service_topic_queue","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"424929c036d4743c518654d08e49af296d755fff","unresolved":false,"context_lines":[{"line_number":459,"context_line":"        self.driver.set_initialized()"},{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        # Keep the image tmp file clean when init host."},{"line_number":462,"context_line":"        image_utils.cleanup_temporary_file(vol_utils.extract_host(self.host,"},{"line_number":463,"context_line":"                                                                  \u0027backend\u0027))"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        # collect and publish service capabilities"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_4fb8e2c8","line":462,"range":{"start_line":462,"start_character":66,"end_line":462,"end_character":75},"in_reply_to":"7a3c09a3_32a0c1f4","updated":"2017-01-17 02:26:47.000000000","message":"Done","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":11600,"name":"Michał Dulko","email":"michal.dulko@gmail.com","username":"dulek"},"change_message_id":"0e7f0b339810d434b5cff129a48831f1af633ef2","unresolved":false,"context_lines":[{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        # Keep the image tmp file clean when init host."},{"line_number":462,"context_line":"        image_utils.cleanup_temporary_file(vol_utils.extract_host(self.host,"},{"line_number":463,"context_line":"                                                                  \u0027backend\u0027))"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        # collect and publish service capabilities"},{"line_number":466,"context_line":"        self.publish_service_capabilities(ctxt)"}],"source_content_type":"text/x-python","patch_set":25,"id":"ba5201f7_4fb90679","line":463,"range":{"start_line":463,"start_character":67,"end_line":463,"end_character":74},"updated":"2017-01-10 15:35:07.000000000","message":"No need to specify that - this is the default for extract_host.","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":8846,"name":"Hao Wang","display_name":"Hao Wang","email":"sxmatch1986@gmail.com","username":"sxmatch"},"change_message_id":"424929c036d4743c518654d08e49af296d755fff","unresolved":false,"context_lines":[{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        # Keep the image tmp file clean when init host."},{"line_number":462,"context_line":"        image_utils.cleanup_temporary_file(vol_utils.extract_host(self.host,"},{"line_number":463,"context_line":"                                                                  \u0027backend\u0027))"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        # collect and publish service capabilities"},{"line_number":466,"context_line":"        self.publish_service_capabilities(ctxt)"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_6fe4bee0","line":463,"range":{"start_line":463,"start_character":67,"end_line":463,"end_character":74},"in_reply_to":"7a3c09a3_8f778ed3","updated":"2017-01-17 02:26:47.000000000","message":"yes, you\u0027re right. :)","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"},{"author":{"_account_id":9535,"name":"Gorka Eguileor","email":"geguileo@redhat.com","username":"Gorka"},"change_message_id":"daa745a8bcf028d6742fca221ff285da1e436bd4","unresolved":false,"context_lines":[{"line_number":460,"context_line":""},{"line_number":461,"context_line":"        # Keep the image tmp file clean when init host."},{"line_number":462,"context_line":"        image_utils.cleanup_temporary_file(vol_utils.extract_host(self.host,"},{"line_number":463,"context_line":"                                                                  \u0027backend\u0027))"},{"line_number":464,"context_line":""},{"line_number":465,"context_line":"        # collect and publish service capabilities"},{"line_number":466,"context_line":"        self.publish_service_capabilities(ctxt)"}],"source_content_type":"text/x-python","patch_set":25,"id":"7a3c09a3_8f778ed3","line":463,"range":{"start_line":463,"start_character":67,"end_line":463,"end_character":74},"in_reply_to":"ba5201f7_4fb90679","updated":"2017-01-13 16:10:11.000000000","message":"nit: I have to agree since you are not passing it on create_volume.py","commit_id":"92daa99bbe7aa9d8db856cf58147871e78ace9d7"}]}
