)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":7080,"name":"Mathieu Mitchell","email":"mat128@gmail.com","username":"mat128"},"change_message_id":"be04cd546a8727ae5a65900175c277dd8a3017d4","unresolved":false,"context_lines":[{"line_number":12,"context_line":"* parted should be used instead of partprobe to determine the type of"},{"line_number":13,"context_line":"  the disk;"},{"line_number":14,"context_line":"* gdisk -l sorts the partitions by their number, sort them by start"},{"line_number":15,"context_line":"  secrtor instead;"},{"line_number":16,"context_line":"* after sgdisk completion, the configdrive device is not immedaiately"},{"line_number":17,"context_line":"  visible in the /dev folder, and partx -u/partprobe do not help, add"},{"line_number":18,"context_line":"  a sleep there."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa6399be_00d54ab8","line":15,"range":{"start_line":15,"start_character":2,"end_line":15,"end_character":9},"updated":"2016-10-17 14:57:36.000000000","message":"sector","commit_id":"7cc81801e9c6b87e828a6659d2bd0cdd87204e9c"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"bcd65dee7a39572edf9eff407bc28d4b09a6f810","unresolved":false,"context_lines":[{"line_number":12,"context_line":"* parted should be used instead of partprobe to determine the type of"},{"line_number":13,"context_line":"  the disk;"},{"line_number":14,"context_line":"* gdisk -l sorts the partitions by their number, sort them by start"},{"line_number":15,"context_line":"  secrtor instead;"},{"line_number":16,"context_line":"* after sgdisk completion, the configdrive device is not immedaiately"},{"line_number":17,"context_line":"  visible in the /dev folder, and partx -u/partprobe do not help, add"},{"line_number":18,"context_line":"  a sleep there."}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa6399be_3cec2b8f","line":15,"range":{"start_line":15,"start_character":2,"end_line":15,"end_character":9},"in_reply_to":"fa6399be_00d54ab8","updated":"2016-10-17 21:29:13.000000000","message":"Done","commit_id":"7cc81801e9c6b87e828a6659d2bd0cdd87204e9c"},{"author":{"_account_id":7080,"name":"Mathieu Mitchell","email":"mat128@gmail.com","username":"mat128"},"change_message_id":"be04cd546a8727ae5a65900175c277dd8a3017d4","unresolved":false,"context_lines":[{"line_number":13,"context_line":"  the disk;"},{"line_number":14,"context_line":"* gdisk -l sorts the partitions by their number, sort them by start"},{"line_number":15,"context_line":"  secrtor instead;"},{"line_number":16,"context_line":"* after sgdisk completion, the configdrive device is not immedaiately"},{"line_number":17,"context_line":"  visible in the /dev folder, and partx -u/partprobe do not help, add"},{"line_number":18,"context_line":"  a sleep there."},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa6399be_20da4eea","line":16,"range":{"start_line":16,"start_character":57,"end_line":16,"end_character":69},"updated":"2016-10-17 14:57:36.000000000","message":"immediately","commit_id":"7cc81801e9c6b87e828a6659d2bd0cdd87204e9c"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"bcd65dee7a39572edf9eff407bc28d4b09a6f810","unresolved":false,"context_lines":[{"line_number":13,"context_line":"  the disk;"},{"line_number":14,"context_line":"* gdisk -l sorts the partitions by their number, sort them by start"},{"line_number":15,"context_line":"  secrtor instead;"},{"line_number":16,"context_line":"* after sgdisk completion, the configdrive device is not immedaiately"},{"line_number":17,"context_line":"  visible in the /dev folder, and partx -u/partprobe do not help, add"},{"line_number":18,"context_line":"  a sleep there."},{"line_number":19,"context_line":""}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa6399be_5c01df38","line":16,"range":{"start_line":16,"start_character":57,"end_line":16,"end_character":69},"in_reply_to":"fa6399be_20da4eea","updated":"2016-10-17 21:29:13.000000000","message":"Done","commit_id":"7cc81801e9c6b87e828a6659d2bd0cdd87204e9c"}],"ironic_python_agent/shell/copy_configdrive_to_disk.sh":[{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"65d1bbeb9da7e6fe15ea20e954cac225e5f2161f","unresolved":false,"context_lines":[{"line_number":82,"context_line":""},{"line_number":83,"context_line":"    gdisk -l $DEVICE | grep -A$MAX_DISK_PARTITIONS \"Number  Start\" | grep -v \"Number  Start\" \u003e $UPDATED_PARTITION_LIST"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    CONFIG_PARTITION_ID\u003d`diff $EXISTING_PARTITION_LIST $UPDATED_PARTITION_LIST | tail -n1 |awk \u0027{print $1}\u0027`"},{"line_number":86,"context_line":"    ISO_PARTITION\u003d\"${DEVICE}${CONFIG_PARTITION_ID}\""},{"line_number":87,"context_line":"  else"},{"line_number":88,"context_line":"    log \"Working on MBR only device $DEVICE\""}],"source_content_type":"text/x-sh","patch_set":1,"id":"fa6399be_c17026df","line":85,"updated":"2016-10-17 11:33:53.000000000","message":"The problem is as follows:\n\ngdisk -l sorts partitions by number, while parted prints boot partition first. In case of gpt, there is an 8 megabytes boot partition with number 15 in my case at the beginning of the disk. In tinycore, the diff command output is different than eg on ubuntu, and it outputs the 1 line of context by default, so by doing \u0027tail -n1\u0027 we get the last line of context, which is partition 15. Configdrive gets mistakenly written there. So print $2 is actually correct here, we need to resort the output on l77\u002683 by the second (start position) column instead.","commit_id":"c30b755b79a35197cd4688d5d4337bf35f6c7db0"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"86236c5866c157144e43c9a6a914d8e25d6869bd","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    # Create small partition at the end of the device"},{"line_number":81,"context_line":"    log \"Adding configdrive partition to $DEVICE\""},{"line_number":82,"context_line":"    sgdisk -n 0:-64MB:0 $DEVICE || fail \"creating configdrive on ${DEVICE}\""},{"line_number":83,"context_line":"    sleep 60"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    gdisk -l $DEVICE | grep -A$MAX_DISK_PARTITIONS \"Number  Start\" | grep -v \"Number  Start\" | sort -k 2 \u003e $UPDATED_PARTITION_LIST"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"fa6399be_e0a3f6fe","line":83,"updated":"2016-10-17 14:38:06.000000000","message":"Unfortunately, the partx/partprobe do not help, when I used them, this still happened:\n\n + echo \u0027copy_configdrive_to_disk.sh: Adding configdrive partition to /dev/vda\u0027\n + sgdisk -n 0:-64MB:0 /dev/vda\n + partx -u /dev/vda\n + partprobe /dev/vda\n + grep -A128 \u0027Number  Start\u0027\n + sort -k 2\n + gdisk -l /dev/vda\n + grep -v \u0027Number  Start\u0027\n ++ diff /tmp/tmp.FXxNFOY0Rc/existing_partitions /tmp/tmp.FXxNFOY0Rc/updated_partitions\n ++ tail -n1\n ++ awk \u0027{print $2}\u0027\n + CONFIG_PARTITION_ID\u003d2\n + ISO_PARTITION\u003d/dev/vda2\n + log \u0027Writing Configdrive contents in /tmp/configdrive to /dev/vda2\u0027\n ++ basename /usr/local/lib/python2.7/site-packages/ironic_python_agent/extensions/../shell/copy_configdrive_to_disk.sh\n + echo \u0027copy_configdrive_to_disk.sh: Writing Configdrive contents in /tmp/configdrive to /dev/vda2\u0027\n + dd if\u003d/tmp/configdrive of\u003d/dev/vda2 bs\u003d64K oflag\u003ddirect\ndd: failed to open \u0027/dev/vda2\u0027: Invalid argument\n + fail \u0027writing Configdrive to /dev/vda2\u0027\n + log \u0027Error writing Configdrive to /dev/vda2\u0027\n ++ basename /usr/local/lib/python2.7/site-packages/ironic_python_agent/extensions/../shell/copy_configdrive_to_disk.sh\n + echo \u0027copy_configdrive_to_disk.sh: Error writing Configdrive to /dev/vda2\u0027\n + exit 1","commit_id":"7cc81801e9c6b87e828a6659d2bd0cdd87204e9c"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"d6c65b6003bdf3c3f1a276925b5ac0d5756d60dd","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    # Create small partition at the end of the device"},{"line_number":81,"context_line":"    log \"Adding configdrive partition to $DEVICE\""},{"line_number":82,"context_line":"    sgdisk -n 0:-64MB:0 $DEVICE || fail \"creating configdrive on ${DEVICE}\""},{"line_number":83,"context_line":"    sleep 60"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    gdisk -l $DEVICE | grep -A$MAX_DISK_PARTITIONS \"Number  Start\" | grep -v \"Number  Start\" | sort -k 2 \u003e $UPDATED_PARTITION_LIST"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"fa6399be_26b89be5","line":83,"in_reply_to":"fa6399be_2395f887","updated":"2016-10-17 18:59:50.000000000","message":"sync won\u0027t help iiuc, as in this case, we are not buffering any writes, as eg /dev/vda2 is not a file really. partprobe should be triggering the update, but in this case it does not for some reason. I think I\u0027ll go with retries for now.","commit_id":"7cc81801e9c6b87e828a6659d2bd0cdd87204e9c"},{"author":{"_account_id":12356,"name":"Vladyslav Drok","email":"vdrok@mirantis.com","username":"vdrok"},"change_message_id":"0306e72af11c84464d60b9450ead5f9e701d97ed","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    # Create small partition at the end of the device"},{"line_number":81,"context_line":"    log \"Adding configdrive partition to $DEVICE\""},{"line_number":82,"context_line":"    sgdisk -n 0:-64MB:0 $DEVICE || fail \"creating configdrive on ${DEVICE}\""},{"line_number":83,"context_line":"    sleep 60"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    gdisk -l $DEVICE | grep -A$MAX_DISK_PARTITIONS \"Number  Start\" | grep -v \"Number  Start\" | sort -k 2 \u003e $UPDATED_PARTITION_LIST"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"fa6399be_7125ec08","line":83,"in_reply_to":"fa6399be_26b89be5","updated":"2016-10-17 20:57:54.000000000","message":"Heh, I can\u0027t read apparently :) udevadm from line 112 works perfectly in this case too!","commit_id":"7cc81801e9c6b87e828a6659d2bd0cdd87204e9c"},{"author":{"_account_id":7080,"name":"Mathieu Mitchell","email":"mat128@gmail.com","username":"mat128"},"change_message_id":"be04cd546a8727ae5a65900175c277dd8a3017d4","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    # Create small partition at the end of the device"},{"line_number":81,"context_line":"    log \"Adding configdrive partition to $DEVICE\""},{"line_number":82,"context_line":"    sgdisk -n 0:-64MB:0 $DEVICE || fail \"creating configdrive on ${DEVICE}\""},{"line_number":83,"context_line":"    sleep 60"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    gdisk -l $DEVICE | grep -A$MAX_DISK_PARTITIONS \"Number  Start\" | grep -v \"Number  Start\" | sort -k 2 \u003e $UPDATED_PARTITION_LIST"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"fa6399be_2395f887","line":83,"in_reply_to":"fa6399be_4022e202","updated":"2016-10-17 14:57:36.000000000","message":"Worst case, can we loop \"until\" $CONFIG_PARTITION_ID exists?","commit_id":"7cc81801e9c6b87e828a6659d2bd0cdd87204e9c"},{"author":{"_account_id":14760,"name":"John L. Villalovos","email":"openstack.org@sodarock.com","username":"jlvillal"},"change_message_id":"f89dae87401e1ef8cab24c83a2a7d0f95a666e2b","unresolved":false,"context_lines":[{"line_number":80,"context_line":"    # Create small partition at the end of the device"},{"line_number":81,"context_line":"    log \"Adding configdrive partition to $DEVICE\""},{"line_number":82,"context_line":"    sgdisk -n 0:-64MB:0 $DEVICE || fail \"creating configdrive on ${DEVICE}\""},{"line_number":83,"context_line":"    sleep 60"},{"line_number":84,"context_line":""},{"line_number":85,"context_line":"    gdisk -l $DEVICE | grep -A$MAX_DISK_PARTITIONS \"Number  Start\" | grep -v \"Number  Start\" | sort -k 2 \u003e $UPDATED_PARTITION_LIST"},{"line_number":86,"context_line":""}],"source_content_type":"text/x-sh","patch_set":2,"id":"fa6399be_4022e202","line":83,"in_reply_to":"fa6399be_e0a3f6fe","updated":"2016-10-17 14:48:04.000000000","message":"Would the \u0027sync\u0027 command help? Instead of sleep?","commit_id":"7cc81801e9c6b87e828a6659d2bd0cdd87204e9c"}]}
