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
Aurel
slapos
Commits
37d8473c
Commit
37d8473c
authored
Jun 19, 2014
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
abilian: separate instance parameter for pg uri
parent
557a018c
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
20 additions
and
12 deletions
+20
-12
slapos/recipe/jsondump.py
slapos/recipe/jsondump.py
+8
-8
slapos/recipe/slapconfiguration.py
slapos/recipe/slapconfiguration.py
+1
-1
software/abilian/extranet_spr/abilian-config.py
software/abilian/extranet_spr/abilian-config.py
+7
-0
software/abilian/extranet_spr/instance-postgres.cfg.in
software/abilian/extranet_spr/instance-postgres.cfg.in
+2
-1
software/abilian/extranet_spr/software.cfg
software/abilian/extranet_spr/software.cfg
+2
-2
No files found.
slapos/recipe/jsondump.py
View file @
37d8473c
from
slapos.recipe.librecipe
import
GenericBaseRecipe
import
json
import
json
import
os
import
os
class
Recipe
(
object
):
class
Recipe
(
GenericBaseRecipe
):
def
__init__
(
self
,
buildout
,
name
,
options
):
def
install
(
self
):
parameter_dict
=
{
parameter_dict
=
{
key
:
value
key
:
value
for
key
,
value
in
options
.
items
()
for
key
,
value
in
self
.
options
.
items
()
if
key
not
in
[
'json-output'
,
'recipe'
]
if
key
not
in
[
'json-output'
,
'recipe'
]
}
}
self
.
_json_output
=
options
[
'json-output'
]
with
os
.
fdopen
(
os
.
open
(
self
.
options
[
'json-output'
],
os
.
O_WRONLY
|
os
.
O_CREAT
|
os
.
O_TRUNC
,
0o600
),
'w'
)
as
fout
:
with
os
.
fdopen
(
os
.
open
(
self
.
_json_output
,
os
.
O_WRONLY
|
os
.
O_CREAT
|
os
.
O_TRUNC
,
0o600
),
'w'
)
as
fout
:
fout
.
write
(
json
.
dumps
(
parameter_dict
,
indent
=
2
,
sort_keys
=
True
))
fout
.
write
(
json
.
dumps
(
parameter_dict
,
indent
=
2
,
sort_keys
=
True
))
fout
.
close
()
def
install
(
self
):
return
[
self
.
options
[
'json-output'
]]
return
[
self
.
_json_output
]
update
=
install
update
=
install
slapos/recipe/slapconfiguration.py
View file @
37d8473c
...
@@ -171,7 +171,7 @@ class JsonDump(Recipe):
...
@@ -171,7 +171,7 @@ class JsonDump(Recipe):
def
__init__
(
self
,
buildout
,
name
,
options
):
def
__init__
(
self
,
buildout
,
name
,
options
):
parameter_dict
=
self
.
fetch_parameter_dict
(
options
)
parameter_dict
=
self
.
fetch_parameter_dict
(
options
)
self
.
_json_output
=
options
[
'json-output'
]
self
.
_json_output
=
options
[
'json-output'
]
with
os
.
fdopen
(
os
.
open
(
self
.
_json_output
,
os
.
O_WRONLY
|
os
.
O_CREAT
|
os
.
O_TRUNC
,
0600
),
'w'
)
as
fout
:
with
os
.
fdopen
(
os
.
open
(
self
.
_json_output
,
os
.
O_WRONLY
|
os
.
O_CREAT
|
os
.
O_TRUNC
,
0
o
600
),
'w'
)
as
fout
:
fout
.
write
(
json
.
dumps
(
parameter_dict
,
indent
=
2
,
sort_keys
=
True
))
fout
.
write
(
json
.
dumps
(
parameter_dict
,
indent
=
2
,
sort_keys
=
True
))
def
install
(
self
):
def
install
(
self
):
...
...
software/abilian/extranet_spr/abilian-config.py
View file @
37d8473c
...
@@ -23,6 +23,13 @@ def load_config():
...
@@ -23,6 +23,13 @@ def load_config():
if
key
in
[
'SECRET_KEY'
]:
if
key
in
[
'SECRET_KEY'
]:
globals
()[
key
]
=
str
(
value
)
globals
()[
key
]
=
str
(
value
)
# interpolate password if needed
try
:
globals
()[
'SQLALCHEMY_DATABASE_URI'
]
=
SQLALCHEMY_DATABASE_URI
%
{
'password'
:
SQLALCHEMY_DATABASE_PASSWORD
}
except
NameError
:
pass
load_config
()
load_config
()
del
load_config
del
load_config
...
...
software/abilian/extranet_spr/instance-postgres.cfg.in
View file @
37d8473c
...
@@ -54,7 +54,8 @@ template-pg-hba-conf =
...
@@ -54,7 +54,8 @@ template-pg-hba-conf =
# TYPE DATABASE USER ADDRESS METHOD
# TYPE DATABASE USER ADDRESS METHOD
# "local" is for Unix domain socket connections only (check unix_socket_permissions!)
# "local" is for Unix domain socket connections only (check unix_socket_permissions!)
local all all trust
local all all trust
host all all 127.0.0.1/32 md5
#do not conflict with other postgres instances on the same node
#host all all 127.0.0.1/32 md5
{ipv4_auth}
{ipv4_auth}
template-hba-ipv4 =
template-hba-ipv4 =
...
...
software/abilian/extranet_spr/software.cfg
View file @
37d8473c
...
@@ -236,7 +236,7 @@ mode = 0644
...
@@ -236,7 +236,7 @@ mode = 0644
recipe = slapos.recipe.template
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/instance-postgres.cfg.in
url = ${:_profile_base_location_}/instance-postgres.cfg.in
output = ${buildout:directory}/instance-postgres.cfg
output = ${buildout:directory}/instance-postgres.cfg
md5sum =
118f5eacb47909aa4fefbd3391cb2077
md5sum =
5fc618f929c9d34cdaca57b17864c611
mode = 0644
mode = 0644
[instance-redis]
[instance-redis]
...
@@ -265,7 +265,7 @@ mode = 0644
...
@@ -265,7 +265,7 @@ mode = 0644
[abilian-config]
[abilian-config]
recipe = hexagonit.recipe.download
recipe = hexagonit.recipe.download
url = ${:_profile_base_location_}/abilian-config.py
url = ${:_profile_base_location_}/abilian-config.py
md5sum = e
30bc5063632a1882ad8686147d2b0df
md5sum = e
89ecb0293a49ab382337bdb1f676fb0
location = ${buildout:parts-directory}/${:_buildout_section_name_}
location = ${buildout:parts-directory}/${:_buildout_section_name_}
filename = abilian-config.py
filename = abilian-config.py
download-only = true
download-only = true
...
...
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