diff options
author | Endi Sukma Dewata <edewata@redhat.com> | 2012-12-18 14:46:41 -0500 |
---|---|---|
committer | Endi Sukma Dewata <edewata@redhat.com> | 2013-01-11 03:23:28 -0500 |
commit | 5d52ca28c2fb1b37f08ff4d5eb4a62cc410468bd (patch) | |
tree | d5f9af402158d4c6a8e2573875bc024792ead063 /base/deploy/src/pkidestroy | |
parent | a4a2cd5db2278e3af0835447060d0051e5d65e60 (diff) | |
download | pki-5d52ca28c2fb1b37f08ff4d5eb4a62cc410468bd.tar.gz pki-5d52ca28c2fb1b37f08ff4d5eb4a62cc410468bd.tar.xz pki-5d52ca28c2fb1b37f08ff4d5eb4a62cc410468bd.zip |
Added interactive subsystem installation.ticket-380-5
The pkispawn has been modified such that if there is no configuration
file specified it will enter an interactive mode. The pkidestroy has
been modified such that if the instance name or subsystem type is not
specified it will enter an interactive mode.
Ticket #380
Diffstat (limited to 'base/deploy/src/pkidestroy')
-rwxr-xr-x | base/deploy/src/pkidestroy | 46 |
1 files changed, 27 insertions, 19 deletions
diff --git a/base/deploy/src/pkidestroy b/base/deploy/src/pkidestroy index edb57e9ac..8fb4e3ae6 100755 --- a/base/deploy/src/pkidestroy +++ b/base/deploy/src/pkidestroy @@ -1,4 +1,4 @@ -#!/usr/bin/python -t +#!/usr/bin/python -tu # Authors: # Matthew Harmsen <mharmsen@redhat.com> # @@ -52,6 +52,10 @@ error was: def main(argv): "main entry point" + print "PKI Subsystem Removal" + print "---------------------" + print + config.pki_deployment_executable = os.path.basename(argv[0]) # Only run this program as "root". @@ -97,14 +101,29 @@ def main(argv): parser.mandatory.add_argument('-i', dest='pki_deployed_instance_name', action='store', - nargs=1, required=True, metavar='<instance>', + nargs=1, metavar='<instance>', help='FORMAT: ${pki_instance_name}') args = parser.process_command_line_arguments(argv) + interactive = False + + # -s <subsystem> + if args.pki_subsystem is None: + interactive = True + config.pki_subsystem = parser.read_text('Subsystem type', default='CA') + else: + config.pki_subsystem = str(args.pki_subsystem).strip('[\']') + # -i <instance name> - config.pki_deployed_instance_name =\ - str(args.pki_deployed_instance_name).strip('[\']') + if args.pki_deployed_instance_name is None: + interactive = True + config.pki_deployed_instance_name = parser.read_text('Instance name', default='pki-tomcat') + else: + config.pki_deployed_instance_name = str(args.pki_deployed_instance_name).strip('[\']') + + if interactive: + print # verify that previously deployed instance exists deployed_pki_instance_path = config.pki_root_prefix +\ @@ -134,7 +153,7 @@ def main(argv): config.pki_subsystem.lower() + "/" +\ config.USER_DEPLOYMENT_CONFIGURATION - parser.validate() + parser.initialize() # Enable 'pkidestroy' logging. config.pki_log_dir = config.pki_root_prefix +\ @@ -161,20 +180,6 @@ def main(argv): extra=config.PKI_INDENTATION_LEVEL_0) sys.exit(1) - # NEVER print out 'sensitive' name/value pairs!!! - config.pki_log.debug(log.PKI_DICTIONARY_DEFAULT, - extra=config.PKI_INDENTATION_LEVEL_0) - config.pki_log.debug(pkilogging.format(config.pki_default_dict), - extra=config.PKI_INDENTATION_LEVEL_0) - config.pki_log.debug(log.PKI_DICTIONARY_WEB_SERVER, - extra=config.PKI_INDENTATION_LEVEL_0) - config.pki_log.debug(pkilogging.format(config.pki_web_server_dict), - extra=config.PKI_INDENTATION_LEVEL_0) - config.pki_log.debug(log.PKI_DICTIONARY_SUBSYSTEM, - extra=config.PKI_INDENTATION_LEVEL_0) - config.pki_log.debug(pkilogging.format(config.pki_subsystem_dict), - extra=config.PKI_INDENTATION_LEVEL_0) - # Combine the various sectional dictionaries into a PKI master dictionary parser.compose_pki_master_dictionary() config.pki_master_dict['pki_destroy_log'] = config.pki_log_dir + "/" +\ @@ -200,6 +205,9 @@ def main(argv): config.pki_log.debug(pkilogging.format(config.pki_master_dict), extra=config.PKI_INDENTATION_LEVEL_0) + print + print "Removal complete." + # PKI Deployment Entry Point if __name__ == "__main__": |