From 6debc007e847c42b17baca5f1674e0c414cc42e0 Mon Sep 17 00:00:00 2001 From: Benjamin Dauvergne Date: Thu, 24 May 2018 00:53:23 +0200 Subject: [PATCH 7/8] use wcs name for destruction details about wcs (to be rebased) --- hobo/contrib/ozwillo/README.rst | 9 ++++++++- hobo/contrib/ozwillo/models.py | 6 ++++-- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/hobo/contrib/ozwillo/README.rst b/hobo/contrib/ozwillo/README.rst index be2f90e..d935ccb 100644 --- a/hobo/contrib/ozwillo/README.rst +++ b/hobo/contrib/ozwillo/README.rst @@ -54,7 +54,7 @@ Install on Debian "passerelle-", "passerelle-manage" ], - "wcs-au-quotidien": [ + "wcs": [ "demarches-", "wcsctl" ] @@ -96,3 +96,10 @@ OZWILLO_SERVICES is a dict following this pattern: 'service_user': "passerelle": ["passerelle-", "passerelle-manage"], "wcs-au-quotidien": ["demarches-", "wcsctl"] } + +Destruction +=========== + +For the complete destruction of w.c.s. instances it's necessary that in the +default skeleton (`/var/lib/wcs/skeletons/export.zip`) the `config.pck` file +contains a key `postgresql.createdb-connection-params`. diff --git a/hobo/contrib/ozwillo/models.py b/hobo/contrib/ozwillo/models.py index 91441fa..b1a4e59 100644 --- a/hobo/contrib/ozwillo/models.py +++ b/hobo/contrib/ozwillo/models.py @@ -233,11 +233,13 @@ class OzwilloInstance(models.Model): self.state = self.STATE_DESTROY_ERROR self.save() + def destroy(self): logger.info(u'ozwillo: destroy start for %s', self) instance_slug = self.domain_slug - services = settings.OZWILLO_SERVICES - wcs = services['wcs-au-quotidien'] + services = settings.OZWILLO_SERVICES.copy() + # w.c.s. is handled differently + wcs = services.pop('wcs') for s, infos in services.items(): # to get the two combo instances which have same service -- 2.17.0