This is an automated email from the ASF dual-hosted git repository.

heneveld pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/brooklyn-server.git


The following commit(s) were added to refs/heads/master by this push:
     new 01d2c72394 Allow explicity WinRM exec configuration to override 
machine configuration, for port, address, etc
01d2c72394 is described below

commit 01d2c72394d7277973d16733715b7145acabc91b
Author: Alex Heneveld <[email protected]>
AuthorDate: Thu Feb 6 02:09:51 2025 +0000

    Allow explicity WinRM exec configuration to override machine configuration, 
for port, address, etc
---
 .../org/apache/brooklyn/location/winrm/WinRmMachineLocation.java | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git 
a/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
 
b/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
index 747abd8ed3..f5fa0a6eba 100644
--- 
a/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
+++ 
b/software/winrm/src/main/java/org/apache/brooklyn/location/winrm/WinRmMachineLocation.java
@@ -428,11 +428,12 @@ public class WinRmMachineLocation extends 
AbstractMachineLocation implements Mac
                     args.putStringKey(keyName, config().get(entry.getKey()));
                 }
             }
-            
+
             args.putAll(props);
-            args.configure(SshTool.PROP_HOST, getAddress().getHostAddress());
-            args.configure(WinRmTool.USE_NTLM, 
getConfig(WinRmMachineLocation.USE_NTLM));
-            args.configure(WinRmTool.PROP_PORT, getPort());
+            ConfigBag explicitProps = ConfigBag.newInstance(props);
+            if (!explicitProps.containsKey(SshTool.PROP_HOST)) 
args.configure(SshTool.PROP_HOST, getAddress().getHostAddress());
+            if (!explicitProps.containsKey(WinRmTool.USE_NTLM)) 
args.configure(WinRmTool.USE_NTLM, getConfig(WinRmMachineLocation.USE_NTLM));
+            if (!explicitProps.containsKey(WinRmTool.PROP_PORT)) 
args.configure(WinRmTool.PROP_PORT, getPort());
 
             if (LOG.isTraceEnabled()) LOG.trace("creating WinRM session for 
"+Sanitizer.sanitize(args));
 

Reply via email to