Github user aledsage commented on a diff in the pull request:
https://github.com/apache/brooklyn-server/pull/150#discussion_r66239387
--- 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 --
Should we really be extracting hostname from stdout if the command failed
to execute (i.e. if we did the above log statement)? Presumably we'll get
either an empty string or some error message. What are the implications of
subsequently passing that to `rebootAndWait(hostname)`?
---
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 [email protected] or file a JIRA ticket
with INFRA.
---