Commit 3a460672 authored by Jérome Perrin's avatar Jérome Perrin

software/erp5testnode: WIP switch_softwaretype -> switch-softwaretype

parent 1da8f562
......@@ -14,7 +14,7 @@
# not need these here).
[template]
filename = instance.cfg
md5sum = 64e57f6cd901485a8907ae1f9384542a
md5sum = ceceddb670be7b2f97ef64129a7765ef
[template-default]
filename = instance-default.cfg.jinja.in
......
[buildout]
parts =
prepare-switch-softwaretype-migration
switch-softwaretype
eggs-directory = ${buildout:eggs-directory}
......@@ -19,6 +20,22 @@ recipe = slapos.cookbook:switch-softwaretype
RootSoftwareInstance = $${:default}
default = instance-default:rendered
[prepare-switch-softwaretype-migration]
# We renamed switch-softwaretype into switch_softwaretype, this also
# renames the .installed database, but we need to keep the same database
# so that old files are removed after updating.
recipe = slapos.recipe.build
update =
import os
buildout_directory = self.buildout['buildout']['directory']
old_installed_cfg = os.path.join(buildout_directory, '.installed-switch_softwaretype.cfg')
new_installed_cfg = os.path.join(buildout_directory, '.installed-switch-softwaretype.cfg')
if os.path.exists(old_installed_cfg):
assert not os.path.exists(new_installed_cfg)
self.logger.info("Renaming %s to %s", old_installed_cfg, new_installed_cfg)
os.rename(old_installed_cfg, new_installed_cfg)
[instance-default]
recipe = slapos.recipe.template:jinja2
template = ${template-default:output}
......
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