)]}'
{"cinder/image/image_utils.py":[{"author":{"_account_id":4355,"name":"Avishay Traeger","email":"avishay@stratoscale.com","username":"avishay-il"},"change_message_id":"1d2b0856aa6641d27e7192ff6865cedda2ce8fc4","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        if is_xenserver_image(context, image_service, image_id):"},{"line_number":266,"context_line":"            replace_xenserver_image_with_coalesced_vhd(tmp)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        if not CONF.raw_images_only:"},{"line_number":269,"context_line":"            data \u003d qemu_img_info(tmp)"},{"line_number":270,"context_line":"            fmt \u003d data.file_format"},{"line_number":271,"context_line":"            if fmt is None:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAQ3%2F%2F43Q%3D","line":268,"updated":"2013-08-13 13:19:54.000000000","message":"Maybe make the diff smaller by doing \n\nif CONF.raw_images_only:\n    return\n\nAnd leave the rest of the function unchanged?","commit_id":"0bdcc259ac7087650e56e2b88203ca6de5d5e99c"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"954ac12e6425bd6af7be32a7b00bde209831bd83","unresolved":false,"context_lines":[{"line_number":265,"context_line":"        if is_xenserver_image(context, image_service, image_id):"},{"line_number":266,"context_line":"            replace_xenserver_image_with_coalesced_vhd(tmp)"},{"line_number":267,"context_line":""},{"line_number":268,"context_line":"        if not CONF.raw_images_only:"},{"line_number":269,"context_line":"            data \u003d qemu_img_info(tmp)"},{"line_number":270,"context_line":"            fmt \u003d data.file_format"},{"line_number":271,"context_line":"            if fmt is None:"}],"source_content_type":"text/x-python","patch_set":1,"id":"AAAAQ3%2F%2F3rk%3D","line":268,"in_reply_to":"AAAAQ3%2F%2F43Q%3D","updated":"2013-08-13 17:58:10.000000000","message":"Done\n\nGood call.  That is much cleaner.  Thanks!","commit_id":"0bdcc259ac7087650e56e2b88203ca6de5d5e99c"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"815e20180ddbd693c2e8aa656687f0f62a593dba","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        we are working with a RAW file.  If so, fetch it, check if it is a"},{"line_number":255,"context_line":"        xenserver image and then go no further.  For all other cases, go on."},{"line_number":256,"context_line":"        \"\"\""},{"line_number":257,"context_line":"        if CONF.raw_images_only and image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":258,"context_line":"            raise exception.ImageUnacceptable("},{"line_number":259,"context_line":"                reason\u003d_(\"raw_images_only is configured but image is of \""},{"line_number":260,"context_line":"                         \"type %s\") % image_meta[\u0027disk_format\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAARH%2F%2F69o%3D","line":257,"updated":"2013-08-15 06:05:54.000000000","message":"Even if we do this (which I\u0027m not completely sure about still), at the very least we need to make sure of a couple of things:\n1. We\u0027re logging a useful error message (LOG.error)\n2. We\u0027re handling this exception up the chain and returning a reasonable error message somehow as to why it failed.\n\nI\u0027m not crazy about this only because it goes back to the whole thing of expectations and common behaviors.  You\u0027ve kinda skirted around that by doing an all or nothing via the config setting which is at least a better alternative than just a gamble of what might happen.  \n\nThe only thing that\u0027s good is I don\u0027t know of any Hypervisor/processor combo that can\u0027t work with raw, so we end up with LCD which may be ok in this case.","commit_id":"aa999ab84f43204520e368e116318fcbd068bd63"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"6bfcf43a586a8fc049e58daed9ea3b86778fba89","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        we are working with a RAW file.  If so, fetch it, check if it is a"},{"line_number":255,"context_line":"        xenserver image and then go no further.  For all other cases, go on."},{"line_number":256,"context_line":"        \"\"\""},{"line_number":257,"context_line":"        if CONF.raw_images_only and image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":258,"context_line":"            raise exception.ImageUnacceptable("},{"line_number":259,"context_line":"                reason\u003d_(\"raw_images_only is configured but image is of \""},{"line_number":260,"context_line":"                         \"type %s\") % image_meta[\u0027disk_format\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAARn%2F%2F9p8%3D","line":257,"in_reply_to":"AAAARH%2F%2F5Xw%3D","updated":"2013-08-19 16:28:57.000000000","message":"haha.. yeah, sorry I pick up different things when I review multiple times.\n\nSo what I\u0027m thinking is just adding a LOG.error/exception message here, not that there\u0027s a problem with your exception message at all.  Thanks for pointing out the connection from the other patches, that actually helps with some of the concerns I had.\n\nYour idea bout the existence of qemu-img is an interesting point actually.  The only problem I have with the CONF setting is the issue of how we deal with mixed environments, but maybe I\u0027m making too much of this.  \n\nAnother thought, what if we did the check just on driver init, store it and add an optional arg to fetch_to_raw that reads that in.  Then we don\u0027t have a boat load of checks, no global conf setting and we still can do the right thing without the user or the admin ever needing any knowledge of the details?","commit_id":"aa999ab84f43204520e368e116318fcbd068bd63"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"b4bf7235e1d926fe53b0fd01c2484a9dd12d109b","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        we are working with a RAW file.  If so, fetch it, check if it is a"},{"line_number":255,"context_line":"        xenserver image and then go no further.  For all other cases, go on."},{"line_number":256,"context_line":"        \"\"\""},{"line_number":257,"context_line":"        if CONF.raw_images_only and image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":258,"context_line":"            raise exception.ImageUnacceptable("},{"line_number":259,"context_line":"                reason\u003d_(\"raw_images_only is configured but image is of \""},{"line_number":260,"context_line":"                         \"type %s\") % image_meta[\u0027disk_format\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAARH%2F%2F5Xw%3D","line":257,"in_reply_to":"AAAARH%2F%2F69o%3D","updated":"2013-08-15 15:48:30.000000000","message":"I knew it was too good to be true when you +1\u0027d this the first time!  :-)\n\nSo, with regards to the concerns.  If you would like a different error message, I am happy to change it to make it more clear.  As far as raising it up the chain is concerned.  I have two other changes that were merged to address that very issue:  https://bugs.launchpad.net/cinder/+bug/1209021 (makes sure that the ImageUnacceptable exception is handled up the stack properly and that the root cause of the failure is easy to determine) and https://bugs.launchpad.net/cinder/+bug/1209317 (fix translation issues I found along the way.)\n\nI was shooting for the LCD here and for something that we can configure that will allow people who only support RAW images to avoid shooting themselves in the foot.  Here if they do something wrong they at least get a clear error message.\n\nThe other things I had considered were to try and check for the existence of qemu-img and if the program isn\u0027t there making sure that the image is RAW and then skipping the code that needs qemu-img.  That doesn\u0027t require a config change but then we have more people going through the new code path.","commit_id":"aa999ab84f43204520e368e116318fcbd068bd63"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"0a0f4af4ba7c825aacea06a0f82ea7e34d46bd89","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        we are working with a RAW file.  If so, fetch it, check if it is a"},{"line_number":255,"context_line":"        xenserver image and then go no further.  For all other cases, go on."},{"line_number":256,"context_line":"        \"\"\""},{"line_number":257,"context_line":"        if CONF.raw_images_only and image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":258,"context_line":"            raise exception.ImageUnacceptable("},{"line_number":259,"context_line":"                reason\u003d_(\"raw_images_only is configured but image is of \""},{"line_number":260,"context_line":"                         \"type %s\") % image_meta[\u0027disk_format\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAARn%2F%2FzUs%3D","line":257,"in_reply_to":"AAAARn%2F%2F7mY%3D","updated":"2013-08-21 19:31:10.000000000","message":"So I was thinking one check/var setting in the base driver.  I thought you had mentioned earlier that there\u0027s a lot of overhead with dynamically checking this on each call.  That seems to be a misunderstanding on my part.\n\nYou\u0027re latter suggestion sounds fine to me.  As far as opposition, there have been some variations on this I think (like checking and never going to qemu) etc.  but regardless.  Maybe I went in a circle, but there was something along the lines of a list of \"valid\" images at one point which is what I ddn\u0027t like.  I wanted to leave the dirty work to qemu when possible.\n\nAnyway, your last proposal sounds good to me.","commit_id":"aa999ab84f43204520e368e116318fcbd068bd63"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"8a9ac324b7edfddd78a4568022ff4e31a2f47847","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        we are working with a RAW file.  If so, fetch it, check if it is a"},{"line_number":255,"context_line":"        xenserver image and then go no further.  For all other cases, go on."},{"line_number":256,"context_line":"        \"\"\""},{"line_number":257,"context_line":"        if CONF.raw_images_only and image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":258,"context_line":"            raise exception.ImageUnacceptable("},{"line_number":259,"context_line":"                reason\u003d_(\"raw_images_only is configured but image is of \""},{"line_number":260,"context_line":"                         \"type %s\") % image_meta[\u0027disk_format\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAARn%2F%2F7mY%3D","line":257,"in_reply_to":"AAAARn%2F%2F9p8%3D","updated":"2013-08-20 03:07:54.000000000","message":"John, to clarify the idea ... you are suggesting that I add an optional argument to fetch_to_raw that can enable or disable the use of qemu-img and that I would check for the existence of the binary at init time for each driver?  I.E. when storwize_svc and lvm are started at least.  Probably for xiv as well.  I could implement that.\n\nIf you prefer that though, why couldn\u0027t we just put the check directly into fetch_to_raw.  We wouldn\u0027t have to add a config option and we would have a bunch of checks.  It would just check if qemu-img was there if it was we go through the normal flow of this function.  If it isn\u0027t there we check to see if the image is raw, if it is, we are fine.  Otherwise we throw the exception and explain the problem.  That covers all drivers that use the function and is an even more minimal change then I currently have proposed.  Originally I liked that approach best but thought there was opposition to that idea.","commit_id":"aa999ab84f43204520e368e116318fcbd068bd63"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"2cacb735b3011ed40574dc974c5075eea0f25104","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        we are working with a RAW file.  If so, fetch it, check if it is a"},{"line_number":255,"context_line":"        xenserver image and then go no further.  For all other cases, go on."},{"line_number":256,"context_line":"        \"\"\""},{"line_number":257,"context_line":"        if CONF.raw_images_only and image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":258,"context_line":"            raise exception.ImageUnacceptable("},{"line_number":259,"context_line":"                reason\u003d_(\"raw_images_only is configured but image is of \""},{"line_number":260,"context_line":"                         \"type %s\") % image_meta[\u0027disk_format\u0027],"}],"source_content_type":"text/x-python","patch_set":4,"id":"AAAARn%2F%2FyH0%3D","line":257,"in_reply_to":"AAAARn%2F%2FzUs%3D","updated":"2013-08-21 23:58:15.000000000","message":"Excellent!  Thank you for the discussion on this.  I will get the second proposal coded up and submitted ASAP.","commit_id":"aa999ab84f43204520e368e116318fcbd068bd63"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"558ea50362e14e31176776a15c678b6337df0a39","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        Systems with qemu-img will always progress through the whole function."},{"line_number":255,"context_line":"        \"\"\""},{"line_number":256,"context_line":"        try:"},{"line_number":257,"context_line":"            utils.execute(\u0027which\u0027, \u0027qemu-img\u0027, run_as_root\u003dFalse)"},{"line_number":258,"context_line":"        except exception.ProcessExecutionError:"},{"line_number":259,"context_line":"            no_qemu_img \u003d True"},{"line_number":260,"context_line":"            if image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASX%2F%2F6Ew%3D","line":257,"updated":"2013-08-23 22:14:15.000000000","message":"Using \"which\" for this doesn\u0027t feel right.\n\nI\u0027d recommend \"qemu-img info /dev/null\" as a good way to tell whether it can be run or not.","commit_id":"cd8ac867fdc7be291dda807f39b86e15c41f192e"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"1e7b375577ae3be75a7c24b3031ce182186db283","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        Systems with qemu-img will always progress through the whole function."},{"line_number":255,"context_line":"        \"\"\""},{"line_number":256,"context_line":"        try:"},{"line_number":257,"context_line":"            utils.execute(\u0027which\u0027, \u0027qemu-img\u0027, run_as_root\u003dFalse)"},{"line_number":258,"context_line":"        except exception.ProcessExecutionError:"},{"line_number":259,"context_line":"            no_qemu_img \u003d True"},{"line_number":260,"context_line":"            if image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASX%2F%2F0dc%3D","line":257,"in_reply_to":"AAAASX%2F%2F6Ew%3D","updated":"2013-08-27 23:49:11.000000000","message":"Done","commit_id":"cd8ac867fdc7be291dda807f39b86e15c41f192e"},{"author":{"_account_id":752,"name":"Pedro Navarro Pérez","email":"pednape@gmail.com","username":"pednape"},"change_message_id":"a1e43a425310787abb41c5445fea385102b99f6d","unresolved":false,"context_lines":[{"line_number":254,"context_line":"        Systems with qemu-img will always progress through the whole function."},{"line_number":255,"context_line":"        \"\"\""},{"line_number":256,"context_line":"        try:"},{"line_number":257,"context_line":"            utils.execute(\u0027which\u0027, \u0027qemu-img\u0027, run_as_root\u003dFalse)"},{"line_number":258,"context_line":"        except exception.ProcessExecutionError:"},{"line_number":259,"context_line":"            no_qemu_img \u003d True"},{"line_number":260,"context_line":"            if image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASn%2F%2F9uk%3D","line":257,"in_reply_to":"AAAASX%2F%2F6Ew%3D","updated":"2013-08-27 13:41:58.000000000","message":"windows drivers uses these changes and \"which\" command does not exist in Windows.","commit_id":"cd8ac867fdc7be291dda807f39b86e15c41f192e"},{"author":{"_account_id":4523,"name":"Eric Harney","email":"eharney@redhat.com","username":"eharney"},"change_message_id":"558ea50362e14e31176776a15c678b6337df0a39","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        if is_xenserver_image(context, image_service, image_id):"},{"line_number":271,"context_line":"            replace_xenserver_image_with_coalesced_vhd(tmp)"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        \"\"\"Can\u0027t progress further if qemu-img is not installed\"\"\""},{"line_number":274,"context_line":"        if no_qemu_img:"},{"line_number":275,"context_line":"            return"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASX%2F%2F6Dk%3D","line":273,"updated":"2013-08-23 22:14:15.000000000","message":"This comment sounds like an error... should read more like \"qemu-img is not installed, but no further conversion needed\" or so.","commit_id":"cd8ac867fdc7be291dda807f39b86e15c41f192e"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"1e7b375577ae3be75a7c24b3031ce182186db283","unresolved":false,"context_lines":[{"line_number":270,"context_line":"        if is_xenserver_image(context, image_service, image_id):"},{"line_number":271,"context_line":"            replace_xenserver_image_with_coalesced_vhd(tmp)"},{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        \"\"\"Can\u0027t progress further if qemu-img is not installed\"\"\""},{"line_number":274,"context_line":"        if no_qemu_img:"},{"line_number":275,"context_line":"            return"},{"line_number":276,"context_line":""}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASX%2F%2F0dY%3D","line":273,"in_reply_to":"AAAASX%2F%2F6Dk%3D","updated":"2013-08-27 23:49:11.000000000","message":"Done","commit_id":"cd8ac867fdc7be291dda807f39b86e15c41f192e"},{"author":{"_account_id":4355,"name":"Avishay Traeger","email":"avishay@stratoscale.com","username":"avishay-il"},"change_message_id":"d9dab4d5f5b0008d590a3ce465e0175288c9fdae","unresolved":false,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        \"\"\"Can\u0027t progress further if qemu-img is not installed\"\"\""},{"line_number":274,"context_line":"        if no_qemu_img:"},{"line_number":275,"context_line":"            return"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        data \u003d qemu_img_info(tmp)"},{"line_number":278,"context_line":"        fmt \u003d data.file_format"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASX%2F%2F4R4%3D","line":275,"updated":"2013-08-25 05:52:39.000000000","message":"At this point the image was fetched to \u0027tmp\u0027, and \u0027dest\u0027 still doesn\u0027t have the image data.  If qemu_img isn\u0027t installed and the image is raw, you should just fetch to \u0027dest\u0027 instead of \u0027tmp\u0027 and return.","commit_id":"cd8ac867fdc7be291dda807f39b86e15c41f192e"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"1e7b375577ae3be75a7c24b3031ce182186db283","unresolved":false,"context_lines":[{"line_number":272,"context_line":""},{"line_number":273,"context_line":"        \"\"\"Can\u0027t progress further if qemu-img is not installed\"\"\""},{"line_number":274,"context_line":"        if no_qemu_img:"},{"line_number":275,"context_line":"            return"},{"line_number":276,"context_line":""},{"line_number":277,"context_line":"        data \u003d qemu_img_info(tmp)"},{"line_number":278,"context_line":"        fmt \u003d data.file_format"}],"source_content_type":"text/x-python","patch_set":6,"id":"AAAASX%2F%2F0Ys%3D","line":275,"in_reply_to":"AAAASX%2F%2F4R4%3D","updated":"2013-08-27 23:49:11.000000000","message":"Done","commit_id":"cd8ac867fdc7be291dda807f39b86e15c41f192e"},{"author":{"_account_id":4355,"name":"Avishay Traeger","email":"avishay@stratoscale.com","username":"avishay-il"},"change_message_id":"ba569d33e25d83ce04eccc3b3d701feae19bcdb0","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    # Unfortunately it seems that you can\u0027t pipe to \u0027qemu-img convert\u0027 because"},{"line_number":248,"context_line":"    # it seeks. Maybe we can think of something for a future version."},{"line_number":249,"context_line":"    with temporary_file() as tmp:"},{"line_number":250,"context_line":"        \"\"\" We may be on a system that doesn\u0027t have qemu-img installed.  That"},{"line_number":251,"context_line":"        is ok if we are working with a RAW image.  This logic checks to see if"},{"line_number":252,"context_line":"        qemu-img is installed.  If not we make sure the image is RAW and throw"},{"line_number":253,"context_line":"        an exception if not.  Otherwise we stop before needing qemu-img."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F6Xs%3D","line":250,"updated":"2013-08-28 03:20:48.000000000","message":"See here: http://www.python.org/dev/peps/pep-0008/#comments\n\nBlock comments should use the # format","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"586e798076466cea543a29a84aafcf6e021e3f6b","unresolved":false,"context_lines":[{"line_number":247,"context_line":"    # Unfortunately it seems that you can\u0027t pipe to \u0027qemu-img convert\u0027 because"},{"line_number":248,"context_line":"    # it seeks. Maybe we can think of something for a future version."},{"line_number":249,"context_line":"    with temporary_file() as tmp:"},{"line_number":250,"context_line":"        \"\"\" We may be on a system that doesn\u0027t have qemu-img installed.  That"},{"line_number":251,"context_line":"        is ok if we are working with a RAW image.  This logic checks to see if"},{"line_number":252,"context_line":"        qemu-img is installed.  If not we make sure the image is RAW and throw"},{"line_number":253,"context_line":"        an exception if not.  Otherwise we stop before needing qemu-img."}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F3wU%3D","line":250,"in_reply_to":"AAAASn%2F%2F6Xs%3D","updated":"2013-08-28 16:03:38.000000000","message":"Thanks for the pointer.  Should have know that from other things I had seen.  :-)  Done","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":752,"name":"Pedro Navarro Pérez","email":"pednape@gmail.com","username":"pednape"},"change_message_id":"d98e008eb57b73cffdcea98bd7afcaf2aec2352f","unresolved":false,"context_lines":[{"line_number":255,"context_line":"        \"\"\""},{"line_number":256,"context_line":"        if image_meta[\u0027disk_format\u0027]:"},{"line_number":257,"context_line":"            try:"},{"line_number":258,"context_line":"                utils.execute(\u0027qemu-img\u0027, \u0027info\u0027, \u0027/dev/null\u0027,"},{"line_number":259,"context_line":"                              run_as_root\u003dTrue)"},{"line_number":260,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":261,"context_line":"                no_qemu_img \u003d True"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F5m8%3D","line":258,"updated":"2013-08-28 08:17:14.000000000","message":"Windows cinder driver uses this method, this will fail on windows. And It wiill cause a wrong perception that qemu-img is not installed when It is.","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"586e798076466cea543a29a84aafcf6e021e3f6b","unresolved":false,"context_lines":[{"line_number":255,"context_line":"        \"\"\""},{"line_number":256,"context_line":"        if image_meta[\u0027disk_format\u0027]:"},{"line_number":257,"context_line":"            try:"},{"line_number":258,"context_line":"                utils.execute(\u0027qemu-img\u0027, \u0027info\u0027, \u0027/dev/null\u0027,"},{"line_number":259,"context_line":"                              run_as_root\u003dTrue)"},{"line_number":260,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":261,"context_line":"                no_qemu_img \u003d True"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F3wA%3D","line":258,"in_reply_to":"AAAASn%2F%2F5m8%3D","updated":"2013-08-28 16:03:38.000000000","message":"We discussed this in IRC.  So, the solution I have put together to avoid special casing windows is to just create an empty test file to test the functionality if qemu-img.  It should work on Windows and Linux and is pretty straight-forward.","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":4355,"name":"Avishay Traeger","email":"avishay@stratoscale.com","username":"avishay-il"},"change_message_id":"ba569d33e25d83ce04eccc3b3d701feae19bcdb0","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        if image_meta[\u0027disk_format\u0027]:"},{"line_number":257,"context_line":"            try:"},{"line_number":258,"context_line":"                utils.execute(\u0027qemu-img\u0027, \u0027info\u0027, \u0027/dev/null\u0027,"},{"line_number":259,"context_line":"                              run_as_root\u003dTrue)"},{"line_number":260,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":261,"context_line":"                no_qemu_img \u003d True"},{"line_number":262,"context_line":"                if image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F6X4%3D","line":259,"updated":"2013-08-28 03:20:48.000000000","message":"use qemu_img_info()","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"586e798076466cea543a29a84aafcf6e021e3f6b","unresolved":false,"context_lines":[{"line_number":256,"context_line":"        if image_meta[\u0027disk_format\u0027]:"},{"line_number":257,"context_line":"            try:"},{"line_number":258,"context_line":"                utils.execute(\u0027qemu-img\u0027, \u0027info\u0027, \u0027/dev/null\u0027,"},{"line_number":259,"context_line":"                              run_as_root\u003dTrue)"},{"line_number":260,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":261,"context_line":"                no_qemu_img \u003d True"},{"line_number":262,"context_line":"                if image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F3v8%3D","line":259,"in_reply_to":"AAAASn%2F%2F6X4%3D","updated":"2013-08-28 16:03:38.000000000","message":"Good call.  Thanks. Done","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":4355,"name":"Avishay Traeger","email":"avishay@stratoscale.com","username":"avishay-il"},"change_message_id":"ba569d33e25d83ce04eccc3b3d701feae19bcdb0","unresolved":false,"context_lines":[{"line_number":267,"context_line":"                        image_meta[\u0027disk_format\u0027],"},{"line_number":268,"context_line":"                        image_id\u003dimage_id)"},{"line_number":269,"context_line":"        else:"},{"line_number":270,"context_line":"            \"\"\"To account for test cases that use fetch_to_raw.\"\"\""},{"line_number":271,"context_line":"            LOG.warning(_(\u0027Skipping qemu-img check and disk_format check for \u0027"},{"line_number":272,"context_line":"                          \u0027image with no disk_format specified.\u0027))"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F6Xk%3D","line":270,"updated":"2013-08-28 03:20:48.000000000","message":"#","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"586e798076466cea543a29a84aafcf6e021e3f6b","unresolved":false,"context_lines":[{"line_number":267,"context_line":"                        image_meta[\u0027disk_format\u0027],"},{"line_number":268,"context_line":"                        image_id\u003dimage_id)"},{"line_number":269,"context_line":"        else:"},{"line_number":270,"context_line":"            \"\"\"To account for test cases that use fetch_to_raw.\"\"\""},{"line_number":271,"context_line":"            LOG.warning(_(\u0027Skipping qemu-img check and disk_format check for \u0027"},{"line_number":272,"context_line":"                          \u0027image with no disk_format specified.\u0027))"},{"line_number":273,"context_line":""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F3v4%3D","line":270,"in_reply_to":"AAAASn%2F%2F6Xk%3D","updated":"2013-08-28 16:03:38.000000000","message":"Done","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":4355,"name":"Avishay Traeger","email":"avishay@stratoscale.com","username":"avishay-il"},"change_message_id":"ba569d33e25d83ce04eccc3b3d701feae19bcdb0","unresolved":false,"context_lines":[{"line_number":277,"context_line":"            replace_xenserver_image_with_coalesced_vhd(tmp)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        if no_qemu_img:"},{"line_number":280,"context_line":"            \"\"\"qemu-img is not installed but we do have a RAW image.  As a"},{"line_number":281,"context_line":"            result we only need to copy the image to the destination and then"},{"line_number":282,"context_line":"            return."},{"line_number":283,"context_line":"            \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F6Xc%3D","line":280,"updated":"2013-08-28 03:20:48.000000000","message":"#","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"586e798076466cea543a29a84aafcf6e021e3f6b","unresolved":false,"context_lines":[{"line_number":277,"context_line":"            replace_xenserver_image_with_coalesced_vhd(tmp)"},{"line_number":278,"context_line":""},{"line_number":279,"context_line":"        if no_qemu_img:"},{"line_number":280,"context_line":"            \"\"\"qemu-img is not installed but we do have a RAW image.  As a"},{"line_number":281,"context_line":"            result we only need to copy the image to the destination and then"},{"line_number":282,"context_line":"            return."},{"line_number":283,"context_line":"            \"\"\""}],"source_content_type":"text/x-python","patch_set":7,"id":"AAAASn%2F%2F3v0%3D","line":280,"in_reply_to":"AAAASn%2F%2F6Xc%3D","updated":"2013-08-28 16:03:38.000000000","message":"Done","commit_id":"8c6bb83415e356f463dd1d80749b58228f0d2cec"},{"author":{"_account_id":4355,"name":"Avishay Traeger","email":"avishay@stratoscale.com","username":"avishay-il"},"change_message_id":"84010457250ab5b1e7b1a009d44e3ea948a788ec","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                # Need empty file to test qemu-img info."},{"line_number":259,"context_line":"                file \u003d open(tmp, \u0027w\u0027)"},{"line_number":260,"context_line":"                file.write(\u0027\u0027)"},{"line_number":261,"context_line":"                file.close()"},{"line_number":262,"context_line":"                qemu_img_info(tmp)"},{"line_number":263,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":264,"context_line":"                no_qemu_img \u003d True"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAASn%2F%2F3l4%3D","line":261,"updated":"2013-08-28 16:35:02.000000000","message":"why is this open/write/close necessary?","commit_id":"8b29e06147c0616b907b817896213098b12ae2ab"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"edc112545912c74d2cf2603021ad0e451e383088","unresolved":false,"context_lines":[{"line_number":258,"context_line":"                # Need empty file to test qemu-img info."},{"line_number":259,"context_line":"                file \u003d open(tmp, \u0027w\u0027)"},{"line_number":260,"context_line":"                file.write(\u0027\u0027)"},{"line_number":261,"context_line":"                file.close()"},{"line_number":262,"context_line":"                qemu_img_info(tmp)"},{"line_number":263,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":264,"context_line":"                no_qemu_img \u003d True"}],"source_content_type":"text/x-python","patch_set":8,"id":"AAAASn%2F%2F3Po%3D","line":261,"in_reply_to":"AAAASn%2F%2F3l4%3D","updated":"2013-08-28 17:57:40.000000000","message":"I didn\u0027t think this would work without creating the empty temp file, but it looks like it isn\u0027t necessary.  I have removed it.  Thanks Avishay.","commit_id":"8b29e06147c0616b907b817896213098b12ae2ab"},{"author":{"_account_id":752,"name":"Pedro Navarro Pérez","email":"pednape@gmail.com","username":"pednape"},"change_message_id":"b9dbc989bfeaea27eaa3f979a881c8f05bedff93","unresolved":false,"context_lines":[{"line_number":257,"context_line":"            try:"},{"line_number":258,"context_line":"                # Use the empty tmp file to make sure qemu_img_info works."},{"line_number":259,"context_line":"                qemu_img_info(tmp)"},{"line_number":260,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":261,"context_line":"                no_qemu_img \u003d True"},{"line_number":262,"context_line":"                if image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":263,"context_line":"                    raise exception.ImageUnacceptable("}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2FygQ%3D","line":260,"updated":"2013-08-29 15:37:37.000000000","message":"you should use processutils.ProcessExecutionError instead.","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"ce8e92bb2d3c85669b190f42e3a5d0e918bf60f3","unresolved":false,"context_lines":[{"line_number":257,"context_line":"            try:"},{"line_number":258,"context_line":"                # Use the empty tmp file to make sure qemu_img_info works."},{"line_number":259,"context_line":"                qemu_img_info(tmp)"},{"line_number":260,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":261,"context_line":"                no_qemu_img \u003d True"},{"line_number":262,"context_line":"                if image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":263,"context_line":"                    raise exception.ImageUnacceptable("}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2FpiY%3D","line":260,"in_reply_to":"AAAASn%2F%2Frkg%3D","updated":"2013-09-01 15:28:43.000000000","message":"Sorry I didn\u0027t see the ping in IRC.  I am officially \u0027on vacation\u0027 this week.  I just looked and you are right about that change.  The system I was running on had an older code base.  I will get it updated and make this change accordingly.  Thanks for the pointer!","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"1fc579d679ff116ed1eb575bc28fbba0c6dda48c","unresolved":false,"context_lines":[{"line_number":257,"context_line":"            try:"},{"line_number":258,"context_line":"                # Use the empty tmp file to make sure qemu_img_info works."},{"line_number":259,"context_line":"                qemu_img_info(tmp)"},{"line_number":260,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":261,"context_line":"                no_qemu_img \u003d True"},{"line_number":262,"context_line":"                if image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":263,"context_line":"                    raise exception.ImageUnacceptable("}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2Frkg%3D","line":260,"in_reply_to":"AAAASn%2F%2Fxgo%3D","updated":"2013-08-30 23:11:38.000000000","message":"Jay, I left a note in IRC, we actually changed the exceptions in utils to actually just raise the proecessutils.ProcessExecutionError instead of wrapping and re-raising.","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"a827a2f29065d09517fb4686663352e3237c417d","unresolved":false,"context_lines":[{"line_number":257,"context_line":"            try:"},{"line_number":258,"context_line":"                # Use the empty tmp file to make sure qemu_img_info works."},{"line_number":259,"context_line":"                qemu_img_info(tmp)"},{"line_number":260,"context_line":"            except exception.ProcessExecutionError:"},{"line_number":261,"context_line":"                no_qemu_img \u003d True"},{"line_number":262,"context_line":"                if image_meta[\u0027disk_format\u0027] !\u003d \u0027raw\u0027:"},{"line_number":263,"context_line":"                    raise exception.ImageUnacceptable("}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2Fxgo%3D","line":260,"in_reply_to":"AAAASn%2F%2FygQ%3D","updated":"2013-08-29 19:05:14.000000000","message":"Pedro,\n\nI don\u0027t understand why I should be using processutils.ProcessExecutionError instead.  If you look at utils.execute it is catching processutils.ProcessExecutionError and re rasing it as exception.ProcessExecutionError.  So, trying to catch processutils.ProcessExecutionError here will not work.","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"},{"author":{"_account_id":752,"name":"Pedro Navarro Pérez","email":"pednape@gmail.com","username":"pednape"},"change_message_id":"366f09fa9f84bc29a4ddb200d41ffd67b20e7f62","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            LOG.debug(_(\u0027Copying image from %(tmp)s to volume %(dest)s - \u0027"},{"line_number":284,"context_line":"                        \u0027size: %(size)s\u0027) % {\u0027tmp\u0027: tmp, \u0027dest\u0027: dest,"},{"line_number":285,"context_line":"                                             \u0027size\u0027: image_meta[\u0027size\u0027]})"},{"line_number":286,"context_line":"            volume_utils.copy_volume(tmp, dest, image_meta[\u0027size\u0027])"},{"line_number":287,"context_line":"            return"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        data \u003d qemu_img_info(tmp)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2FvHQ%3D","line":286,"updated":"2013-08-30 07:33:33.000000000","message":"copy_volume is using dd, that will not work on Windows. I\u0027d prefer not to use that.","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"ce8e92bb2d3c85669b190f42e3a5d0e918bf60f3","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            LOG.debug(_(\u0027Copying image from %(tmp)s to volume %(dest)s - \u0027"},{"line_number":284,"context_line":"                        \u0027size: %(size)s\u0027) % {\u0027tmp\u0027: tmp, \u0027dest\u0027: dest,"},{"line_number":285,"context_line":"                                             \u0027size\u0027: image_meta[\u0027size\u0027]})"},{"line_number":286,"context_line":"            volume_utils.copy_volume(tmp, dest, image_meta[\u0027size\u0027])"},{"line_number":287,"context_line":"            return"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        data \u003d qemu_img_info(tmp)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2Fpi0%3D","line":286,"in_reply_to":"AAAASn%2F%2Frkk%3D","updated":"2013-09-01 15:28:43.000000000","message":"Agreed.  This is designed to cover systems that can possibly run without QEMU.  In the case that the HyperV systems are never going to be in that situation (and it sounds like they cannot run at all without qemu-img) then they won\u0027t go down this path or will be destined to fail in other ways.","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"},{"author":{"_account_id":2243,"name":"John Griffith","email":"john.griffith8@gmail.com","username":"john-griffith"},"change_message_id":"1fc579d679ff116ed1eb575bc28fbba0c6dda48c","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            LOG.debug(_(\u0027Copying image from %(tmp)s to volume %(dest)s - \u0027"},{"line_number":284,"context_line":"                        \u0027size: %(size)s\u0027) % {\u0027tmp\u0027: tmp, \u0027dest\u0027: dest,"},{"line_number":285,"context_line":"                                             \u0027size\u0027: image_meta[\u0027size\u0027]})"},{"line_number":286,"context_line":"            volume_utils.copy_volume(tmp, dest, image_meta[\u0027size\u0027])"},{"line_number":287,"context_line":"            return"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        data \u003d qemu_img_info(tmp)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2Frkk%3D","line":286,"in_reply_to":"AAAASn%2F%2FuFo%3D","updated":"2013-08-30 23:11:38.000000000","message":"Ummm... but then no_qemu_img will be False and you won\u0027t hit this so it does what you want no?","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"},{"author":{"_account_id":752,"name":"Pedro Navarro Pérez","email":"pednape@gmail.com","username":"pednape"},"unresolved":false,"context_lines":[{"line_number":283,"context_line":"            LOG.debug(_(\u0027Copying image from %(tmp)s to volume %(dest)s - \u0027"},{"line_number":284,"context_line":"                        \u0027size: %(size)s\u0027) % {\u0027tmp\u0027: tmp, \u0027dest\u0027: dest,"},{"line_number":285,"context_line":"                                             \u0027size\u0027: image_meta[\u0027size\u0027]})"},{"line_number":286,"context_line":"            volume_utils.copy_volume(tmp, dest, image_meta[\u0027size\u0027])"},{"line_number":287,"context_line":"            return"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        data \u003d qemu_img_info(tmp)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2FuFo%3D","line":286,"in_reply_to":"AAAASn%2F%2FuUM%3D","updated":"2013-08-30 21:23:01.000000000","message":"In Windows qemu-img will be always installed.","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"},{"author":{"_account_id":7198,"name":"Jay Bryant","email":"jungleboyj@electronicjungle.net","username":"jsbryant"},"change_message_id":"8b7fd946c5dd11a7824931f78b8a3d4244b36bf0","unresolved":false,"context_lines":[{"line_number":283,"context_line":"            LOG.debug(_(\u0027Copying image from %(tmp)s to volume %(dest)s - \u0027"},{"line_number":284,"context_line":"                        \u0027size: %(size)s\u0027) % {\u0027tmp\u0027: tmp, \u0027dest\u0027: dest,"},{"line_number":285,"context_line":"                                             \u0027size\u0027: image_meta[\u0027size\u0027]})"},{"line_number":286,"context_line":"            volume_utils.copy_volume(tmp, dest, image_meta[\u0027size\u0027])"},{"line_number":287,"context_line":"            return"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        data \u003d qemu_img_info(tmp)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2FuUM%3D","line":286,"in_reply_to":"AAAASn%2F%2FvHQ%3D","updated":"2013-08-30 12:47:35.000000000","message":"I apologize, but I am not familiar with how these things are working on Windows.  \n\nI will need some pointers on how to resolve these issues.  If the answer is simply that Windows always has qemu-img installed, unlike Linux, then I can set up a check that will skip this code as we had mentioned in one earlier review.","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"},{"author":{"_account_id":4355,"name":"Avishay Traeger","email":"avishay@stratoscale.com","username":"avishay-il"},"unresolved":false,"context_lines":[{"line_number":283,"context_line":"            LOG.debug(_(\u0027Copying image from %(tmp)s to volume %(dest)s - \u0027"},{"line_number":284,"context_line":"                        \u0027size: %(size)s\u0027) % {\u0027tmp\u0027: tmp, \u0027dest\u0027: dest,"},{"line_number":285,"context_line":"                                             \u0027size\u0027: image_meta[\u0027size\u0027]})"},{"line_number":286,"context_line":"            volume_utils.copy_volume(tmp, dest, image_meta[\u0027size\u0027])"},{"line_number":287,"context_line":"            return"},{"line_number":288,"context_line":""},{"line_number":289,"context_line":"        data \u003d qemu_img_info(tmp)"}],"source_content_type":"text/x-python","patch_set":10,"id":"AAAASn%2F%2Fu0o%3D","line":286,"in_reply_to":"AAAASn%2F%2FvHQ%3D","updated":"2013-08-30 09:21:17.000000000","message":"What would you prefer?","commit_id":"78693056931cdc4ffe08ef3d3ff034dabccd12d1"}]}
