Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
S
slapos.recipe.maarch
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
slapos.recipe.maarch
Commits
aa08c9c1
Commit
aa08c9c1
authored
Mar 12, 2013
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replaced _ with - in parameter names
parent
197cbd39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
21 deletions
+21
-21
slapos/recipe/maarch/__init__.py
slapos/recipe/maarch/__init__.py
+21
-21
No files found.
slapos/recipe/maarch/__init__.py
View file @
aa08c9c1
...
...
@@ -53,23 +53,23 @@ class Recipe(GenericBaseRecipe):
- a Maarch 'superadmin' user (with the same password as the Postgres user).
Required options:
php
_
ini
php
-
ini
full path to the PHP configuration file.
htdocs
full path to the htdocs directory.
db
_
host
db
-
host
ip address of the postgres server.
db
_
port
db
-
port
ip port of the postgres server.
db
_
dbname
db
-
dbname
postgres database name.
db
_
username
db
-
username
username to authenticate with postgres.
db
_
password
db
-
password
password to authenticate with postgres.
language
language to use with maarch (en or fr).
root
_
docservers
root
-
docservers
where to create docservers directories.
Maarch configuration is detailed at
...
...
@@ -78,10 +78,10 @@ class Recipe(GenericBaseRecipe):
"""
def
install
(
self
):
if
not
self
.
options
[
'db
_
port'
]:
if
not
self
.
options
[
'db
-
port'
]:
raise
ValueError
,
"DB connection parameters are not ready yet"
self
.
update_phpini
(
php_ini_path
=
self
.
options
[
'php
_
ini'
])
self
.
update_phpini
(
php_ini_path
=
self
.
options
[
'php
-
ini'
])
self
.
load_initial_db
()
...
...
@@ -123,11 +123,11 @@ class Recipe(GenericBaseRecipe):
xml
=
lxml
.
etree
.
fromstring
(
content
)
xpath_set
(
xml
,
{
'CONFIG/databaseserver'
:
options
[
'db
_
host'
],
'CONFIG/databaseserverport'
:
options
[
'db
_
port'
],
'CONFIG/databasename'
:
options
[
'db
_
dbname'
],
'CONFIG/databaseuser'
:
options
[
'db
_
username'
],
'CONFIG/databasepassword'
:
options
[
'db
_
password'
],
'CONFIG/databaseserver'
:
options
[
'db
-
host'
],
'CONFIG/databaseserverport'
:
options
[
'db
-
port'
],
'CONFIG/databasename'
:
options
[
'db
-
dbname'
],
'CONFIG/databaseuser'
:
options
[
'db
-
username'
],
'CONFIG/databasepassword'
:
options
[
'db
-
password'
],
})
if
not
updating
:
...
...
@@ -198,11 +198,11 @@ class Recipe(GenericBaseRecipe):
options
=
self
.
options
conn
=
psycopg2
.
connect
(
host
=
options
[
'db
_
host'
],
port
=
int
(
options
[
'db
_
port'
]),
database
=
options
[
'db
_
dbname'
],
user
=
options
[
'db
_
username'
],
password
=
options
[
'db
_
password'
])
conn
=
psycopg2
.
connect
(
host
=
options
[
'db
-
host'
],
port
=
int
(
options
[
'db
-
port'
]),
database
=
options
[
'db
-
dbname'
],
user
=
options
[
'db
-
username'
],
password
=
options
[
'db
-
password'
])
cur
=
conn
.
cursor
()
...
...
@@ -228,7 +228,7 @@ class Recipe(GenericBaseRecipe):
cur
.
execute
(
fin
.
read
())
# initial admin password
enc_password
=
md5
.
md5
(
options
[
'db
_
password'
]).
hexdigest
()
enc_password
=
md5
.
md5
(
options
[
'db
-
password'
]).
hexdigest
()
cur
.
execute
(
"UPDATE users SET password=%s WHERE user_id='superadmin';"
,
(
enc_password
,
))
if
not
sql_data_file
:
...
...
@@ -250,7 +250,7 @@ class Recipe(GenericBaseRecipe):
(
'FASTHD_MAN'
,
'manual'
),
(
'TEMPLATES'
,
'templates'
),
]:
full_path
=
os
.
path
.
join
(
self
.
options
[
'root
_
docservers'
],
foldername
)
full_path
=
os
.
path
.
join
(
self
.
options
[
'root
-
docservers'
],
foldername
)
cur
.
execute
(
'UPDATE docservers SET path_template=%s WHERE docserver_id=%s'
,
(
full_path
,
docserver_id
))
try
:
os
.
makedirs
(
full_path
)
...
...
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