You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Passing None as Port in the constructor of gvm.connections.SSHConnection should not throw an TypeError. Because the type is Optional. So you should not worry about it if None is passed. https://docs.python.org/3/library/typing.html#typing.Optional. Also if you pass None as Port to gvm.connections.TLSConnection or gvm.connections.UnixSocketConnection then no errror is thrown.
Current behavior
If you pass None to gvm.connections.SSHConnection, TypeError is thrown. Because of converting it to int.
I've found this during writing tests for the parser in gvm-tools repository. This code will throw this error: SSHConnection(port=None)
GVM versions
gsa: (gsad --version)
Not installed
gvm: (gvmd --version)
20.9.1
gvm-tools: (gvm-cli --version)
gvm-cli 20.10.2.dev1 (API version 20.9.1)
Environment
Operating system:
Linux Mint 20
Installation method / source: (packages, source installation)
Packages. I have cloned the gvm-tools repository and installed the dependencies.
Logfiles
Not the Logfile but the Traceback, after I have run my test:
Traceback (most recent call last):
File "/usr/lib/python3.8/unittest/mock.py", line 1325, in patched
return func(*newargs, **newkeywargs)
File "/home/fox/Git/gvm-tools/tests/test_parser.py", line 478, in test_create_ssh_connection
self.perform_create_connection_test('ssh', SSHConnection)
File "/home/fox/Git/gvm-tools/tests/test_parser.py", line 481, in perform_create_connection_test
connection = create_connection(connection_type)
File "/home/fox/Git/gvm-tools/gvmtools/parser.py", line 336, in create_connection
return SSHConnection(
File "/home/fox/Git/gvm-tools/.venv/lib/python3.8/site-packages/gvm/connections.py", line 195, in __init__
self.port = int(port)
TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
The text was updated successfully, but these errors were encountered:
Expected behavior
Passing
None
as Port in the constructor of gvm.connections.SSHConnection should not throw anTypeError
. Because the type isOptional
. So you should not worry about it if None is passed. https://docs.python.org/3/library/typing.html#typing.Optional. Also if you pass None as Port togvm.connections.TLSConnection
orgvm.connections.UnixSocketConnection
then no errror is thrown.Current behavior
If you pass
None
togvm.connections.SSHConnection
,TypeError
is thrown. Because of converting it to int.Steps to reproduce
I've found this during writing tests for the parser in gvm-tools repository. This code will throw this error:
SSHConnection(port=None)
GVM versions
gsa: (gsad --version)
Not installed
gvm: (gvmd --version)
20.9.1
gvm-tools: (gvm-cli --version)
gvm-cli 20.10.2.dev1 (API version 20.9.1)
Environment
Operating system:
Linux Mint 20
Installation method / source: (packages, source installation)
Packages. I have cloned the
gvm-tools
repository and installed the dependencies.Logfiles
Not the Logfile but the Traceback, after I have run my test:
The text was updated successfully, but these errors were encountered: