Add a "vms" command to gce/vm.sh that prints the current list of VMs.
This makes it easy to use with GNU parallel, e.g.:
gce/vm.sh vms | parallel gce/vm.sh reimage
diff --git a/gce/vm.sh b/gce/vm.sh
index bf96734..2d94f05 100644
--- a/gce/vm.sh
+++ b/gce/vm.sh
@@ -335,6 +335,10 @@
fi
}
+function print_vm_name() {
+ echo $1
+}
+
command="${1-}"
shift || true
@@ -361,6 +365,9 @@
"ssh_command")
do_ssh_command "$@"
;;
+ "vms")
+ action print_vm_name "$@"
+ ;;
"ssh")
tag=$1
location="$(test_slave "${tag}")"