Don't fail early if no config drive found
The use of pipefail means that we fail early if we don't find a matching config drive. This is because grep returns exit code 1 if no match is found. We can either drop the pipefail setting, or force grep to return 0. This allows us to exit gracefully later in the script with code 0. Closes-Bug: #2120574 Change-Id: I84e348b44b041672ded800a967dae18437f16bba Signed-off-by: Doug Szumski <doug@stackhpc.com>
This commit is contained in:
@@ -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=""
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
fixes:
|
||||
- |
|
||||
Fixes a minor issue where the resolve config drive script fails early if
|
||||
no config drive is found.
|
||||
Reference in New Issue
Block a user