winrm: improve err msgs when no cmd set
Project: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/commit/d499c81b Tree: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/tree/d499c81b Diff: http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/diff/d499c81b Branch: refs/heads/master Commit: d499c81b5453c7ef1ff4cb384eeaaaf448c61034 Parents: 868f765 Author: Aled Sage <[email protected]> Authored: Wed Sep 23 01:02:07 2015 +0100 Committer: Aled Sage <[email protected]> Committed: Wed Sep 23 01:32:49 2015 +0100 ---------------------------------------------------------------------- .../entity/software/base/AbstractSoftwareProcessWinRmDriver.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-brooklyn/blob/d499c81b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java ---------------------------------------------------------------------- diff --git a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java index f0d0725..8e3ea37 100644 --- a/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java +++ b/software/base/src/main/java/org/apache/brooklyn/entity/software/base/AbstractSoftwareProcessWinRmDriver.java @@ -207,10 +207,10 @@ public abstract class AbstractSoftwareProcessWinRmDriver extends AbstractSoftwar if (allowNoOp) { return new WinRmToolResponse("", "", 0).getStatusCode(); } else { - throw new IllegalStateException(String.format("Exactly one of %s or %s must be set", regularCommand, powerShellCommand)); + throw new IllegalStateException(String.format("Exactly one of cmd or psCmd must be set for %s of %s", phase, entity)); } } else if (!Strings.isBlank(regularCommand) && !Strings.isBlank(powerShellCommand)) { - throw new IllegalStateException(String.format("%s and %s cannot both be set", regularCommand, powerShellCommand)); + throw new IllegalStateException(String.format("%s and %s cannot both be set for %s of %s", regularCommand, powerShellCommand, phase, entity)); } ByteArrayOutputStream stdIn = new ByteArrayOutputStream();
