Avoid except exit due to no TestVM image
The controller_post_deployment.sh is run with "-e" which means it will exit directly if any error occured. The command of "grep" will return non-zero if it find no line with the pattern. So this script will exit unexpectedly if there is no TestVM image exists. Change-Id: Ie5ca9e89e1687787a5173e2ea8cedffd8eb9bfdd
This commit is contained in:
parent
f2b2df6676
commit
fe83d703aa
|
@ -14,7 +14,7 @@ function replace_test_image {
|
|||
local image_file
|
||||
image_file="$3"
|
||||
|
||||
image_id=$(glance image-list | grep "$image_name" | awk -F "|" '{print $2}' | grep -v '^$')
|
||||
image_id=$(glance image-list | awk -F "|" '/'$image_name'/ {print $2}')
|
||||
|
||||
if [[ -n "$image_id" ]]; then
|
||||
echo "Delete image $image_name" >> $LOG_FILE
|
||||
|
|
Loading…
Reference in New Issue