brooklyn-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aledsage <...@git.apache.org>
Subject [GitHub] incubator-brooklyn pull request: Support for deployment to Windows
Date Wed, 20 May 2015 10:07:46 GMT
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message