summaryrefslogtreecommitdiffstats
path: root/asynceapi/aio_portcheck.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-15 20:30:44 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-10-15 20:30:44 +0000
commit4a398db99d88dd17dabc408fb2b58c610792bc1e (patch)
treee5404d6d19a4d67a9428b3d10f886717b9756352 /asynceapi/aio_portcheck.py
parentAdding upstream version 1.0.0. (diff)
downloadanta-4a398db99d88dd17dabc408fb2b58c610792bc1e.tar.xz
anta-4a398db99d88dd17dabc408fb2b58c610792bc1e.zip
Adding upstream version 1.1.0.upstream/1.1.0upstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'asynceapi/aio_portcheck.py')
-rw-r--r--asynceapi/aio_portcheck.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/asynceapi/aio_portcheck.py b/asynceapi/aio_portcheck.py
index 79f4562..0cab94c 100644
--- a/asynceapi/aio_portcheck.py
+++ b/asynceapi/aio_portcheck.py
@@ -37,12 +37,17 @@ async def port_check_url(url: URL, timeout: int = 5) -> bool:
"""
Open the port designated by the URL given the timeout in seconds.
- If the port is available then return True; False otherwise.
-
Parameters
----------
- url: The URL that provides the target system
- timeout: Time to await for the port to open in seconds
+ url
+ The URL that provides the target system.
+ timeout
+ Time to await for the port to open in seconds.
+
+ Returns
+ -------
+ bool
+ If the port is available then return True; False otherwise.
"""
port = url.port or socket.getservbyname(url.scheme)