X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fopenstack-cleanup-orphaned-ports.sh;h=b5c0af526f958a14cb03684d96a3c3f85108b2c2;hb=98090d2e52c78ada3ae2bc3fe4cb918df309a207;hp=8549737b802d0a61a3fc7de72c2f20f2c7ff4be0;hpb=d5d5be584244ff5db85250ec3ad7618cc91753b5;p=releng%2Fglobal-jjb.git diff --git a/shell/openstack-cleanup-orphaned-ports.sh b/shell/openstack-cleanup-orphaned-ports.sh index 8549737b..b5c0af52 100755 --- a/shell/openstack-cleanup-orphaned-ports.sh +++ b/shell/openstack-cleanup-orphaned-ports.sh @@ -55,7 +55,8 @@ _cleanup() } # Output the initial list of port UUIDs to a temporary file -openstack --os-cloud "$os_cloud" port list -f value -c ID -c status | grep -e DOWN | awk '{print $1}'> "$tmpfile" +openstack --os-cloud "$os_cloud" port list -f value -c ID -c status \ + | { grep -e DOWN || true; } | { awk '{print $1}' || true; } > "$tmpfile" # Count the number to process total=$(wc -l "$tmpfile" | awk '{print $1}')