diff --git a/base/server/etc/default.cfg b/base/server/etc/default.cfg index 586dce36893..e6f636568c3 100644 --- a/base/server/etc/default.cfg +++ b/base/server/etc/default.cfg @@ -40,7 +40,6 @@ spawn_scriplets= infrastructure_layout instance_layout subsystem_layout - webapp_deployment security_databases selinux_setup keygen @@ -53,7 +52,6 @@ destroy_scriplets= initialization configuration keygen - webapp_deployment subsystem_layout security_databases instance_layout diff --git a/base/server/python/pki/server/deployment/scriptlets/subsystem_layout.py b/base/server/python/pki/server/deployment/scriptlets/subsystem_layout.py index 63ed2810b2c..036fa337513 100644 --- a/base/server/python/pki/server/deployment/scriptlets/subsystem_layout.py +++ b/base/server/python/pki/server/deployment/scriptlets/subsystem_layout.py @@ -441,11 +441,16 @@ def spawn(self, deployer): def destroy(self, deployer): - logger.info('Removing %s subsystem', deployer.mdict['pki_subsystem']) - instance = self.instance + subsystem_name = deployer.mdict['pki_subsystem'].lower() + + logger.info('Undeploying /%s web application', subsystem_name) + + subsystem = instance.get_subsystem(subsystem_name) + subsystem.disable(force=deployer.force) + + logger.info('Removing %s subsystem', deployer.mdict['pki_subsystem']) - subsystem = instance.get_subsystem(deployer.mdict['pki_subsystem'].lower()) instance.remove_subsystem(subsystem) if config.str2bool(deployer.mdict['pki_registry_enable']): diff --git a/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py b/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py deleted file mode 100644 index 3f7ab9e0700..00000000000 --- a/base/server/python/pki/server/deployment/scriptlets/webapp_deployment.py +++ /dev/null @@ -1,55 +0,0 @@ -# Authors: -# Matthew Harmsen -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; version 2 of the License. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License along -# with this program; if not, write to the Free Software Foundation, Inc., -# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. -# -# Copyright (C) 2012 Red Hat, Inc. -# All rights reserved. -# - -# System Imports -from __future__ import absolute_import -import logging -import os - -import pki -import pki.server.instance -import pki.util - -# PKI Deployment Imports -from .. import pkiscriptlet - -logger = logging.getLogger(__name__) - - -# PKI Web Application Deployment Scriptlet -class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): - - def spawn(self, deployer): - pass - - def destroy(self, deployer): - - logger.info('Undeploying /%s web application', deployer.mdict['pki_subsystem'].lower()) - - # Delete /etc/pki//Catalina/localhost/.xml if exists - - context_xml = os.path.join( - self.instance.conf_dir, - 'Catalina', - 'localhost', - deployer.mdict['pki_subsystem'].lower() + '.xml') - - if os.path.exists(context_xml): - pki.util.remove(context_xml) diff --git a/base/server/python/pki/server/subsystem.py b/base/server/python/pki/server/subsystem.py index b412014ec40..e0d28de94cd 100644 --- a/base/server/python/pki/server/subsystem.py +++ b/base/server/python/pki/server/subsystem.py @@ -615,10 +615,11 @@ def enable(self, wait=False, max_wait=60, timeout=None): max_wait=max_wait, timeout=timeout) - def disable(self, wait=False, max_wait=60, timeout=None): + def disable(self, force=False, wait=False, max_wait=60, timeout=None): self.instance.undeploy_webapp( self.name, + force=force, wait=wait, max_wait=max_wait, timeout=timeout)