@@ -101,10 +101,10 @@ def run(self, options: SSHCommandRunOptions, args) -> SSHCommandRunResult:
101101 port = parsed .port
102102 if not host or not port :
103103 raise ValueError (f"Invalid address format: { address } " )
104- self .logger .debug (f "Using direct TCP connection for SSH - host: { host } , port: { port } " )
104+ self .logger .debug ("Using direct TCP connection for SSH - host: %s , port: %s" , host , port )
105105 return self ._run_ssh_local (host , port , ssh_command , options , default_username , ssh_identity , args )
106106 except (DriverMethodNotImplemented , ValueError ) as e :
107- self .logger .error (f "Direct address connection failed ({ e } ), falling back to SSH port forwarding" )
107+ self .logger .error ("Direct address connection failed (%s ), falling back to SSH port forwarding" , e )
108108 return self .run (SSHCommandRunOptions (
109109 direct = False ,
110110 capture_output = options .capture_output ,
@@ -117,7 +117,7 @@ def run(self, options: SSHCommandRunOptions, args) -> SSHCommandRunResult:
117117 client = self .tcp ,
118118 ) as addr :
119119 host , port = addr
120- self .logger .debug (f "SSH port forward established - host: { host } , port: { port } " )
120+ self .logger .debug ("SSH port forward established - host: %s , port: %s" , host , port )
121121 return self ._run_ssh_local (host , port , ssh_command , options , default_username , ssh_identity , args )
122122
123123 def _run_ssh_local (self , host , port , ssh_command , options , default_username , ssh_identity , args ):
@@ -133,9 +133,9 @@ def _run_ssh_local(self, host, port, ssh_command, options, default_username, ssh
133133 # Set proper permissions (600) for SSH key
134134 os .chmod (temp_file .name , 0o600 )
135135 identity_file = temp_file .name
136- self .logger .debug (f "Created temporary identity file: { identity_file } " )
136+ self .logger .debug ("Created temporary identity file: %s" , identity_file )
137137 except Exception as e :
138- self .logger .error (f "Failed to create temporary identity file: { e } " )
138+ self .logger .error ("Failed to create temporary identity file: %s" , e )
139139 if temp_file :
140140 try :
141141 os .unlink (temp_file .name )
@@ -160,9 +160,9 @@ def _run_ssh_local(self, host, port, ssh_command, options, default_username, ssh
160160 if identity_file :
161161 try :
162162 os .unlink (identity_file )
163- self .logger .debug (f "Cleaned up temporary identity file: { identity_file } " )
163+ self .logger .debug ("Cleaned up temporary identity file: %s" , identity_file )
164164 except Exception as e :
165- self .logger .warning (f "Failed to clean up temporary identity file { identity_file } : { e } " )
165+ self .logger .warning ("Failed to clean up temporary identity file %s: %s" , identity_file , str ( e ) )
166166
167167 def _build_ssh_command_args (self , ssh_command , port , default_username , identity_file , args ):
168168 """Build initial SSH command arguments"""
@@ -234,8 +234,8 @@ def _separate_ssh_options_and_command_args(self, args):
234234 i += 1
235235
236236 # Debug output
237- self .logger .debug (f "SSH options: { ssh_options } " )
238- self .logger .debug (f "Command args: { command_args } " )
237+ self .logger .debug ("SSH options: %s" , ssh_options )
238+ self .logger .debug ("Command args: %s" , command_args )
239239 return ssh_options , command_args
240240
241241
@@ -251,7 +251,7 @@ def _build_final_ssh_command(self, ssh_args, ssh_options, host, command_args):
251251 # Add command arguments
252252 ssh_args .extend (command_args )
253253
254- self .logger .debug (f "Running SSH command: { ssh_args } " )
254+ self .logger .debug ("Running SSH command: %s" , ssh_args )
255255 return ssh_args
256256
257257 def _execute_ssh_command (self , ssh_args , options : SSHCommandRunOptions ) -> SSHCommandRunResult :
@@ -261,7 +261,8 @@ def _execute_ssh_command(self, ssh_args, options: SSHCommandRunOptions) -> SSHCo
261261 return SSHCommandRunResult .from_completed_process (result )
262262 except FileNotFoundError :
263263 self .logger .error (
264- f"SSH command '{ ssh_args [0 ]} ' not found. Please ensure SSH is installed and available in PATH."
264+ "SSH command '%s' not found. Please ensure SSH is installed and available in PATH." ,
265+ ssh_args [0 ],
265266 )
266267 return SSHCommandRunResult (
267268 return_code = 127 , # Standard exit code for "command not found"
0 commit comments