summaryrefslogtreecommitdiff
path: root/ironic_python_agent/shell
diff options
context:
space:
mode:
authorJay Faulkner <jay@jvf.cc>2014-06-11 16:10:41 -0700
committerJay Faulkner <jay@jvf.cc>2014-06-11 16:10:41 -0700
commitd159aec4f01795726dccc2bc8ccece3655668e2f (patch)
tree1ae8d451beaba7c07848fe62c48d12fb84bc02db /ironic_python_agent/shell
parentd82b8c6bc0bf0131fb4bec6d18920191f68f2b54 (diff)
downloadironic-python-agent-d159aec4f01795726dccc2bc8ccece3655668e2f.tar.gz
Fix: partitions recently imaged not being detected
When we have just written out a whole disk image, if we do not run partprobe none of the new partitions show up in blkid, therefore even images with a built-in configdrive partition will have one created Change-Id: I6ec98dc237b42bfe94ce79cf84d155332335c9f6
Diffstat (limited to 'ironic_python_agent/shell')
-rwxr-xr-xironic_python_agent/shell/copy_configdrive_to_disk.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/ironic_python_agent/shell/copy_configdrive_to_disk.sh b/ironic_python_agent/shell/copy_configdrive_to_disk.sh
index 8d6da02c..8b41cdca 100755
--- a/ironic_python_agent/shell/copy_configdrive_to_disk.sh
+++ b/ironic_python_agent/shell/copy_configdrive_to_disk.sh
@@ -37,6 +37,10 @@ DEVICE="$2"
[[ -f $CONFIGDRIVE ]] || usage "$CONFIGDRIVE (CONFIGDRIVE) is not a regular file"
[[ -b $DEVICE ]] || usage "$DEVICE (DEVICE) is not a block device"
+# We need to run partprobe to ensure all partitions are visible so the
+# following blkid command returns partitions just imaged to the device
+/sbin/partprobe $DEVICE || fail "running partprobe against $DEVICE"
+
# Check for preexisting partition for configdrive
EXISTING_PARTITION=`/sbin/blkid -l -o device $DEVICE -t LABEL=config-2`
if [[ $? == 0 ]]; then