@@ -67,11 +67,13 @@ String removeCommandSensitiveInfoForLogging(String command) {
6767 public ProcessRunner (ExecutorService executor ) {
6868 this .executor = executor ;
6969 commandLogReplacements .add (new Ternary <>("ipmitool" , "-P\\ s+\\ S+" , "-P *****" ));
70+ commandLogReplacements .add (new Ternary <>("ipmitool" , "(?i)password\\ s+\\ S+\\ s+\\ S+" , "password **** ****" ));
7071 }
7172
7273 /**
7374 * Executes a process with provided list of commands with a max default timeout
7475 * of 5 minutes
76+ *
7577 * @param commands list of string commands
7678 * @return returns process result
7779 */
@@ -82,6 +84,7 @@ public ProcessResult executeCommands(final List<String> commands) {
8284 /**
8385 * Executes a process with provided list of commands with a given timeout that is less
8486 * than or equal to DEFAULT_MAX_TIMEOUT
87+ *
8588 * @param commands list of string commands
8689 * @param timeOut timeout duration
8790 * @return returns process result
@@ -109,14 +112,16 @@ public Integer call() throws Exception {
109112 }
110113 });
111114 try {
112- logger .debug ("Waiting for a response from command [{}]. Defined timeout: [{}]." , commandLog , timeOut .getStandardSeconds ());
115+ logger .debug ("Waiting for a response from command [{}]. Defined timeout: [{}]." , commandLog ,
116+ timeOut .getStandardSeconds ());
113117 retVal = processFuture .get (timeOut .getStandardSeconds (), TimeUnit .SECONDS );
114118 } catch (ExecutionException e ) {
115- logger .warn ("Failed to complete the requested command [{}] due to execution error." , commands , e );
119+ logger .warn ("Failed to complete the requested command [{}] due to execution error." , commandLog , e );
116120 retVal = -2 ;
117121 stdError = e .getMessage ();
118122 } catch (TimeoutException e ) {
119- logger .warn ("Failed to complete the requested command [{}] within timeout. Defined timeout: [{}]." , commandLog , timeOut .getStandardSeconds (), e );
123+ logger .warn ("Failed to complete the requested command [{}] within timeout. Defined timeout: [{}]." ,
124+ commandLog , timeOut .getStandardSeconds (), e );
120125 retVal = -1 ;
121126 stdError = "Operation timed out, aborted." ;
122127 } finally {
0 commit comments