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
Łukasz Nowak
slapos
Commits
3443b2f3
Commit
3443b2f3
authored
Apr 08, 2020
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
recipe/postgres: drop ipv6-random option
Use the first ipv6 to generate the URL
parent
c7b846b1
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
5 deletions
+10
-5
slapos/recipe/postgres/__init__.py
slapos/recipe/postgres/__init__.py
+10
-5
No files found.
slapos/recipe/postgres/__init__.py
View file @
3443b2f3
...
@@ -56,8 +56,6 @@ class Recipe(GenericBaseRecipe):
...
@@ -56,8 +56,6 @@ class Recipe(GenericBaseRecipe):
ipv4 to listen on, can be multiple ips or can be empty.
ipv4 to listen on, can be multiple ips or can be empty.
ipv6
ipv6
ipv6 to listen on, can be multiple ips or can be empty.
ipv6 to listen on, can be multiple ips or can be empty.
ipv6-random
main ipv6 to listen on, can be empty.
port
port
port to listen on, same for both IPv4 and IPv6.
port to listen on, same for both IPv4 and IPv6.
pgdata-directory
pgdata-directory
...
@@ -71,13 +69,20 @@ class Recipe(GenericBaseRecipe):
...
@@ -71,13 +69,20 @@ class Recipe(GenericBaseRecipe):
Exposed options:
Exposed options:
url
url
generated DBAPI connection string, on IPv6
generated DBAPI connection string, on IPv6
.
it can be used as-is (ie. in sqlalchemy) or by the _urlparse.py recipe.
it can be used as-is (ie. in sqlalchemy) or by the _urlparse.py recipe.
this is only available if at least one IPv6 was provided.
"""
"""
def
_options
(
self
,
options
):
def
_options
(
self
,
options
):
options
[
'url'
]
=
'postgresql://%(superuser)s:%(password)s@[%(ipv6-random)s]:%(port)s/%(dbname)s'
%
options
if
options
.
get
(
'ipv6'
):
options
[
'url'
]
=
"postgresql://{superuser}:{password}@[{ipv6}]:{port}/{dbname}"
.
format
(
superuser
=
options
[
'superuser'
],
password
=
options
[
'password'
],
ipv6
=
options
[
'ipv6'
].
splitlines
()[
0
],
port
=
options
[
'port'
],
dbname
=
options
[
'dbname'
],
)
def
install
(
self
):
def
install
(
self
):
pgdata
=
self
.
options
[
'pgdata-directory'
]
pgdata
=
self
.
options
[
'pgdata-directory'
]
...
...
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