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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Jean-Paul Smets
slapos
Commits
f6708628
Commit
f6708628
authored
Sep 27, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
idempotent recipe
parent
9f11c7f8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
slapos/recipe/maarch/configuration.py
slapos/recipe/maarch/configuration.py
+14
-0
No files found.
slapos/recipe/maarch/configuration.py
View file @
f6708628
...
...
@@ -96,6 +96,10 @@ class Recipe(GenericBaseRecipe):
config_xml_default
=
os
.
path
.
join
(
folder
,
'config.xml.default'
)
config_xml
=
os
.
path
.
join
(
folder
,
'config.xml'
)
# do not overwrite the config.xml file (it can be customized inside the application)
if
os
.
path
.
exists
(
config_xml
):
return
content
=
open
(
config_xml_default
,
'rb'
).
read
()
xml
=
lxml
.
etree
.
fromstring
(
content
)
...
...
@@ -121,6 +125,10 @@ class Recipe(GenericBaseRecipe):
config_xml_default
=
os
.
path
.
join
(
folder
,
'config.xml.default'
)
config_xml
=
os
.
path
.
join
(
folder
,
'config.xml'
)
# do not overwrite the config.xml file (it can be customized inside the application)
if
os
.
path
.
exists
(
config_xml
):
return
content
=
open
(
config_xml_default
,
'rb'
).
read
()
xml
=
lxml
.
etree
.
fromstring
(
content
)
...
...
@@ -168,6 +176,12 @@ class Recipe(GenericBaseRecipe):
cur
=
conn
.
cursor
()
# skip everything if the tables have already been created
cur
.
execute
(
"SELECT 1 FROM information_schema.tables WHERE table_schema='public' AND table_name='docservers';"
)
if
cur
.
rowcount
==
1
:
conn
.
close
()
return
htdocs
=
options
[
'htdocs'
]
# load the schema
...
...
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