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
@@ -335,6 +335,10 @@ function do_ssh_command() {
fi
}
+function print_vm_name() {
+ echo $1
+}
+
command="${1-}"
shift || true
@@ -361,6 +365,9 @@ case "${command}" in
"ssh_command")
do_ssh_command "$@"
;;
+ "vms")
+ action print_vm_name "$@"
+ ;;
"ssh")
tag=$1
location="$(test_slave "${tag}")"
