@@ -93,10 +93,10 @@ def run(self, options: SSHCommandRunOptions, args) -> SSHCommandRunResult:
9393 port = parsed .port
9494 if not host or not port :
9595 raise ValueError (f"Invalid address format: { address } " )
96- self .logger .debug (f "Using direct TCP connection for SSH - host: { host } , port: { port } " )
96+ self .logger .debug ("Using direct TCP connection for SSH - host: %s , port: %s" , host , port )
9797 return self ._run_ssh_local (host , port , ssh_command , options , default_username , ssh_identity , args )
9898 except (DriverMethodNotImplemented , ValueError ) as e :
99- self .logger .error (f "Direct address connection failed ({ e } ), falling back to SSH port forwarding" )
99+ self .logger .error ("Direct address connection failed (%s ), falling back to SSH port forwarding" , e )
100100 return self .run (SSHCommandRunOptions (
101101 direct = False ,
102102 capture_output = options .capture_output ,
@@ -109,7 +109,7 @@ def run(self, options: SSHCommandRunOptions, args) -> SSHCommandRunResult:
109109 client = self .tcp ,
110110 ) as addr :
111111 host , port = addr
112- self .logger .debug (f "SSH port forward established - host: { host } , port: { port } " )
112+ self .logger .debug ("SSH port forward established - host: %s , port: %s" , host , port )
113113 return self ._run_ssh_local (host , port , ssh_command , options , default_username , ssh_identity , args )
114114
115115 def _run_ssh_local (self , host , port , ssh_command , options , default_username , ssh_identity , args ):
@@ -125,9 +125,9 @@ def _run_ssh_local(self, host, port, ssh_command, options, default_username, ssh
125125 # Set proper permissions (600) for SSH key
126126 os .chmod (temp_file .name , 0o600 )
127127 identity_file = temp_file .name
128- self .logger .debug (f "Created temporary identity file: { identity_file } " )
128+ self .logger .debug ("Created temporary identity file: %s" , identity_file )
129129 except Exception as e :
130- self .logger .error (f "Failed to create temporary identity file: { e } " )
130+ self .logger .error ("Failed to create temporary identity file: %s" , e )
131131 if temp_file :
132132 try :
133133 os .unlink (temp_file .name )
@@ -152,9 +152,9 @@ def _run_ssh_local(self, host, port, ssh_command, options, default_username, ssh
152152 if identity_file :
153153 try :
154154 os .unlink (identity_file )
155- self .logger .debug (f "Cleaned up temporary identity file: { identity_file } " )
155+ self .logger .debug ("Cleaned up temporary identity file: %s" , identity_file )
156156 except Exception as e :
157- self .logger .warning (f "Failed to clean up temporary identity file { identity_file } : { e } " )
157+ self .logger .warning ("Failed to clean up temporary identity file %s: %s" , identity_file , str ( e ) )
158158
159159 def _build_ssh_command_args (self , ssh_command , port , default_username , identity_file , args ):
160160 """Build initial SSH command arguments"""
@@ -226,8 +226,8 @@ def _separate_ssh_options_and_command_args(self, args):
226226 i += 1
227227
228228 # Debug output
229- self .logger .debug (f "SSH options: { ssh_options } " )
230- self .logger .debug (f "Command args: { command_args } " )
229+ self .logger .debug ("SSH options: %s" , ssh_options )
230+ self .logger .debug ("Command args: %s" , command_args )
231231 return ssh_options , command_args
232232
233233
@@ -243,7 +243,7 @@ def _build_final_ssh_command(self, ssh_args, ssh_options, host, command_args):
243243 # Add command arguments
244244 ssh_args .extend (command_args )
245245
246- self .logger .debug (f "Running SSH command: { ssh_args } " )
246+ self .logger .debug ("Running SSH command: %s" , ssh_args )
247247 return ssh_args
248248
249249 def _execute_ssh_command (self , ssh_args , options : SSHCommandRunOptions ) -> SSHCommandRunResult :
@@ -253,7 +253,8 @@ def _execute_ssh_command(self, ssh_args, options: SSHCommandRunOptions) -> SSHCo
253253 return SSHCommandRunResult .from_completed_process (result )
254254 except FileNotFoundError :
255255 self .logger .error (
256- f"SSH command '{ ssh_args [0 ]} ' not found. Please ensure SSH is installed and available in PATH."
256+ "SSH command '%s' not found. Please ensure SSH is installed and available in PATH." ,
257+ ssh_args [0 ],
257258 )
258259 return SSHCommandRunResult (
259260 return_code = 127 , # Standard exit code for "command not found"
0 commit comments