Github user aledsage commented on a diff in the pull request:
https://github.com/apache/incubator-brooklyn/pull/650#discussion_r30683932
--- 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));
--- End diff --
This changes the execCommands description. I take it that's deliberate? Was
the full script being logged multiple times before?
---
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.
---