X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fopenstack-cleanup-orphaned-ports.sh;h=b5c0af526f958a14cb03684d96a3c3f85108b2c2;hb=ce1354cc83932ef7ff52b401137aada7a7a8de75;hp=8549737b802d0a61a3fc7de72c2f20f2c7ff4be0;hpb=ba295fde28c77759e082019d9e6d450ea0676db6;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}')