)]}'
{"diskimage_builder/block_device/level1/partitioning.py":[{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"8e2230bd4f057ea179f42a5d8484134f3c971fc0","unresolved":false,"context_lines":[{"line_number":222,"context_line":"        # partition calls it, but we only want to do it once and our"},{"line_number":223,"context_line":"        # gate."},{"line_number":224,"context_line":"        self.times_cleaned +\u003d 1"},{"line_number":225,"context_line":"        if self.times_cleaned \u003d\u003d self.times_created:"},{"line_number":226,"context_line":"            exec_sudo([\"kpartx\", \"-d\","},{"line_number":227,"context_line":"                       self.state[\u0027blockdev\u0027][self.base][\u0027device\u0027]])"}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_81eb47a2","line":225,"updated":"2018-06-22 05:35:43.000000000","message":"we could also reduce this down to a single variable, and just decrement it, and only do it when it reaches zero?","commit_id":"4be429a9a05b874ca619a6b398ae7c9c1c83ea29"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"65f6640537d8b075e81592d3fb8cd894f5a02f7a","unresolved":false,"context_lines":[{"line_number":219,"context_line":"        # block-device by create() above.  this is called from the"},{"line_number":220,"context_line":"        # child PartitionNode umount/delete/cleanup.  Thus every"},{"line_number":221,"context_line":"        # partition calls it, but we only want to do it once and our"},{"line_number":222,"context_line":"        # gate."},{"line_number":223,"context_line":"        self.number_of_partitions -\u003d 1"},{"line_number":224,"context_line":"        if self.number_of_partitions \u003d\u003d 0:"},{"line_number":225,"context_line":"            exec_sudo([\"kpartx\", \"-d\","}],"source_content_type":"text/x-python","patch_set":4,"id":"5f7c97a3_17c70649","line":222,"updated":"2018-06-28 07:21:12.000000000","message":"I\u0027d like this to say\n\n # Remove the partition mappings made for the parent\n # block-device by create() above.  This is called from the\n # child PartitionNode umount.  Thus every\n # partition calls it, but we only want to do it once when\n # we know this is the very last partition\n\nor something to that effect that really explains that we want to wait until last","commit_id":"d0c3a5c96ce19d504c9d66d9937c7976588ccd5e"}],"diskimage_builder/block_device/tests/test_lvm.py":[{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"8e2230bd4f057ea179f42a5d8484134f3c971fc0","unresolved":false,"context_lines":[{"line_number":1,"context_line":"#            DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE"},{"line_number":2,"context_line":"#                    Version 2, December 2004"},{"line_number":3,"context_line":"#"},{"line_number":4,"context_line":"# Copyright (C) 2018 Red Hat, Inc."}],"source_content_type":"text/x-python","patch_set":2,"id":"5f7c97a3_a1cf6355","line":1,"updated":"2018-06-22 05:35:43.000000000","message":"I\u0027m pretty sure this isn\u0027t an approved license :)\n\nLegally I think these types of things can cause problems because there\u0027s situations where you *can\u0027t* give away your rights, etc.\n\nThis looks like all the other code, I\u0027m assuming it\u0027s not copied from anywhere?","commit_id":"4be429a9a05b874ca619a6b398ae7c9c1c83ea29"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"7a45750060ca314cbaeaea7cb55402863776b113","unresolved":false,"context_lines":[{"line_number":457,"context_line":"        # Creation test"},{"line_number":458,"context_line":"        #"},{"line_number":459,"context_line":""},{"line_number":460,"context_line":"        # We mock out the following exec_sudo and other related calls"},{"line_number":461,"context_line":"        # calls for the layers we are testing."},{"line_number":462,"context_line":"        exec_sudo_lvm \u003d \u0027diskimage_builder.block_device.level1.lvm.exec_sudo\u0027"},{"line_number":463,"context_line":"        exec_sudo_part \u003d (\u0027diskimage_builder.block_device.\u0027"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_51fb33bd","line":460,"updated":"2018-06-29 01:28:29.000000000","message":"@yolanda -- I took the liberty of reworking your test slightly in here; the basic gist is that we mock out all those calls you identified, but then combine them under a single mock manager and the check the overall sequence of commands is correct (make loop device, make partitions, make lvm ... and similar for the umount case)\n\nI think this is a sufficient level of testing.  We don\u0027t need to keep going and mock out the mounting, mkfs layers etc IMO","commit_id":"13a3f1110d0f4faba6cca913ffa6d676b68534f2"},{"author":{"_account_id":7118,"name":"Ian Wienand","email":"iwienand@redhat.com","username":"iwienand"},"change_message_id":"c6a43bdf3bdc6ca3e769a3cfcf8b74c9a02e5c71","unresolved":false,"context_lines":[{"line_number":560,"context_line":"                # now remove loopback device"},{"line_number":561,"context_line":"                mock.call.sudo_loop([\u0027losetup\u0027, \u0027-d\u0027, \u0027/dev/fake/image0\u0027]),"},{"line_number":562,"context_line":"                # now final LVM cleanup call"},{"line_number":563,"context_line":"                mock.call.sudo_lvm([\u0027pvscan\u0027, \u0027--cache\u0027]),"},{"line_number":564,"context_line":"            ]"},{"line_number":565,"context_line":""},{"line_number":566,"context_line":"            manager.assert_has_calls(cmd_sequence)"}],"source_content_type":"text/x-python","patch_set":7,"id":"5f7c97a3_f51d54bf","line":563,"updated":"2018-07-26 06:32:01.000000000","message":"I\u0027m worried that we hit a failure here.  It suggests it\u0027s non-deterministic.  The actual result was\n\n call.sudo_part([\u0027kpartx\u0027, \u0027-d\u0027, \u0027/dev/fake/image0\u0027]),\n call.sudo_lvm([\u0027pvscan\u0027, \u0027--cache\u0027]),\n call.sudo_loop([\u0027losetup\u0027, \u0027-d\u0027, \u0027/dev/fake/image0\u0027])]\n\nso the losetup and pvscan swapped around.\n\nthe graph for this is \n\n https://imgur.com/a/Upv46s7\n\nthe pvscan comes from the lvm-UMOUNT node while i guess the losetup -d comes from the image0 loopback device.\n\nsince there\u0027s no link between them, i guess this can flip-flop.  have to think some more on this ... i think the follow-on change probably gets rid of this ordering issue but will have to convince myself","commit_id":"13a3f1110d0f4faba6cca913ffa6d676b68534f2"}]}
