Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
cloudooo
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Labels
Merge Requests
7
Merge Requests
7
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Jobs
Commits
Open sidebar
nexedi
cloudooo
Commits
ebeac211
Commit
ebeac211
authored
Apr 23, 2023
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ooo/util: close sockets in socketStatus
parent
a77f5599
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
1 deletion
+3
-1
cloudooo/handler/ooo/util.py
cloudooo/handler/ooo/util.py
+3
-1
No files found.
cloudooo/handler/ooo/util.py
View file @
ebeac211
...
@@ -28,6 +28,7 @@
...
@@ -28,6 +28,7 @@
#
#
##############################################################################
##############################################################################
import
contextlib
from
socket
import
socket
,
error
from
socket
import
socket
,
error
from
errno
import
EADDRINUSE
from
errno
import
EADDRINUSE
from
time
import
sleep
from
time
import
sleep
...
@@ -47,7 +48,8 @@ def removeDirectory(path):
...
@@ -47,7 +48,8 @@ def removeDirectory(path):
def
socketStatus
(
hostname
,
port
):
def
socketStatus
(
hostname
,
port
):
"""Verify if the address is busy."""
"""Verify if the address is busy."""
try
:
try
:
socket
().
bind
((
hostname
,
port
),)
with
contextlib
.
closing
(
socket
())
as
sock
:
sock
.
bind
((
hostname
,
port
))
# False if the is free
# False if the is free
return
False
return
False
except
error
as
err
:
except
error
as
err
:
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment