From a90ee859a2c641c9461e918213c9816f53358548 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ricardo=20Ara=C3=BAjo=20Santos?= Date: Mon, 16 May 2016 16:10:08 -0300 Subject: [PATCH] Prevent failure on 'copy_configdrive_to_disk.sh' The script splits 'sfdisk' output wrongly in blank spaces leading to failures when partition id is greater than 10, e.g.: "/dev/sda10: start= ...". This fix splits the output on ":" and trims trailing space when partition id is less than 10, e.g.: "/dev/sda1 : start= ...". Change-Id: I23f4b747fc0a86713cb912afc5d193398e6a597b Closes-Bug: 1581699 --- ironic_python_agent/shell/copy_configdrive_to_disk.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ironic_python_agent/shell/copy_configdrive_to_disk.sh b/ironic_python_agent/shell/copy_configdrive_to_disk.sh index ecd408e6e..711fb63f1 100755 --- a/ironic_python_agent/shell/copy_configdrive_to_disk.sh +++ b/ironic_python_agent/shell/copy_configdrive_to_disk.sh @@ -104,7 +104,7 @@ else # Find partition we just created # Dump all partitions, ignore empty ones, then get the last partition ID - ISO_PARTITION=`sfdisk --dump $DEVICE | grep -v ' 0,' | tail -n1 | awk '{print $1}'` || fail "finding ISO partition created on ${DEVICE}" + ISO_PARTITION=`sfdisk --dump $DEVICE | grep -v ' 0,' | tail -n1 | awk -F ':' '{print $1}' | sed -e 's/\s*$//'` || fail "finding ISO partition created on ${DEVICE}" # Wait for udev to pick up the partition udevadm settle --exit-if-exists=$ISO_PARTITION