Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/650#discussion_r30686856
--- Diff:
locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
---
@@ -795,24 +845,48 @@ protected JcloudsSshMachineLocation
obtainOnce(ConfigBag setup) throws NoMachine
// Apply any optional app-specific customization.
for (JcloudsLocationCustomizer customizer :
getCustomizers(setup)) {
- customizer.customize(this, computeService,
sshMachineLocation);
+ if (windows) {
+ LOG.warn("Ignoring customizer {} on Windows location
{}", customizer, winRmMachineLocation);
+ // TODO: WinRm based JcloudsLocationCustomizer
+ } else {
+ customizer.customize(this, computeService,
jcloudsSshMachineLocation);
+ }
}
customizedTimestamp = Duration.of(provisioningStopwatch);
- LOG.info("Finished VM "+setup.getDescription()+" creation:"
- + "
"+sshMachineLocation.getUser()+"@"+sshMachineLocation.getAddress()+":"+sshMachineLocation.getPort()
- + (Boolean.TRUE.equals(setup.get(LOG_CREDENTIALS))
- ? "password=" +
userCredentials.getOptionalPassword().or("<absent>")
- + " && key=" +
userCredentials.getOptionalPrivateKey().or("<absent>")
- : "")
- + " ready after
"+Duration.of(provisioningStopwatch).toStringRounded()
- + " ("+template+" template built in
"+Duration.of(templateTimestamp).toStringRounded()+";"
- + " "+node+" provisioned in
"+Duration.of(provisionTimestamp).subtract(templateTimestamp).toStringRounded()+";"
- + " "+sshMachineLocation+" ssh usable in
"+Duration.of(usableTimestamp).subtract(provisionTimestamp).toStringRounded()+";"
- + " and os customized in
"+Duration.of(customizedTimestamp).subtract(usableTimestamp).toStringRounded()+"
- "+Joiner.on(", ").join(customisationForLogging)+")");
-
- return sshMachineLocation;
+ String logMessage;
+
+ if (windows) {
+ // TODO: More complete logging for WinRmMachineLocation
+ // FIXME: Remove try-catch!
+ try {
+ logMessage = "Finished VM " + setup.getDescription() +
" creation:"
--- End diff --
Would be good to remove duplication - perhaps having a
`String.format("...", ...)` with particular bits of string built differently
for windows and linux.
---
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.
---