From df55f41413a15c5961f999266106964a0f01ab6c Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Wed, 14 Nov 2012 01:06:14 -0500 Subject: Removed remaining respawn code. The remaining codes, parameters, and messages related to respawn have been removed. Ticket #412 --- base/deploy/src/pkispawn | 48 +++++++--------------- base/deploy/src/scriptlets/configuration.py | 5 --- base/deploy/src/scriptlets/finalization.py | 5 --- .../deploy/src/scriptlets/infrastructure_layout.py | 5 --- base/deploy/src/scriptlets/initialization.py | 13 ------ base/deploy/src/scriptlets/instance_layout.py | 5 --- base/deploy/src/scriptlets/pkiconfig.py | 4 -- base/deploy/src/scriptlets/pkimessages.py | 15 ------- base/deploy/src/scriptlets/pkiparser.py | 18 +------- base/deploy/src/scriptlets/pkiscriptlet.py | 6 --- base/deploy/src/scriptlets/security_databases.py | 5 --- base/deploy/src/scriptlets/selinux_setup.py | 6 --- base/deploy/src/scriptlets/slot_substitution.py | 5 --- base/deploy/src/scriptlets/subsystem_layout.py | 5 --- base/deploy/src/scriptlets/webapp_deployment.py | 6 --- 15 files changed, 15 insertions(+), 136 deletions(-) diff --git a/base/deploy/src/pkispawn b/base/deploy/src/pkispawn index 4ea678ef6..f0543ce4d 100755 --- a/base/deploy/src/pkispawn +++ b/base/deploy/src/pkispawn @@ -102,30 +102,17 @@ def main(argv): # Enable 'pkispawn' logging. rv = 0 - if not config.pki_update_flag: - config.pki_log_dir = config.pki_root_prefix +\ - config.PKI_DEPLOYMENT_LOG_ROOT - config.pki_log_name = "pki" + "-" +\ - config.pki_subsystem.lower() +\ - "-" + "spawn" + "." +\ - config.pki_timestamp + "." + "log" - rv = pkilogging.enable_pki_logger(config.pki_log_dir, - config.pki_log_name, - config.pki_log_level, - config.pki_console_log_level, - "pkispawn") - else: - config.pki_log_dir = config.pki_root_prefix +\ - config.PKI_DEPLOYMENT_LOG_ROOT - config.pki_log_name = "pki" + "-" +\ - config.pki_subsystem.lower() +\ - "-" + "respawn" + "." +\ - config.pki_timestamp + "." + "log" - rv = pkilogging.enable_pki_logger(config.pki_log_dir, - config.pki_log_name, - config.pki_log_level, - config.pki_console_log_level, - "pkirespawn") + config.pki_log_dir = config.pki_root_prefix +\ + config.PKI_DEPLOYMENT_LOG_ROOT + config.pki_log_name = "pki" + "-" +\ + config.pki_subsystem.lower() +\ + "-" + "spawn" + "." +\ + config.pki_timestamp + "." + "log" + rv = pkilogging.enable_pki_logger(config.pki_log_dir, + config.pki_log_name, + config.pki_log_level, + config.pki_console_log_level, + "pkispawn") if rv != OSError: config.pki_log = rv else: @@ -176,12 +163,8 @@ def main(argv): # Combine the various sectional dictionaries into a PKI master dictionary parse.compose_pki_master_dictionary() - if not config.pki_update_flag: - config.pki_master_dict['pki_spawn_log'] = config.pki_log_dir + "/" +\ - config.pki_log_name - else: - config.pki_master_dict['pki_respawn_log'] = config.pki_log_dir + "/" +\ - config.pki_log_name + config.pki_master_dict['pki_spawn_log'] = config.pki_log_dir + "/" +\ + config.pki_log_name config.pki_log.debug(log.PKI_DICTIONARY_MASTER, extra=config.PKI_INDENTATION_LEVEL_0) config.pki_log.debug(pp.pformat(config.pki_master_dict), @@ -206,10 +189,7 @@ def main(argv): "." + pki_scriptlet[4:], fromlist = [pki_scriptlet[4:]]) instance = scriptlet.PkiScriptlet() - if not config.pki_update_flag: - rv = instance.spawn() - else: - rv = instance.respawn() + rv = instance.spawn() if rv != 0: sys.exit(1) config.pki_log.debug(log.PKI_DICTIONARY_MASTER, diff --git a/base/deploy/src/scriptlets/configuration.py b/base/deploy/src/scriptlets/configuration.py index c9454d951..c6c43d047 100644 --- a/base/deploy/src/scriptlets/configuration.py +++ b/base/deploy/src/scriptlets/configuration.py @@ -96,11 +96,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.jython.invoke(master['pki_jython_configuration_scriptlet']) return self.rv - def respawn(self): - config.pki_log.info(log.CONFIGURATION_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - return self.rv - def destroy(self): config.pki_log.info(log.CONFIGURATION_DESTROY_1, __name__, extra=config.PKI_INDENTATION_LEVEL_1) diff --git a/base/deploy/src/scriptlets/finalization.py b/base/deploy/src/scriptlets/finalization.py index 62d92a626..d871dd354 100644 --- a/base/deploy/src/scriptlets/finalization.py +++ b/base/deploy/src/scriptlets/finalization.py @@ -85,11 +85,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.configuration_file.display_configuration_url() return self.rv - def respawn(self): - config.pki_log.info(log.FINALIZATION_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - return self.rv - def destroy(self): config.pki_log.info(log.FINALIZATION_DESTROY_1, __name__, extra=config.PKI_INDENTATION_LEVEL_1) diff --git a/base/deploy/src/scriptlets/infrastructure_layout.py b/base/deploy/src/scriptlets/infrastructure_layout.py index e79fa8bfe..31c788bfd 100644 --- a/base/deploy/src/scriptlets/infrastructure_layout.py +++ b/base/deploy/src/scriptlets/infrastructure_layout.py @@ -81,11 +81,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.directory.create(master['pki_configuration_path']) return self.rv - def respawn(self): - config.pki_log.info(log.ADMIN_DOMAIN_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - return self.rv - def destroy(self): config.pki_log.info(log.ADMIN_DOMAIN_DESTROY_1, __name__, extra=config.PKI_INDENTATION_LEVEL_1) diff --git a/base/deploy/src/scriptlets/initialization.py b/base/deploy/src/scriptlets/initialization.py index a0298f740..2b5cc3861 100644 --- a/base/deploy/src/scriptlets/initialization.py +++ b/base/deploy/src/scriptlets/initialization.py @@ -64,19 +64,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.configuration_file.verify_selinux_ports() return self.rv - def respawn(self): - # begin official logging - config.pki_log.info(log.PKIRESPAWN_BEGIN_MESSAGE_2, - master['pki_subsystem'], - master['pki_instance_id'], - extra=config.PKI_INDENTATION_LEVEL_0) - config.pki_log.info(log.INITIALIZATION_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - # verify that this type of "subsystem" currently EXISTS - # for this "instance" - util.instance.verify_subsystem_exists() - return self.rv - def destroy(self): # begin official logging config.pki_log.info(log.PKIDESTROY_BEGIN_MESSAGE_2, diff --git a/base/deploy/src/scriptlets/instance_layout.py b/base/deploy/src/scriptlets/instance_layout.py index 773305c13..67de6d01e 100644 --- a/base/deploy/src/scriptlets/instance_layout.py +++ b/base/deploy/src/scriptlets/instance_layout.py @@ -144,11 +144,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): master['pki_instance_logs_link']) return self.rv - def respawn(self): - config.pki_log.info(log.INSTANCE_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - return self.rv - def destroy(self): config.pki_log.info(log.INSTANCE_DESTROY_1, __name__, extra=config.PKI_INDENTATION_LEVEL_1) diff --git a/base/deploy/src/scriptlets/pkiconfig.py b/base/deploy/src/scriptlets/pkiconfig.py index e8e65970e..a86774555 100644 --- a/base/deploy/src/scriptlets/pkiconfig.py +++ b/base/deploy/src/scriptlets/pkiconfig.py @@ -124,10 +124,6 @@ pkideployment_cfg = None # 'pkidestroy' ONLY pki_deployed_instance_name = None -# PKI Deployment "Optional" Command-Line Variables -# 'pkispawn' ONLY -pki_update_flag = False - # PKI Deployment "Test" Command-Line Variables pki_root_prefix = None diff --git a/base/deploy/src/scriptlets/pkimessages.py b/base/deploy/src/scriptlets/pkimessages.py index 435f7d10e..59fa7d3a6 100644 --- a/base/deploy/src/scriptlets/pkimessages.py +++ b/base/deploy/src/scriptlets/pkimessages.py @@ -121,10 +121,6 @@ PKIDESTROY_EPILOG =\ " prepended to the default PKI instance path which is placed in front\n"\ " of the specified '-i ' parameter.\n\n" +\ PKI_VERBOSITY -PKIRESPAWN_BEGIN_MESSAGE_2 = "BEGIN respawning subsystem '%s' of "\ - "instance '%s' . . ." -PKIRESPAWN_END_MESSAGE_2 = "END respawning subsystem '%s' of "\ - "instance '%s'" PKISPAWN_BEGIN_MESSAGE_2 = "BEGIN spawning subsystem '%s' of "\ "instance '%s' . . ." PKISPAWN_END_MESSAGE_2 = "END spawning subsystem '%s' of "\ @@ -313,37 +309,26 @@ PKI_JYTHON_NOT_YET_IMPLEMENTED = "NOT YET IMPLEMENTED" # PKI Deployment "Scriptlet" Messages ADMIN_DOMAIN_DESTROY_1 = "depopulating '%s'" -ADMIN_DOMAIN_RESPAWN_1 = "repopulating '%s'" ADMIN_DOMAIN_SPAWN_1 = "populating '%s'" CONFIGURATION_DESTROY_1 = "unconfiguring '%s'" -CONFIGURATION_RESPAWN_1 = "reconfiguring '%s'" CONFIGURATION_SPAWN_1 = "configuring '%s'" FINALIZATION_DESTROY_1 = "finalizing '%s'" -FINALIZATION_RESPAWN_1 = "finalizing '%s'" FINALIZATION_SPAWN_1 = "finalizing '%s'" INITIALIZATION_DESTROY_1 = "initializing '%s'" -INITIALIZATION_RESPAWN_1 = "initializing '%s'" INITIALIZATION_SPAWN_1 = "initializing '%s'" INSTANCE_DESTROY_1 = "depopulating '%s'" -INSTANCE_RESPAWN_1 = "repopulating '%s'" INSTANCE_SPAWN_1 = "populating '%s'" RESIDUAL_DESTROY_1 = "depopulating '%s'" -RESIDUAL_RESPAWN_1 = "repopulating '%s'" RESIDUAL_SPAWN_1 = "populating '%s'" SECURITY_DATABASES_DESTROY_1 = "removing '%s'" -SECURITY_DATABASES_RESPAWN_1 = "regenerating '%s'" SECURITY_DATABASES_SPAWN_1 = "generating '%s'" SELINUX_DESTROY_1 = "depopulating '%s'" -SELINUX_RESPAWN_1 = "repopulating '%s'" SELINUX_SPAWN_1 = "populating '%s'" SLOT_ASSIGNMENT_DESTROY_1 = "unassigning slots for '%s'" -SLOT_ASSIGNMENT_RESPAWN_1 = "reassigning slots for '%s'" SLOT_ASSIGNMENT_SPAWN_1 = "assigning slots for '%s'" SUBSYSTEM_DESTROY_1 = "depopulating '%s'" -SUBSYSTEM_RESPAWN_1 = "repopulating '%s'" SUBSYSTEM_SPAWN_1 = "populating '%s'" WEBAPP_DEPLOYMENT_DESTROY_1 = "removing '%s'" -WEBAPP_DEPLOYMENT_RESPAWN_1 = "redeploying '%s'" WEBAPP_DEPLOYMENT_SPAWN_1 = "deploying '%s'" SKIP_ADMIN_DOMAIN_SPAWN_1 = "skip populating '%s'" SKIP_CONFIGURATION_SPAWN_1 = "skip configuring '%s'" diff --git a/base/deploy/src/scriptlets/pkiparser.py b/base/deploy/src/scriptlets/pkiparser.py index 4f2757359..d4765e6ed 100644 --- a/base/deploy/src/scriptlets/pkiparser.py +++ b/base/deploy/src/scriptlets/pkiparser.py @@ -77,10 +77,6 @@ def process_command_line_arguments(argv): optional.add_argument('-h', '--help', dest='help', action='help', help='show this help message and exit') - if config.pki_deployment_executable == 'pkispawn': - optional.add_argument('-u', - dest='pki_update_flag', action='store_true', - help='update instance of specified subsystem') optional.add_argument('-v', dest='pki_verbosity', action='count', help='display verbose information (details below)') @@ -104,9 +100,6 @@ def process_command_line_arguments(argv): config.pki_deployed_instance_name =\ str(args.pki_deployed_instance_name).strip('[\']') # Process 'Optional' command-line options - if config.pki_deployment_executable == 'pkispawn': - # '-u' - config.pki_update_flag = args.pki_update_flag # '-v' if args.pki_verbosity == 1: config.pki_jython_log_level = config.PKI_JYTHON_INFO_LOG_LEVEL @@ -250,7 +243,7 @@ def compose_pki_master_dictionary(): "Create a single master PKI dictionary from the sectional dictionaries" try: config.pki_master_dict = dict() - # 'pkispawn'/'pkirespawn'/'pkidestroy' name/value pairs + # 'pkispawn'/'pkidestroy' name/value pairs config.pki_master_dict['pki_deployment_executable'] =\ config.pki_deployment_executable config.pki_master_dict['pki_install_time'] = config.pki_install_time @@ -2286,11 +2279,6 @@ def compose_pki_master_dictionary(): "spawn" + "_" +\ config.PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE + "." +\ config.pki_master_dict['pki_timestamp'] - config.pki_master_dict['pki_deployment_cfg_respawn_archive'] =\ - config.pki_master_dict['pki_subsystem_archive_log_path'] + "/" +\ - "respawn" + "_" +\ - config.PKI_DEPLOYMENT_DEFAULT_CONFIGURATION_FILE + "." +\ - config.pki_master_dict['pki_timestamp'] config.pki_master_dict['pki_manifest'] =\ config.pki_master_dict['pki_subsystem_registry_path'] + "/" +\ "manifest" @@ -2298,10 +2286,6 @@ def compose_pki_master_dictionary(): config.pki_master_dict['pki_subsystem_archive_log_path'] + "/" +\ "spawn" + "_" + "manifest" + "." +\ config.pki_master_dict['pki_timestamp'] - config.pki_master_dict['pki_manifest_respawn_archive'] =\ - config.pki_master_dict['pki_subsystem_archive_log_path'] + "/" +\ - "respawn" + "_" + "manifest" + "." +\ - config.pki_master_dict['pki_timestamp'] # Construct the configuration URL containing the one-time pin # and add this to the "sensitive" key value pairs read in from # the configuration file diff --git a/base/deploy/src/scriptlets/pkiscriptlet.py b/base/deploy/src/scriptlets/pkiscriptlet.py index 767b3c609..28706d01c 100644 --- a/base/deploy/src/scriptlets/pkiscriptlet.py +++ b/base/deploy/src/scriptlets/pkiscriptlet.py @@ -33,12 +33,6 @@ class AbstractBasePkiScriptlet(object): use it to install a new PKI instance.""" return - @abc.abstractmethod - def respawn(self): - """Retrieve data from the specified PKI dictionary and - use it to update an existing PKI instance.""" - return - @abc.abstractmethod def destroy(self): """Retrieve data from the specified PKI dictionary and diff --git a/base/deploy/src/scriptlets/security_databases.py b/base/deploy/src/scriptlets/security_databases.py index 0cc660b3a..be0eecf56 100644 --- a/base/deploy/src/scriptlets/security_databases.py +++ b/base/deploy/src/scriptlets/security_databases.py @@ -97,11 +97,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.file.delete(master['pki_shared_pfile']) return self.rv - def respawn(self): - config.pki_log.info(log.SECURITY_DATABASES_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - return self.rv - def destroy(self): config.pki_log.info(log.SECURITY_DATABASES_DESTROY_1, __name__, extra=config.PKI_INDENTATION_LEVEL_1) diff --git a/base/deploy/src/scriptlets/selinux_setup.py b/base/deploy/src/scriptlets/selinux_setup.py index 98bfcd48e..56d03fd1d 100644 --- a/base/deploy/src/scriptlets/selinux_setup.py +++ b/base/deploy/src/scriptlets/selinux_setup.py @@ -101,12 +101,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): self.restore_context() return self.rv - def respawn(self): - config.pki_log.info(log.SELINUX_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - self.restore_context() - return self.rv - def destroy(self): config.pki_log.info(log.SELINUX_DESTROY_1, __name__, extra=config.PKI_INDENTATION_LEVEL_1) diff --git a/base/deploy/src/scriptlets/slot_substitution.py b/base/deploy/src/scriptlets/slot_substitution.py index 055908b5b..8e566e266 100644 --- a/base/deploy/src/scriptlets/slot_substitution.py +++ b/base/deploy/src/scriptlets/slot_substitution.py @@ -92,11 +92,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): master['pki_target_profileselect_template']) return self.rv - def respawn(self): - config.pki_log.info(log.SLOT_ASSIGNMENT_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - return self.rv - def destroy(self): config.pki_log.info(log.SLOT_ASSIGNMENT_DESTROY_1, __name__, extra=config.PKI_INDENTATION_LEVEL_1) diff --git a/base/deploy/src/scriptlets/subsystem_layout.py b/base/deploy/src/scriptlets/subsystem_layout.py index c4c4c2283..f340ead49 100644 --- a/base/deploy/src/scriptlets/subsystem_layout.py +++ b/base/deploy/src/scriptlets/subsystem_layout.py @@ -101,11 +101,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): master['pki_subsystem_registry_link']) return self.rv - def respawn(self): - config.pki_log.info(log.SUBSYSTEM_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - return self.rv - def destroy(self): config.pki_log.info(log.SUBSYSTEM_DESTROY_1, __name__, extra=config.PKI_INDENTATION_LEVEL_1) diff --git a/base/deploy/src/scriptlets/webapp_deployment.py b/base/deploy/src/scriptlets/webapp_deployment.py index 958d5e271..4597b57bd 100644 --- a/base/deploy/src/scriptlets/webapp_deployment.py +++ b/base/deploy/src/scriptlets/webapp_deployment.py @@ -142,12 +142,6 @@ class PkiScriptlet(pkiscriptlet.AbstractBasePkiScriptlet): util.directory.set_mode(master['pki_tomcat_webapps_subsystem_path']) return self.rv - def respawn(self): - if master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS: - config.pki_log.info(log.WEBAPP_DEPLOYMENT_RESPAWN_1, __name__, - extra=config.PKI_INDENTATION_LEVEL_1) - return self.rv - def destroy(self): if master['pki_subsystem'] in config.PKI_TOMCAT_SUBSYSTEMS: config.pki_log.info(log.WEBAPP_DEPLOYMENT_DESTROY_1, __name__, -- cgit