From 9248b0307f0fd723689c895f8a826e250ff2db58 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Wed, 28 Nov 2012 18:59:06 -0500 Subject: Replaced links of scriptlets with lists. Previously the deployment tools used symbolic links to determine the scriplets to execute and their order. The code has been changed such that now the scriplets are listed as parameters (spawn_scriplets and destroy_scriplets) in the configuration file. Ticket #403 --- base/deploy/src/pkidestroy | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 deletions(-) (limited to 'base/deploy/src/pkidestroy') diff --git a/base/deploy/src/pkidestroy b/base/deploy/src/pkidestroy index 88a47308f..4e8bca9d1 100755 --- a/base/deploy/src/pkidestroy +++ b/base/deploy/src/pkidestroy @@ -153,24 +153,13 @@ def main(argv): config.pki_log.debug(pkilogging.format(config.pki_master_dict), extra=config.PKI_INDENTATION_LEVEL_0) - # Remove the specified PKI subsystem. - pki_scriptlets_path = "/usr/share/pki/deployment/destroy" +\ - "/" + config.pki_subsystem.lower() - if not os.path.exists(pki_scriptlets_path) or\ - not os.path.isdir(pki_scriptlets_path): - config.pki_log.error(log.PKI_DIRECTORY_MISSING_OR_NOT_A_DIRECTORY_1, - pki_scriptlets_path, - extra=config.PKI_INDENTATION_LEVEL_0) - sys.exit(1) - pki_subsystem_scriptlets = os.listdir(pki_scriptlets_path) - pki_subsystem_scriptlets.sort() - - # Process the various "scriptlets" for the specified PKI subsystem. + # Process the various "scriptlets" to remove the specified PKI subsystem. + pki_subsystem_scriptlets = config.pki_master_dict['destroy_scriplets'].split() rv = 0 for pki_scriptlet in pki_subsystem_scriptlets: - scriptlet = __import__("pki.deployment" +\ - "." + pki_scriptlet[4:], - fromlist = [pki_scriptlet[4:]]) + scriptlet = __import__("pki.deployment." + + pki_scriptlet, + fromlist = [pki_scriptlet]) instance = scriptlet.PkiScriptlet() rv = instance.destroy() if rv != 0: -- cgit