Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
cloudify
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
data-infrastructure-services
cloudify
Commits
91775880
Commit
91775880
authored
2 months ago
by
Fabian Wachsmann
Browse files
Options
Downloads
Patches
Plain Diff
With port finder
parent
25b6cf9f
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Pipeline
#96665
failed
2 months ago
Stage: build
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
scripts/cloudify_tco2reg.py
+14
-1
14 additions, 1 deletion
scripts/cloudify_tco2reg.py
with
14 additions
and
1 deletion
scripts/cloudify_tco2reg.py
+
14
−
1
View file @
91775880
...
@@ -10,6 +10,7 @@ import os
...
@@ -10,6 +10,7 @@ import os
import
subprocess
import
subprocess
#import hdf5plugin
#import hdf5plugin
import
argparse
import
argparse
import
socket
def
parse_args
():
def
parse_args
():
parser
=
argparse
.
ArgumentParser
(
parser
=
argparse
.
ArgumentParser
(
...
@@ -51,7 +52,19 @@ if not os.path.isfile(ssl_keyfile) or not os.path.isfile(ssl_certfile):
...
@@ -51,7 +52,19 @@ if not os.path.isfile(ssl_keyfile) or not os.path.isfile(ssl_certfile):
subprocess
.
run
(
openssl_cmd
,
check
=
True
)
subprocess
.
run
(
openssl_cmd
,
check
=
True
)
port
=
9010
def
is_port_free
(
port
,
host
=
"
localhost
"
):
with
socket
.
socket
(
socket
.
AF_INET
,
socket
.
SOCK_STREAM
)
as
s
:
return
s
.
connect_ex
((
host
,
port
))
!=
0
# Returns True if the port is free
def
find_free_port
(
start
=
5000
,
end
=
5100
,
host
=
"
localhost
"
):
for
port
in
range
(
start
,
end
+
1
):
if
is_port_free
(
port
,
host
):
return
port
return
None
# No free ports found
port
=
find_free_port
(
9000
,
9100
)
if
not
port
:
raise
ValueError
(
"
Could not find a free port for service
"
)
nest_asyncio
.
apply
()
nest_asyncio
.
apply
()
chunks
=
{}
chunks
=
{}
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment