@@ -52,17 +52,15 @@ async def authenticate(self, password: str) -> None:
5252 port = self .port ,
5353 username = self .username ,
5454 password = password ,
55- timeout = 10
55+ timeout = 10 ,
5656 )
5757 )
5858 except paramiko .AuthenticationException as e :
5959 raise NanoKVMSSHAuthenticationError (
6060 f"SSH authentication failed: { e } "
6161 ) from e
6262 except (paramiko .SSHException , paramiko .BadHostKeyException , OSError ) as e :
63- raise NanoKVMSSHAuthenticationError (
64- f"SSH connection failed: { e } "
65- ) from e
63+ raise NanoKVMSSHAuthenticationError (f"SSH connection failed: { e } " ) from e
6664
6765 async def disconnect (self ) -> None :
6866 """Close SSH connection."""
@@ -82,7 +80,7 @@ async def run_command(self, command: str, timeout: int = 30) -> str:
8280 loop .run_in_executor (
8381 None , self ._exec_command_sync , command
8482 ),
85- timeout = timeout
83+ timeout = timeout ,
8684 )
8785 if error :
8886 raise NanoKVMSSHCommandError (f"SSH command error: { error } " )
@@ -96,6 +94,6 @@ def _exec_command_sync(self, command: str) -> tuple[str, str]:
9694 """Synchronous SSH command execution."""
9795 assert self .ssh_client is not None # Should be set after authenticate()
9896 stdin , stdout , stderr = self .ssh_client .exec_command (command )
99- output = stdout .read ().decode (' utf-8' )
100- error = stderr .read ().decode (' utf-8' )
97+ output = stdout .read ().decode (" utf-8" )
98+ error = stderr .read ().decode (" utf-8" )
10199 return output , error
0 commit comments