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