Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Léo-Paul Géneau
slapos
Commits
f6501731
Commit
f6501731
authored
Sep 13, 2016
by
Nicolas Wavrant
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
free_port: is more slapos-friendly: restart until a valid port is returned
parent
def98000
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
2 deletions
+6
-2
slapos/recipe/free_port.py
slapos/recipe/free_port.py
+6
-2
No files found.
slapos/recipe/free_port.py
View file @
f6501731
...
@@ -53,6 +53,10 @@ class Recipe(object):
...
@@ -53,6 +53,10 @@ class Recipe(object):
with
open
(
buildout
[
'buildout'
][
'installed'
])
as
config_file
:
with
open
(
buildout
[
'buildout'
][
'installed'
])
as
config_file
:
parser
.
readfp
(
config_file
)
parser
.
readfp
(
config_file
)
port
=
parser
.
get
(
name
,
'port'
)
port
=
parser
.
get
(
name
,
'port'
)
# Port can be 0 in case of upgrade: some old service still runs on port,
# so 0 is returned by default. Then, on next run, this recipe is processed
# again until a correct value is returned
if
port
!=
'0'
:
self
.
options
[
'port'
]
=
port
self
.
options
[
'port'
]
=
port
return
return
except
(
IOError
,
ConfigParser
.
NoSectionError
,
ConfigParser
.
NoOptionError
):
except
(
IOError
,
ConfigParser
.
NoSectionError
,
ConfigParser
.
NoOptionError
):
...
...
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