4848
4949import com .cloud .utils .Pair ;
5050import com .cloud .utils .PropertiesUtil ;
51+ import com .cloud .utils .StringUtils ;
5152import com .cloud .utils .concurrency .NamedThreadFactory ;
5253import com .cloud .utils .script .OutputInterpreter .TimedOutLogger ;
5354
@@ -155,7 +156,7 @@ protected String buildCommandLine(String[] command) {
155156 boolean obscureParam = false ;
156157 for (int i = 0 ; i < command .length ; i ++) {
157158 String cmd = command [i ];
158- if (cmd .startsWith ("vi://" )) {
159+ if (StringUtils . isNotEmpty ( cmd ) && cmd .startsWith ("vi://" )) {
159160 String [] tokens = cmd .split ("@" );
160161 if (tokens .length >= 2 ) {
161162 builder .append ("vi://" ).append ("******@" ).append (tokens [1 ]).append (" " );
@@ -164,25 +165,6 @@ protected String buildCommandLine(String[] command) {
164165 }
165166 continue ;
166167 }
167- if (obscureParam ) {
168- builder .append ("******" ).append (" " );
169- obscureParam = false ;
170- } else {
171- builder .append (command [i ]).append (" " );
172- }
173-
174- if ("-y" .equals (cmd ) || "-z" .equals (cmd )) {
175- obscureParam = true ;
176- _passwordCommand = true ;
177- }
178- }
179- return builder .toString ();
180- }
181-
182- protected String buildCommandLine (List <String > command ) {
183- StringBuilder builder = new StringBuilder ();
184- boolean obscureParam = false ;
185- for (String cmd : command ) {
186168 if (obscureParam ) {
187169 builder .append ("******" ).append (" " );
188170 obscureParam = false ;
0 commit comments