Github user bostko commented on a diff in the pull request: https://github.com/apache/brooklyn-server/pull/150#discussion_r66246994 --- Diff: software/base/src/main/java/org/apache/brooklyn/entity/software/base/VanillaWindowsProcessWinRmDriver.java --- @@ -49,15 +50,29 @@ public void start() { @Override public void install() { + // TODO: At some point in the future, this should probably be refactored to get the name of the machine in WinRmMachineLocation and set it as the hostname sensor + String hostname = null; + if (entity.getConfig(VanillaWindowsProcess.INSTALL_REBOOT_REQUIRED)) { + WinRmExecuteHelper checkHostnameTask = newScript("Checking hostname") + .setCommand("hostname") + .failOnNonZeroResultCode() + .gatherOutput(); + if (checkHostnameTask.execute() != 0) { + LOG.warn("Cannot determine hostname for entity {} machine {}", getEntity(), getLocation()); + } + hostname = Strings.trimEnd(checkHostnameTask.getResultStdout()); --- End diff -- @aledsage I find it as the most reasonable way to get the actual hostname. The `LOG.warn` statement which was there is not valid. `.failOnNonZeroResultCode()` predicate will be used from the WinRmExecuteHelper to throw an exception if it is not valid. I expect that this command should always succeed when winrm-ing to a working windows machine.
--- If your project is set up for it, you can reply to this email and have your reply appear on GitHub as well. If your project does not have this feature enabled and wishes so, or if the feature is enabled but not working, please contact infrastructure at infrastruct...@apache.org or file a JIRA ticket with INFRA. ---