diff options
| author | Ricardo Araújo Santos <ricardo@lsd.ufcg.edu.br> | 2016-05-16 16:10:08 -0300 |
|---|---|---|
| committer | Ricardo Araújo Santos <ricardo@lsd.ufcg.edu.br> | 2016-05-17 18:09:03 -0300 |
| commit | a90ee859a2c641c9461e918213c9816f53358548 (patch) | |
| tree | 8649272c318e1ea7489153ba8a5f0b63f0f0ea9f /ironic_python_agent/shell | |
| parent | e4e4355a632e2b76c26bb9b6b02ac8f6aea88243 (diff) | |
| download | ironic-python-agent-a90ee859a2c641c9461e918213c9816f53358548.tar.gz | |
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
Diffstat (limited to 'ironic_python_agent/shell')
| -rwxr-xr-x | ironic_python_agent/shell/copy_configdrive_to_disk.sh | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/ironic_python_agent/shell/copy_configdrive_to_disk.sh b/ironic_python_agent/shell/copy_configdrive_to_disk.sh index ecd408e6..711fb63f 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 |
