mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-25 09:35:54 +02:00
lib.ec.SSHClient: Exception for empty host name
Instantiating a SSHClient-derived class with an invalid or missing uri parameter is accepted and fails later down the road. Raise an Exception early on to make the error log more comprehensible. Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
0e18d4abac
commit
61c1a628a1
1 changed files with 3 additions and 0 deletions
|
|
@ -26,7 +26,10 @@ class SSHClient(ExecContext):
|
|||
except Exception as e:
|
||||
log(ERR, f'Failed to parse SSH URI "{uri}"')
|
||||
raise
|
||||
|
||||
self.__hostname = parsed.hostname
|
||||
if self.__hostname is None:
|
||||
raise Exception(f'Can\'t parse host name from SSH URI "{uri}"')
|
||||
self.__port = parsed.port
|
||||
self.__password = parsed.password
|
||||
self.__username = parsed.username
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue