From 79fde523cb9a00a7070da38f4a78016aec45ed56 Mon Sep 17 00:00:00 2001 From: shlomi-noach Date: Mon, 23 Nov 2015 14:55:23 +0100 Subject: [PATCH] Fixed multiple-instances case where the input is empty --- build.sh | 2 +- go/app/cli.go | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/build.sh b/build.sh index a9d11374..c4abc631 100755 --- a/build.sh +++ b/build.sh @@ -6,7 +6,7 @@ # set -e -RELEASE_VERSION="1.4.535" +RELEASE_VERSION="1.4.536" TOPDIR=/tmp/orchestrator-release export RELEASE_VERSION TOPDIR diff --git a/go/app/cli.go b/go/app/cli.go index 0037b79f..599dbd82 100644 --- a/go/app/cli.go +++ b/go/app/cli.go @@ -121,8 +121,9 @@ func deduceInstanceKeyIfNeeded(instance string, instanceKey *inst.InstanceKey) * // to take multiple instance names separated by a comma or whitespace. func CliWrapper(command string, strict bool, instances string, destination string, owner string, reason string, duration string, pattern string, clusterAlias string, pool string, hostnameFlag string) { r := regexp.MustCompile(`[ ,\r\n\t]+`) - for _, instance := range r.Split(instances, -1) { - if instance != "" { + tokens := r.Split(instances, -1) + for _, instance := range tokens { + if instance != "" || len(tokens) == 1 { Cli(command, strict, instance, destination, owner, reason, duration, pattern, clusterAlias, pool, hostnameFlag) } }