diff --git a/dib/ironic-python-agent-ramdisk/static/usr/local/bin/ironic-python-agent-resolve-configdrive.sh b/dib/ironic-python-agent-ramdisk/static/usr/local/bin/ironic-python-agent-resolve-configdrive.sh index 84a91e0..0f6cc4e 100755 --- a/dib/ironic-python-agent-ramdisk/static/usr/local/bin/ironic-python-agent-resolve-configdrive.sh +++ b/dib/ironic-python-agent-ramdisk/static/usr/local/bin/ironic-python-agent-resolve-configdrive.sh @@ -15,7 +15,7 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin CONFIG_DRIVE_LABEL="config-2" # Identify the number of devices -device_count=$(lsblk -o PATH,LABEL | grep $CONFIG_DRIVE_LABEL | wc -l) +device_count=$(lsblk -o PATH,LABEL | grep -c $CONFIG_DRIVE_LABEL || true) # Identify if we have an a publisher id set publisher_id="" diff --git a/releasenotes/notes/fix-early-fail-if-no-config-drive-2085609b044ac85f.yaml b/releasenotes/notes/fix-early-fail-if-no-config-drive-2085609b044ac85f.yaml new file mode 100644 index 0000000..148c2d8 --- /dev/null +++ b/releasenotes/notes/fix-early-fail-if-no-config-drive-2085609b044ac85f.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + Fixes a minor issue where the resolve config drive script fails early if + no config drive is found.