@@ -110,10 +110,10 @@ def run(self, options: SSHCommandRunOptions, args) -> SSHCommandRunResult:
110110 port = parsed .port
111111 if not host or not port :
112112 raise ValueError (f"Invalid address format: { address } " )
113- self .logger .debug (f "Using direct TCP connection for SSH - host: { host } , port: { port } " )
113+ self .logger .debug ("Using direct TCP connection for SSH - host: %s , port: %s" , host , port )
114114 return self ._run_ssh_local (host , port , ssh_command , options , default_username , ssh_identity , args )
115115 except (DriverMethodNotImplemented , ValueError ) as e :
116- self .logger .error (f "Direct address connection failed ({ e } ), falling back to SSH port forwarding" )
116+ self .logger .error ("Direct address connection failed (%s ), falling back to SSH port forwarding" , e )
117117 return self .run (SSHCommandRunOptions (
118118 direct = False ,
119119 capture_output = options .capture_output ,
@@ -126,7 +126,7 @@ def run(self, options: SSHCommandRunOptions, args) -> SSHCommandRunResult:
126126 client = self .tcp ,
127127 ) as addr :
128128 host , port = addr
129- self .logger .debug (f "SSH port forward established - host: { host } , port: { port } " )
129+ self .logger .debug ("SSH port forward established - host: %s , port: %s" , host , port )
130130 return self ._run_ssh_local (host , port , ssh_command , options , default_username , ssh_identity , args )
131131
132132 def _run_ssh_local (self , host , port , ssh_command , options , default_username , ssh_identity , args ):
@@ -142,9 +142,9 @@ def _run_ssh_local(self, host, port, ssh_command, options, default_username, ssh
142142 # Set proper permissions (600) for SSH key
143143 os .chmod (temp_file .name , 0o600 )
144144 identity_file = temp_file .name
145- self .logger .debug (f "Created temporary identity file: { identity_file } " )
145+ self .logger .debug ("Created temporary identity file: %s" , identity_file )
146146 except Exception as e :
147- self .logger .error (f "Failed to create temporary identity file: { e } " )
147+ self .logger .error ("Failed to create temporary identity file: %s" , e )
148148 if temp_file :
149149 try :
150150 os .unlink (temp_file .name )
@@ -169,9 +169,9 @@ def _run_ssh_local(self, host, port, ssh_command, options, default_username, ssh
169169 if identity_file :
170170 try :
171171 os .unlink (identity_file )
172- self .logger .debug (f "Cleaned up temporary identity file: { identity_file } " )
172+ self .logger .debug ("Cleaned up temporary identity file: %s" , identity_file )
173173 except Exception as e :
174- self .logger .warning (f "Failed to clean up temporary identity file { identity_file } : { e } " )
174+ self .logger .warning ("Failed to clean up temporary identity file %s: %s" , identity_file , str ( e ) )
175175
176176 def _build_ssh_command_args (self , ssh_command , port , default_username , identity_file , args ):
177177 """Build initial SSH command arguments"""
@@ -243,8 +243,8 @@ def _separate_ssh_options_and_command_args(self, args):
243243 i += 1
244244
245245 # Debug output
246- self .logger .debug (f "SSH options: { ssh_options } " )
247- self .logger .debug (f "Command args: { command_args } " )
246+ self .logger .debug ("SSH options: %s" , ssh_options )
247+ self .logger .debug ("Command args: %s" , command_args )
248248 return ssh_options , command_args
249249
250250
@@ -260,7 +260,7 @@ def _build_final_ssh_command(self, ssh_args, ssh_options, host, command_args):
260260 # Add command arguments
261261 ssh_args .extend (command_args )
262262
263- self .logger .debug (f "Running SSH command: { ssh_args } " )
263+ self .logger .debug ("Running SSH command: %s" , ssh_args )
264264 return ssh_args
265265
266266 def _execute_ssh_command (self , ssh_args , options : SSHCommandRunOptions ) -> SSHCommandRunResult :
@@ -270,7 +270,8 @@ def _execute_ssh_command(self, ssh_args, options: SSHCommandRunOptions) -> SSHCo
270270 return SSHCommandRunResult .from_completed_process (result )
271271 except FileNotFoundError :
272272 self .logger .error (
273- f"SSH command '{ ssh_args [0 ]} ' not found. Please ensure SSH is installed and available in PATH."
273+ "SSH command '%s' not found. Please ensure SSH is installed and available in PATH." ,
274+ ssh_args [0 ],
274275 )
275276 return SSHCommandRunResult (
276277 return_code = 127 , # Standard exit code for "command not found"
0 commit comments