From 650d99fbd9d75dbff741dfd3ceecd3a7a91a2a28 Mon Sep 17 00:00:00 2001 From: Jeff Lowdermilk Date: Fri, 8 Apr 2016 12:19:24 -0700 Subject: [PATCH] Fix list-resources grep --- cluster/gce/list-resources.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cluster/gce/list-resources.sh b/cluster/gce/list-resources.sh index 963b9b26a25..4ee86158a1d 100755 --- a/cluster/gce/list-resources.sh +++ b/cluster/gce/list-resources.sh @@ -47,7 +47,10 @@ function gcloud-compute-list() { local attempt=1 local result="" while true; do - if result=$(gcloud compute ${resource} list --project=${PROJECT} ${@:2} | grep "${GREP_REGEX}"); then + if result=$(gcloud compute ${resource} list --project=${PROJECT} ${@:2}); then + if [[ ! -z "${GREP_REGEX}" ]]; then + result=$(echo "${result}" | grep "${GREP_REGEX}") + fi echo "${result}" return fi