)]}'
{"ironic_lib/disk_utils.py":[{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"149ac3063065c6310bb27f41361042ee07ce9717","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        return virtual_size"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":354,"context_line":"        comp_ratio \u003d 1.0 * allocated_clusters / total_clusters"},{"line_number":355,"context_line":"        return int(comp_ratio * virtual_size)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    return virtual_size"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_2d688085","line":354,"range":{"start_line":354,"start_character":20,"end_line":354,"end_character":62},"updated":"2018-03-20 18:12:13.000000000","message":"The \u00271.0 *\u0027 confused me for a minute until I realised that it was being used to force the equation into float. Maybe float(allocated_clusters) / float(total_clusters) would be more readable?","commit_id":"d848b3baa35c04c650a01c6bcc1a114047705d45"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"03fe252d356b379dc5b3b68aee6ff31847e9697b","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        return virtual_size"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":354,"context_line":"        comp_ratio \u003d 1.0 * allocated_clusters / total_clusters"},{"line_number":355,"context_line":"        return int(comp_ratio * virtual_size)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    return virtual_size"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_ee011008","line":354,"range":{"start_line":354,"start_character":20,"end_line":354,"end_character":62},"in_reply_to":"df7087c5_2d688085","updated":"2018-03-21 09:33:19.000000000","message":"Done","commit_id":"d848b3baa35c04c650a01c6bcc1a114047705d45"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"547ae097df8b1d6bb1a537610f7ace3998cf119d","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        return virtual_size"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":354,"context_line":"        comp_ratio \u003d 1.0 * allocated_clusters / total_clusters"},{"line_number":355,"context_line":"        return int(comp_ratio * virtual_size)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    return virtual_size"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_adb490d2","line":354,"range":{"start_line":354,"start_character":20,"end_line":354,"end_character":62},"in_reply_to":"df7087c5_2d688085","updated":"2018-03-20 18:14:03.000000000","message":"or\n\n from __future__ import division\n\n(if I remember the syntax right)","commit_id":"d848b3baa35c04c650a01c6bcc1a114047705d45"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"03fe252d356b379dc5b3b68aee6ff31847e9697b","unresolved":false,"context_lines":[{"line_number":351,"context_line":"        return virtual_size"},{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":354,"context_line":"        comp_ratio \u003d 1.0 * allocated_clusters / total_clusters"},{"line_number":355,"context_line":"        return int(comp_ratio * virtual_size)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    return virtual_size"}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_ce068c21","line":354,"range":{"start_line":354,"start_character":20,"end_line":354,"end_character":62},"in_reply_to":"df7087c5_adb490d2","updated":"2018-03-21 09:33:19.000000000","message":"Done","commit_id":"d848b3baa35c04c650a01c6bcc1a114047705d45"},{"author":{"_account_id":6637,"name":"Sam Betts","email":"sam@code-smash.net","username":"sambetts"},"change_message_id":"149ac3063065c6310bb27f41361042ee07ce9717","unresolved":false,"context_lines":[{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":354,"context_line":"        comp_ratio \u003d 1.0 * allocated_clusters / total_clusters"},{"line_number":355,"context_line":"        return int(comp_ratio * virtual_size)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    return virtual_size"},{"line_number":358,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_adb810e5","line":355,"updated":"2018-03-20 18:12:13.000000000","message":"We probably want to use int(math.ceil(comp_ratio * virtual_size)) to ensure we\u0027re rounding up to the nearest mb not down.","commit_id":"d848b3baa35c04c650a01c6bcc1a114047705d45"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"03fe252d356b379dc5b3b68aee6ff31847e9697b","unresolved":false,"context_lines":[{"line_number":352,"context_line":""},{"line_number":353,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":354,"context_line":"        comp_ratio \u003d 1.0 * allocated_clusters / total_clusters"},{"line_number":355,"context_line":"        return int(comp_ratio * virtual_size)"},{"line_number":356,"context_line":""},{"line_number":357,"context_line":"    return virtual_size"},{"line_number":358,"context_line":""}],"source_content_type":"text/x-python","patch_set":1,"id":"df7087c5_11126959","line":355,"in_reply_to":"df7087c5_adb810e5","updated":"2018-03-21 09:33:19.000000000","message":"Done","commit_id":"d848b3baa35c04c650a01c6bcc1a114047705d45"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ee0e09a9798e84150e47b3a0182ca9ad82ba1e93","unresolved":false,"context_lines":[{"line_number":318,"context_line":"                             prlimit\u003dQEMU_IMG_LIMITS)"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"    if err:"},{"line_number":321,"context_line":"        LOG.info(\"Error running `qemu-img check` for image %(img)s: %(err)s\","},{"line_number":322,"context_line":"                 {\u0027img\u0027: path, \u0027err\u0027: err})"},{"line_number":323,"context_line":"        return {}"},{"line_number":324,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_ec6eef94","line":321,"updated":"2018-03-21 15:23:54.000000000","message":"s/info/warning/ maybe?","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"b31f0fee3e617e53dfcbc7d5f16350ec66015e1c","unresolved":false,"context_lines":[{"line_number":318,"context_line":"                             prlimit\u003dQEMU_IMG_LIMITS)"},{"line_number":319,"context_line":""},{"line_number":320,"context_line":"    if err:"},{"line_number":321,"context_line":"        LOG.info(\"Error running `qemu-img check` for image %(img)s: %(err)s\","},{"line_number":322,"context_line":"                 {\u0027img\u0027: path, \u0027err\u0027: err})"},{"line_number":323,"context_line":"        return {}"},{"line_number":324,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_6aa2ac9c","line":321,"in_reply_to":"df7087c5_ec6eef94","updated":"2018-03-22 08:45:59.000000000","message":"Done","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ee0e09a9798e84150e47b3a0182ca9ad82ba1e93","unresolved":false,"context_lines":[{"line_number":326,"context_line":"        return json.loads(out)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    except ValueError as ex:"},{"line_number":329,"context_line":"        LOG.info(\"Error parsing `qemu-img check` output for image \""},{"line_number":330,"context_line":"                 \"%(img)s: %(err)s\", {\u0027img\u0027: path, \u0027err\u0027: ex})"},{"line_number":331,"context_line":"        return {}"},{"line_number":332,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_8c6df399","line":329,"updated":"2018-03-21 15:23:54.000000000","message":"here certainly s/info/warning/ (it may be a sign of a bug even)","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"b31f0fee3e617e53dfcbc7d5f16350ec66015e1c","unresolved":false,"context_lines":[{"line_number":326,"context_line":"        return json.loads(out)"},{"line_number":327,"context_line":""},{"line_number":328,"context_line":"    except ValueError as ex:"},{"line_number":329,"context_line":"        LOG.info(\"Error parsing `qemu-img check` output for image \""},{"line_number":330,"context_line":"                 \"%(img)s: %(err)s\", {\u0027img\u0027: path, \u0027err\u0027: ex})"},{"line_number":331,"context_line":"        return {}"},{"line_number":332,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_cab418d4","line":329,"in_reply_to":"df7087c5_8c6df399","updated":"2018-03-22 08:45:59.000000000","message":"Done","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ee0e09a9798e84150e47b3a0182ca9ad82ba1e93","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        total_clusters \u003d img_info[\u0027total-clusters\u0027]"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    except KeyError:"},{"line_number":351,"context_line":"        LOG.info(\"Missing required data in `qemu-img check` output for image \""},{"line_number":352,"context_line":"                 \"%(img)s.\", {\u0027img\u0027: path})"},{"line_number":353,"context_line":"        return virtual_size"},{"line_number":354,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_ac68f786","line":351,"updated":"2018-03-21 15:23:54.000000000","message":"s/info/warning/ though it may duplicate with the warnings above (since we return {} on error there)","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"b31f0fee3e617e53dfcbc7d5f16350ec66015e1c","unresolved":false,"context_lines":[{"line_number":348,"context_line":"        total_clusters \u003d img_info[\u0027total-clusters\u0027]"},{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    except KeyError:"},{"line_number":351,"context_line":"        LOG.info(\"Missing required data in `qemu-img check` output for image \""},{"line_number":352,"context_line":"                 \"%(img)s.\", {\u0027img\u0027: path})"},{"line_number":353,"context_line":"        return virtual_size"},{"line_number":354,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_4ac0082b","line":351,"in_reply_to":"df7087c5_ac68f786","updated":"2018-03-22 08:45:59.000000000","message":"Done","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ee0e09a9798e84150e47b3a0182ca9ad82ba1e93","unresolved":false,"context_lines":[{"line_number":352,"context_line":"                 \"%(img)s.\", {\u0027img\u0027: path})"},{"line_number":353,"context_line":"        return virtual_size"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":356,"context_line":"        comp_ratio \u003d allocated_clusters / total_clusters"},{"line_number":357,"context_line":"        return int(math.ceil(comp_ratio * virtual_size))"},{"line_number":358,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_4c059bc1","line":355,"updated":"2018-03-21 15:23:54.000000000","message":"I\u0027d prefer a comment on why we compare total_clusers with allocated_clusters here","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"b31f0fee3e617e53dfcbc7d5f16350ec66015e1c","unresolved":false,"context_lines":[{"line_number":352,"context_line":"                 \"%(img)s.\", {\u0027img\u0027: path})"},{"line_number":353,"context_line":"        return virtual_size"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":356,"context_line":"        comp_ratio \u003d allocated_clusters / total_clusters"},{"line_number":357,"context_line":"        return int(math.ceil(comp_ratio * virtual_size))"},{"line_number":358,"context_line":""}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_cae978b7","line":355,"in_reply_to":"df7087c5_4c059bc1","updated":"2018-03-22 08:45:59.000000000","message":"Done","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"9786ff4e95b1144b61d1aa29e228cfe262858661","unresolved":false,"context_lines":[{"line_number":359,"context_line":"    # of \"sparseness\" which is taken as the ratio of allocated vs total number"},{"line_number":360,"context_line":"    # of QCOW2 clusters."},{"line_number":361,"context_line":"    # It is not quite clear, however, how QCOW2 image compression may influence"},{"line_number":362,"context_line":"    # this \"sparseness\" factor..."},{"line_number":363,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":364,"context_line":"        comp_ratio \u003d allocated_clusters / total_clusters"},{"line_number":365,"context_line":"        return int(math.ceil(comp_ratio * virtual_size))"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf659307_bb5093d6","line":362,"updated":"2018-03-23 16:37:02.000000000","message":"I think this factor kind of realistically prevents this working as intended. \n\nMy understanding is that this is intended to be a catch/guard against trying to deploy an image that is too big to a baremetal node, however I would argue two points:\n\n1) This is not as big as a factor today in real environments given the reduction of cost per megabyte. It may be a huge factor in virtualized test environments or where someone has taken a 1TB filesystem and is trying to load that on to a slightly smaller 1TB drive. Naturally that is always going to fail. \n\n2) If we really want to provide accurate data, we need to be willing to crack open the image and evaluate what the underlying filesystem indicates for the amount of data that is actually used. The downside is this won\u0027t uniformly work, and even then we would still need to look at partition tables. This kind of helps solve the issue of the first point where a user may only have 6GB of data in the image, but essentially it is a 1TB sparse image compressed down to 7GB because of unallocated and whitespace data in the image.\n\nI think even doing filesystem/partition evaluation is the only realistic route to provide an early guard and fail the deployment early. I\u0027m just not sure what value it actually brings Ironic.","commit_id":"b3234bbceba8d9209db75a6f4bc6e7b0dfa0b150"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"5578a483ca80b79bc9c38435bae7ca454cd27c22","unresolved":false,"context_lines":[{"line_number":359,"context_line":"    # of \"sparseness\" which is taken as the ratio of allocated vs total number"},{"line_number":360,"context_line":"    # of QCOW2 clusters."},{"line_number":361,"context_line":"    # It is not quite clear, however, how QCOW2 image compression may influence"},{"line_number":362,"context_line":"    # this \"sparseness\" factor..."},{"line_number":363,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":364,"context_line":"        comp_ratio \u003d allocated_clusters / total_clusters"},{"line_number":365,"context_line":"        return int(math.ceil(comp_ratio * virtual_size))"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_82927b57","line":362,"in_reply_to":"5f7c97a3_6db74287","updated":"2018-07-04 09:54:52.000000000","message":"\u003e 1) I like this idea, as long as we default it to 1 and document\n \u003e that compression ratios vary, and that operators should set this as\n \u003e they feel necessary.\n \u003e 2) I\u0027m not sure we have enough information, but that is \n\nWe used to have #1 implemented in one of the patchsets within this patch.\n\nThe latest patchset implements #2. Do you think the QCOW cluster metadata is not enough for an educated guess to take?\n\nAre you suggesting to have #1 implemented as a fallback option in case #2 conks out?","commit_id":"b3234bbceba8d9209db75a6f4bc6e7b0dfa0b150"},{"author":{"_account_id":11655,"name":"Julia Kreger","email":"juliaashleykreger@gmail.com","username":"jkreger","status":"Flying to the moon with a Jetpack!"},"change_message_id":"55836eae0206a75480fbb5bb46139bedfc37c834","unresolved":false,"context_lines":[{"line_number":359,"context_line":"    # of \"sparseness\" which is taken as the ratio of allocated vs total number"},{"line_number":360,"context_line":"    # of QCOW2 clusters."},{"line_number":361,"context_line":"    # It is not quite clear, however, how QCOW2 image compression may influence"},{"line_number":362,"context_line":"    # this \"sparseness\" factor..."},{"line_number":363,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":364,"context_line":"        comp_ratio \u003d allocated_clusters / total_clusters"},{"line_number":365,"context_line":"        return int(math.ceil(comp_ratio * virtual_size))"}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_6db74287","line":362,"in_reply_to":"bf659307_4f45cab2","updated":"2018-07-02 13:11:08.000000000","message":"0 works for raw, but not compressed images :(\n1) I like this idea, as long as we default it to 1 and document that compression ratios vary, and that operators should set this as they feel necessary.\n2) I\u0027m not sure we have enough information, but that is somewhat viable to me.\n3, 4) Operators would need to be able to disable this, and we can\u0027t extend the deploy time too much longer otherwise we will have deployment failures. Likely we would be unable to test this in CI.\n5) I suspect this would be a user supplied value, and that would have a very slow uptake in usage. :(","commit_id":"b3234bbceba8d9209db75a6f4bc6e7b0dfa0b150"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"dd562bd6ebc944a04798f40852bcbdf212521670","unresolved":false,"context_lines":[{"line_number":359,"context_line":"    # of \"sparseness\" which is taken as the ratio of allocated vs total number"},{"line_number":360,"context_line":"    # of QCOW2 clusters."},{"line_number":361,"context_line":"    # It is not quite clear, however, how QCOW2 image compression may influence"},{"line_number":362,"context_line":"    # this \"sparseness\" factor..."},{"line_number":363,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":364,"context_line":"        comp_ratio \u003d allocated_clusters / total_clusters"},{"line_number":365,"context_line":"        return int(math.ceil(comp_ratio * virtual_size))"}],"source_content_type":"text/x-python","patch_set":4,"id":"bf659307_4f45cab2","line":362,"in_reply_to":"bf659307_bb5093d6","updated":"2018-03-26 12:24:27.000000000","message":"Thanks for the write up!\n\nNow the question is - are we willing to solve it and how? It seems that direct comparison of physical drive size against virtual image size sometimes backfires at places...\n\nSo far we looked into / tried these:\n\n0. Bite the bullet and see if image virtual size can possibly fit local drive. This is what we have in master now.\n\n1. Take compressed image size and multiply it by the user-controlled constant (because all constants are variables in the Universe), then make sure that local drive can accommodate that many bytes.\n\n2. Use image metadata to figure out the ratio of used/total clusters, the multiply compressed image size by that ratio coefficient to get an estimation of raw image size.\n\n3. Actually unpack the image locally (rather than on the node during deployment) and measure its ultimate size. This may not always work because of insufficient space on ironic conductor machine.\n\n4. Pretend to unpack the image locally. Maybe we could come up with a simple FUSE-based, write-only file system [A] which ironic could mount and trick qemu-img to write its stuff on it. This fake file system would not actually store the data, but just keep track on how much is written and respond to `getattr` properly.\n\n5. May be we could convince glance to do the actual raw image size measurement in its own way (because glance is likely to have some free space available to its disposal), then just expose the number through its API/metadata.\n\nWDYT?\n\nA. https://github.com/terencehonles/fusepy/blob/master/examples/loopback.py","commit_id":"b3234bbceba8d9209db75a6f4bc6e7b0dfa0b150"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ca920e732b10873c833de438e11a2b7ec0dc6ea6","unresolved":false,"context_lines":[{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    except KeyError:"},{"line_number":351,"context_line":"        LOG.warning(\"Missing required data in `qemu-img check` output for \""},{"line_number":352,"context_line":"                    \"image %(img)s.\", {\u0027img\u0027: path})"},{"line_number":353,"context_line":"        return virtual_size"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    # NOTE(etingof): the heuristics here is that no QCOW2 clusters get"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_9dd3a35f","line":352,"updated":"2018-10-12 09:49:43.000000000","message":"nit: I\u0027d include the missing key","commit_id":"9a9ac2127d2a466e3237ea498bc931bfe459057f"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4ce7edc04711ced56aebf39f03e73cb3f7faa68e","unresolved":false,"context_lines":[{"line_number":349,"context_line":""},{"line_number":350,"context_line":"    except KeyError:"},{"line_number":351,"context_line":"        LOG.warning(\"Missing required data in `qemu-img check` output for \""},{"line_number":352,"context_line":"                    \"image %(img)s.\", {\u0027img\u0027: path})"},{"line_number":353,"context_line":"        return virtual_size"},{"line_number":354,"context_line":""},{"line_number":355,"context_line":"    # NOTE(etingof): the heuristics here is that no QCOW2 clusters get"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_bbbcd207","line":352,"in_reply_to":"3f79a3b5_9dd3a35f","updated":"2018-10-19 12:02:16.000000000","message":"Done","commit_id":"9a9ac2127d2a466e3237ea498bc931bfe459057f"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ca920e732b10873c833de438e11a2b7ec0dc6ea6","unresolved":false,"context_lines":[{"line_number":361,"context_line":"    # It is not quite clear, however, how QCOW2 image compression may influence"},{"line_number":362,"context_line":"    # this \"sparseness\" factor..."},{"line_number":363,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":364,"context_line":"        comp_ratio \u003d allocated_clusters / total_clusters"},{"line_number":365,"context_line":"        return int(math.ceil(comp_ratio * virtual_size))"},{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    return virtual_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_3dc4cf93","line":364,"updated":"2018-10-12 09:49:43.000000000","message":"is it fine that on python 2 the value is rounded to an int? I think it\u0027s better to have ratio as float.","commit_id":"9a9ac2127d2a466e3237ea498bc931bfe459057f"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4ce7edc04711ced56aebf39f03e73cb3f7faa68e","unresolved":false,"context_lines":[{"line_number":361,"context_line":"    # It is not quite clear, however, how QCOW2 image compression may influence"},{"line_number":362,"context_line":"    # this \"sparseness\" factor..."},{"line_number":363,"context_line":"    if total_clusters and total_clusters \u003e allocated_clusters:"},{"line_number":364,"context_line":"        comp_ratio \u003d allocated_clusters / total_clusters"},{"line_number":365,"context_line":"        return int(math.ceil(comp_ratio * virtual_size))"},{"line_number":366,"context_line":""},{"line_number":367,"context_line":"    return virtual_size"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_9b44761c","line":364,"in_reply_to":"3f79a3b5_3dc4cf93","updated":"2018-10-19 12:02:16.000000000","message":"Done","commit_id":"9a9ac2127d2a466e3237ea498bc931bfe459057f"}],"ironic_lib/tests/test_disk_utils.py":[{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ee0e09a9798e84150e47b3a0182ca9ad82ba1e93","unresolved":false,"context_lines":[{"line_number":792,"context_line":"        self.assertEqual(500, disk_utils.get_raw_image_mb(\u0027x\u0027))"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        # faulty `qemu check`"},{"line_number":795,"context_line":"        mock_qcheck.return_value \u003d {}"},{"line_number":796,"context_line":"        self.assertEqual(1000, disk_utils.get_raw_image_mb(\u0027x\u0027))"},{"line_number":797,"context_line":""},{"line_number":798,"context_line":"        # broken image counters"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_0c5a43f2","line":795,"updated":"2018-03-21 15:23:54.000000000","message":"this should be a new test","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"b31f0fee3e617e53dfcbc7d5f16350ec66015e1c","unresolved":false,"context_lines":[{"line_number":792,"context_line":"        self.assertEqual(500, disk_utils.get_raw_image_mb(\u0027x\u0027))"},{"line_number":793,"context_line":""},{"line_number":794,"context_line":"        # faulty `qemu check`"},{"line_number":795,"context_line":"        mock_qcheck.return_value \u003d {}"},{"line_number":796,"context_line":"        self.assertEqual(1000, disk_utils.get_raw_image_mb(\u0027x\u0027))"},{"line_number":797,"context_line":""},{"line_number":798,"context_line":"        # broken image counters"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_ea19dc87","line":795,"in_reply_to":"df7087c5_0c5a43f2","updated":"2018-03-22 08:45:59.000000000","message":"Done","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ee0e09a9798e84150e47b3a0182ca9ad82ba1e93","unresolved":false,"context_lines":[{"line_number":796,"context_line":"        self.assertEqual(1000, disk_utils.get_raw_image_mb(\u0027x\u0027))"},{"line_number":797,"context_line":""},{"line_number":798,"context_line":"        # broken image counters"},{"line_number":799,"context_line":"        mock_qcheck.return_value \u003d {"},{"line_number":800,"context_line":"            \u0027allocated-clusters\u0027: 10,"},{"line_number":801,"context_line":"            \u0027total-clusters\u0027: 0"},{"line_number":802,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_2c5dc7e8","line":799,"updated":"2018-03-21 15:23:54.000000000","message":"and this is another one","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"b31f0fee3e617e53dfcbc7d5f16350ec66015e1c","unresolved":false,"context_lines":[{"line_number":796,"context_line":"        self.assertEqual(1000, disk_utils.get_raw_image_mb(\u0027x\u0027))"},{"line_number":797,"context_line":""},{"line_number":798,"context_line":"        # broken image counters"},{"line_number":799,"context_line":"        mock_qcheck.return_value \u003d {"},{"line_number":800,"context_line":"            \u0027allocated-clusters\u0027: 10,"},{"line_number":801,"context_line":"            \u0027total-clusters\u0027: 0"},{"line_number":802,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_0a1d3072","line":799,"in_reply_to":"df7087c5_2c5dc7e8","updated":"2018-03-22 08:45:59.000000000","message":"Done","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ee0e09a9798e84150e47b3a0182ca9ad82ba1e93","unresolved":false,"context_lines":[{"line_number":803,"context_line":"        self.assertEqual(1000, disk_utils.get_raw_image_mb(\u0027x\u0027))"},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        # broken image counters"},{"line_number":806,"context_line":"        mock_qcheck.return_value \u003d {"},{"line_number":807,"context_line":"            \u0027allocated-clusters\u0027: 20,"},{"line_number":808,"context_line":"            \u0027total-clusters\u0027: 10"},{"line_number":809,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_cc73eb7f","line":806,"updated":"2018-03-21 15:23:54.000000000","message":"and the 4th one","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"b31f0fee3e617e53dfcbc7d5f16350ec66015e1c","unresolved":false,"context_lines":[{"line_number":803,"context_line":"        self.assertEqual(1000, disk_utils.get_raw_image_mb(\u0027x\u0027))"},{"line_number":804,"context_line":""},{"line_number":805,"context_line":"        # broken image counters"},{"line_number":806,"context_line":"        mock_qcheck.return_value \u003d {"},{"line_number":807,"context_line":"            \u0027allocated-clusters\u0027: 20,"},{"line_number":808,"context_line":"            \u0027total-clusters\u0027: 10"},{"line_number":809,"context_line":"        }"}],"source_content_type":"text/x-python","patch_set":2,"id":"df7087c5_aa13e465","line":806,"in_reply_to":"df7087c5_cc73eb7f","updated":"2018-03-22 08:45:59.000000000","message":"Done","commit_id":"a4ab59a68e11f100527439cd631e722d9170231e"},{"author":{"_account_id":10239,"name":"Dmitry Tantsur","email":"dtantsur@protonmail.com","username":"dtantsur"},"change_message_id":"ca920e732b10873c833de438e11a2b7ec0dc6ea6","unresolved":false,"context_lines":[{"line_number":785,"context_line":"        mock_qinfo.return_value.virtual_size \u003d 1000 * mb"},{"line_number":786,"context_line":""},{"line_number":787,"context_line":"        mock_qcheck.return_value \u003d {"},{"line_number":788,"context_line":"            \u0027allocated-clusters\u0027: 10,"},{"line_number":789,"context_line":"            \u0027total-clusters\u0027: 20"},{"line_number":790,"context_line":"        }"},{"line_number":791,"context_line":"        self.assertEqual(500, disk_utils.get_raw_image_mb(\u0027x\u0027))"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_7dcec7b7","line":788,"updated":"2018-10-12 09:49:43.000000000","message":"let\u0027s s/10/15/ to make sure we do floats right","commit_id":"9a9ac2127d2a466e3237ea498bc931bfe459057f"},{"author":{"_account_id":26340,"name":"Ilya Etingof","email":"etingof@gmail.com","username":"etingof"},"change_message_id":"4ce7edc04711ced56aebf39f03e73cb3f7faa68e","unresolved":false,"context_lines":[{"line_number":785,"context_line":"        mock_qinfo.return_value.virtual_size \u003d 1000 * mb"},{"line_number":786,"context_line":""},{"line_number":787,"context_line":"        mock_qcheck.return_value \u003d {"},{"line_number":788,"context_line":"            \u0027allocated-clusters\u0027: 10,"},{"line_number":789,"context_line":"            \u0027total-clusters\u0027: 20"},{"line_number":790,"context_line":"        }"},{"line_number":791,"context_line":"        self.assertEqual(500, disk_utils.get_raw_image_mb(\u0027x\u0027))"}],"source_content_type":"text/x-python","patch_set":5,"id":"3f79a3b5_db53cedd","line":788,"in_reply_to":"3f79a3b5_7dcec7b7","updated":"2018-10-19 12:02:16.000000000","message":"Done","commit_id":"9a9ac2127d2a466e3237ea498bc931bfe459057f"}]}
