From cb679f9b01705abb808b55b76772ae8e3db3c341 Mon Sep 17 00:00:00 2001 From: Gal Szkolnik Date: Tue, 9 Aug 2022 12:08:50 -0400 Subject: [PATCH] =tweaks to gcp/tf output --- _home/dot_sz.shrc.d/32_gcp.shortcuts | 11 ++++++----- _home/dot_sz.shrc.d/33_terraform.shortcuts | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/_home/dot_sz.shrc.d/32_gcp.shortcuts b/_home/dot_sz.shrc.d/32_gcp.shortcuts index c7a288a..7ddb035 100644 --- a/_home/dot_sz.shrc.d/32_gcp.shortcuts +++ b/_home/dot_sz.shrc.d/32_gcp.shortcuts @@ -44,12 +44,13 @@ function gcp_get_stack() { "N='$N'; " \ "${_cmd}" \ "echo 'Listing $N stack:'; " \ - '{ gcloud compute networks list --filter="name:$N" | ' "sed --unbuffered s/^/Networks.:\ /g ; } " \ - '&& { gcloud compute networks subnets list --filter="name:$N" | ' "sed --unbuffered s/^/Subnets..:\ /g ; } " \ - '&& { gcloud compute disks list --filter="name:$N" | ' "sed --unbuffered s/^/Disks....:\ /g ; } " \ - '&& { gcloud compute instances list --filter="name:$N" | ' "sed --unbuffered s/^/Instances:\ /g ; } " \ + '{ gcloud compute networks list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Networks.:\ /g ; } " \ + '&& { gcloud compute networks subnets list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Subnets..:\ /g ; } " \ + '&& { gcloud compute disks list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Disks....:\ /g ; } " \ + '&& { gcloud compute instances list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Instances:\ /g ; } " \ + '&& { gcloud compute routers list --filter="name:$N" 2>&1 | ' "sed --unbuffered s/^/Routers..:\ /g ; } " \ '&& { gcloud compute network-firewall-policies get-effective-firewalls --network="$N-network"' \ - " | sed --unbuffered s/^/Firewall:\ /g ; } " \ + " 2>&1 | sed --unbuffered s/^/Firewall:\ /g ; } " \ ) ;}" [ $# -ge 2 ] && _cmd="watch -n${2} '${_cmd}'" diff --git a/_home/dot_sz.shrc.d/33_terraform.shortcuts b/_home/dot_sz.shrc.d/33_terraform.shortcuts index 3054556..9c52d99 100644 --- a/_home/dot_sz.shrc.d/33_terraform.shortcuts +++ b/_home/dot_sz.shrc.d/33_terraform.shortcuts @@ -95,7 +95,7 @@ if [[ -x $TERRAFORM_BIN ]]; then } function get-tf-env-plan() { - set | grep '^TF\(_\(VAR_[a-z]\)\|\([A-Z_]TARGET=\)\)' | grep '\b=' + set | grep '^TF\(_\(VAR_[a-z]\)\|\([A-Z_]*TARGET=\)\)' | grep '\b=' } function clear-tf-env-vars() {