From df55f41413a15c5961f999266106964a0f01ab6c Mon Sep 17 00:00:00 2001
From: Endi Sukma Dewata <edewata@redhat.com>
Date: Wed, 14 Nov 2012 01:06:14 -0500
Subject: [PATCH] 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 4ea678ef6aa98eecf19057277a78cfb0f6767efa..f0543ce4dbbb90abfedf96d05872da53ceb8795f 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 c9454d951213c2dcc0390d570e6cbe8577abad1e..c6c43d047a1588698a1eaae014ac1b7549b92f1c 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 62d92a6260bd1ca0e1ec7879feee265519d7bf03..d871dd3544245e232667a5bf8d7ccabced3cf40d 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 e79fa8bfe347e87e5cba8c0b51e13ad22a95f243..31c788bfd37aba9ff69569d4818ac6b0b8d07fc9 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 a0298f740a6eb9f79d9ded9e74c7800729dd878e..2b5cc38619d0b880c6a179a733eeb0bbbc2b9bb2 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 773305c139f4b62f73c17969e90ef097337a12b4..67de6d01e5ea9df983a141aa722073d470a392cb 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 e8e65970e76400a1bb20dfdc1c9c211b749ca025..a8677455533999fce0373d932ad1c19afb2d81e2 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 435f7d10e565d6de892f019d12b600d4c6d9996a..59fa7d3a69ebeb028fab8dd2808feb6c1bf64ae4 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 <instance>' 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 4f275735967860db952a044bcb32b9b28c4059a7..d4765e6ed06057026090393aea44e1e9a8b88ab1 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 767b3c6096227fce67ea1043939753661b33e7d7..28706d01c484199a67dfbb8802a1b52fa3d79365 100644
--- a/base/deploy/src/scriptlets/pkiscriptlet.py
+++ b/base/deploy/src/scriptlets/pkiscriptlet.py
@@ -34,12 +34,6 @@ class AbstractBasePkiScriptlet(object):
         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
            use it to destroy an existing PKI instance."""
diff --git a/base/deploy/src/scriptlets/security_databases.py b/base/deploy/src/scriptlets/security_databases.py
index 0cc660b3ace3a831650888c52db519d473c7b7b1..be0eecf56c83dffe6a94190f707fd1294521df32 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 98bfcd48e0516ae5623f4f4bc0495fc709796d8d..56d03fd1d044576628821c1331dfeec720e8f168 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 055908b5bb28630fce2e7333c3b12d2db5f50afa..8e566e266c3456338519f87396c782e4a2a43622 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 c4c4c228376872202df470dc1ecbabe8fdc28238..f340ead4969bdeb5ff059890edb6a51d1428ed84 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 958d5e2717515cab7a1dcfcef512de591aef703f..4597b57bd0707885e914ab7df72d99f8ee758141 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__,
-- 
1.7.12.1

