Commit f6708628 authored by Marco Mariani's avatar Marco Mariani

idempotent recipe

parent 9f11c7f8
......@@ -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
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment