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
Kwabena Antwi-Boasiako
slapos
Commits
a4bd0feb
Commit
a4bd0feb
authored
Sep 27, 2012
by
Marco Mariani
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
idempotent recipe
parent
7342c6b3
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 @
a4bd0feb
...
@@ -96,6 +96,10 @@ class Recipe(GenericBaseRecipe):
...
@@ -96,6 +96,10 @@ class Recipe(GenericBaseRecipe):
config_xml_default
=
os
.
path
.
join
(
folder
,
'config.xml.default'
)
config_xml_default
=
os
.
path
.
join
(
folder
,
'config.xml.default'
)
config_xml
=
os
.
path
.
join
(
folder
,
'config.xml'
)
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
()
content
=
open
(
config_xml_default
,
'rb'
).
read
()
xml
=
lxml
.
etree
.
fromstring
(
content
)
xml
=
lxml
.
etree
.
fromstring
(
content
)
...
@@ -121,6 +125,10 @@ class Recipe(GenericBaseRecipe):
...
@@ -121,6 +125,10 @@ class Recipe(GenericBaseRecipe):
config_xml_default
=
os
.
path
.
join
(
folder
,
'config.xml.default'
)
config_xml_default
=
os
.
path
.
join
(
folder
,
'config.xml.default'
)
config_xml
=
os
.
path
.
join
(
folder
,
'config.xml'
)
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
()
content
=
open
(
config_xml_default
,
'rb'
).
read
()
xml
=
lxml
.
etree
.
fromstring
(
content
)
xml
=
lxml
.
etree
.
fromstring
(
content
)
...
@@ -168,6 +176,12 @@ class Recipe(GenericBaseRecipe):
...
@@ -168,6 +176,12 @@ class Recipe(GenericBaseRecipe):
cur
=
conn
.
cursor
()
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'
]
htdocs
=
options
[
'htdocs'
]
# load the schema
# 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