mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 17:23:36 +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:
|
except Exception as e:
|
||||||
log(ERR, f'Failed to parse SSH URI "{uri}"')
|
log(ERR, f'Failed to parse SSH URI "{uri}"')
|
||||||
raise
|
raise
|
||||||
|
|
||||||
self.__hostname = parsed.hostname
|
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.__port = parsed.port
|
||||||
self.__password = parsed.password
|
self.__password = parsed.password
|
||||||
self.__username = parsed.username
|
self.__username = parsed.username
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue