@@ -100,10 +100,10 @@ def run(self, options: SSHCommandRunOptions, args) -> SSHCommandRunResult:
100100 port = parsed .port
101101 if not host or not port :
102102 raise ValueError (f"Invalid address format: { address } " )
103- self .logger .debug (f "Using direct TCP connection for SSH - host: { host } , port: { port } " )
103+ self .logger .debug ("Using direct TCP connection for SSH - host: %s , port: %s" , host , port )
104104 return self ._run_ssh_local (host , port , ssh_command , options , default_username , ssh_identity , args )
105105 except (DriverMethodNotImplemented , ValueError ) as e :
106- self .logger .error (f "Direct address connection failed ({ e } ), falling back to SSH port forwarding" )
106+ self .logger .error ("Direct address connection failed (%s ), falling back to SSH port forwarding" , e )
107107 return self .run (SSHCommandRunOptions (
108108 direct = False ,
109109 capture_output = options .capture_output ,
@@ -116,7 +116,7 @@ def run(self, options: SSHCommandRunOptions, args) -> SSHCommandRunResult:
116116 client = self .tcp ,
117117 ) as addr :
118118 host , port = addr
119- self .logger .debug (f "SSH port forward established - host: { host } , port: { port } " )
119+ self .logger .debug ("SSH port forward established - host: %s , port: %s" , host , port )
120120 return self ._run_ssh_local (host , port , ssh_command , options , default_username , ssh_identity , args )
121121
122122 def _run_ssh_local (self , host , port , ssh_command , options , default_username , ssh_identity , args ):
@@ -132,9 +132,9 @@ def _run_ssh_local(self, host, port, ssh_command, options, default_username, ssh
132132 # Set proper permissions (600) for SSH key
133133 os .chmod (temp_file .name , 0o600 )
134134 identity_file = temp_file .name
135- self .logger .debug (f "Created temporary identity file: { identity_file } " )
135+ self .logger .debug ("Created temporary identity file: %s" , identity_file )
136136 except Exception as e :
137- self .logger .error (f "Failed to create temporary identity file: { e } " )
137+ self .logger .error ("Failed to create temporary identity file: %s" , e )
138138 if temp_file :
139139 try :
140140 os .unlink (temp_file .name )
@@ -159,9 +159,9 @@ def _run_ssh_local(self, host, port, ssh_command, options, default_username, ssh
159159 if identity_file :
160160 try :
161161 os .unlink (identity_file )
162- self .logger .debug (f "Cleaned up temporary identity file: { identity_file } " )
162+ self .logger .debug ("Cleaned up temporary identity file: %s" , identity_file )
163163 except Exception as e :
164- self .logger .warning (f "Failed to clean up temporary identity file { identity_file } : { e } " )
164+ self .logger .warning ("Failed to clean up temporary identity file %s: %s" , identity_file , str ( e ) )
165165
166166 def _build_ssh_command_args (self , ssh_command , port , default_username , identity_file , args ):
167167 """Build initial SSH command arguments"""
@@ -233,8 +233,8 @@ def _separate_ssh_options_and_command_args(self, args):
233233 i += 1
234234
235235 # Debug output
236- self .logger .debug (f "SSH options: { ssh_options } " )
237- self .logger .debug (f "Command args: { command_args } " )
236+ self .logger .debug ("SSH options: %s" , ssh_options )
237+ self .logger .debug ("Command args: %s" , command_args )
238238 return ssh_options , command_args
239239
240240
@@ -250,7 +250,7 @@ def _build_final_ssh_command(self, ssh_args, ssh_options, host, command_args):
250250 # Add command arguments
251251 ssh_args .extend (command_args )
252252
253- self .logger .debug (f "Running SSH command: { ssh_args } " )
253+ self .logger .debug ("Running SSH command: %s" , ssh_args )
254254 return ssh_args
255255
256256 def _execute_ssh_command (self , ssh_args , options : SSHCommandRunOptions ) -> SSHCommandRunResult :
@@ -260,7 +260,8 @@ def _execute_ssh_command(self, ssh_args, options: SSHCommandRunOptions) -> SSHCo
260260 return SSHCommandRunResult .from_completed_process (result )
261261 except FileNotFoundError :
262262 self .logger .error (
263- f"SSH command '{ ssh_args [0 ]} ' not found. Please ensure SSH is installed and available in PATH."
263+ "SSH command '%s' not found. Please ensure SSH is installed and available in PATH." ,
264+ ssh_args [0 ],
264265 )
265266 return SSHCommandRunResult (
266267 return_code = 127 , # Standard exit code for "command not found"
0 commit comments