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 09:26:32 GMT
Github user aledsage commented on a diff in the pull request:

    https://github.com/apache/incubator-brooklyn/pull/650#discussion_r30684054
  
    --- Diff: locations/jclouds/src/main/java/brooklyn/location/jclouds/JcloudsLocation.java
---
    @@ -712,80 +737,105 @@ protected JcloudsSshMachineLocation obtainOnce(ConfigBag setup)
throws NoMachine
                     List<String> setupScripts = setup.get(JcloudsLocationConfig.CUSTOM_MACHINE_SETUP_SCRIPT_URL_LIST);
                     Collection<String> allScripts = new MutableList<String>().appendIfNotNull(setupScript).appendAll(setupScripts);
                     for (String setupScriptItem : allScripts) {
    -                    if (Strings.isNonBlank(setupScriptItem)) {
    -                        customisationForLogging.add("custom setup script "+setupScriptItem);
    +                    if (Strings.isNonBlank(setupScript)) {
    +                        customisationForLogging.add("custom setup script " + setupScript);
     
                             String setupVarsString = setup.get(JcloudsLocationConfig.CUSTOM_MACHINE_SETUP_SCRIPT_VARS);
                             Map<String, String> substitutions = (setupVarsString !=
null)
                                     ? Splitter.on(",").withKeyValueSeparator(":").split(setupVarsString)
                                     : ImmutableMap.<String, String>of();
    -                        String scriptContent =  ResourceUtils.create(this).getResourceAsString(setupScriptItem);
    +                        String scriptContent = ResourceUtils.create(this).getResourceAsString(setupScriptItem);
                             String script = TemplateProcessor.processTemplateContents(scriptContent,
getManagementContext(), substitutions);
    -                        sshMachineLocation.execCommands("Customizing node " + this +
" with script " + setupScriptItem, ImmutableList.of(script));
    +                        if (windows) {
    +                            winRmMachineLocation.executeScript(ImmutableList.copyOf((script.replace("\r",
"").split("\n"))));
    +                        } else {
    +                            jcloudsSshMachineLocation.execCommands("Customizing node
" + this, ImmutableList.of(script));
    +                        }
                         }
                     }
     
                     if (setup.get(JcloudsLocationConfig.MAP_DEV_RANDOM_TO_DEV_URANDOM)) {
    -                    customisationForLogging.add("point /dev/random to urandom");
    +                    if (windows) {
    +                        LOG.warn("Ignoring flag MAP_DEV_RANDOM_TO_DEV_URANDOM on Windows
location {}", winRmMachineLocation);
    +                    } else {
    +                        customisationForLogging.add("point /dev/random to urandom");
     
    -                    sshMachineLocation.execCommands("using urandom instead of random",
    -                            Arrays.asList("sudo mv /dev/random /dev/random-real", "sudo
ln -s /dev/urandom /dev/random"));
    +                        jcloudsSshMachineLocation.execCommands("using urandom instead
of random",
    +                                Arrays.asList("sudo mv /dev/random /dev/random-real",
"sudo ln -s /dev/urandom /dev/random"));
    +                    }
                     }
     
     
                     if (setup.get(GENERATE_HOSTNAME)) {
    -                    customisationForLogging.add("configure hostname");
    +                    if (windows) {
    +                        // TODO: Generate Windows Hostname
    +                        LOG.warn("Ignoring flag GENERATE_HOSTNAME on Windows location
{}", winRmMachineLocation);
    --- End diff --
    
    We should list (in docs / limitations) the main config options that are not supported
(yet) on windows (rather than the user/customer discovering it by trying to configure it and
eventually finding this log message, or just it being ignored silently (as would be the case
for user/password configuration).


---
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