diff options
| author | Ade Lee <alee@redhat.com> | 2013-03-18 11:29:52 -0400 |
|---|---|---|
| committer | Ade Lee <alee@redhat.com> | 2013-03-21 12:11:31 -0400 |
| commit | c9a081037aa5bf15cf6226f06ea54ea98deba5bc (patch) | |
| tree | ba095458c940b4db7923719ce6cf6e14a2c1da8e /base/deploy/src/scriptlets/configuration.jy | |
| parent | 22d50cc526c7fd4224a4d5a0ae9ebf66afd8e83a (diff) | |
| download | pki-c9a081037aa5bf15cf6226f06ea54ea98deba5bc.tar.gz pki-c9a081037aa5bf15cf6226f06ea54ea98deba5bc.tar.xz pki-c9a081037aa5bf15cf6226f06ea54ea98deba5bc.zip | |
Refactor installation code to remove dependency on jython
Connection is now made to the installation servlet through a python
client using JSON. The code to construct the ConfgurationRequest and
parse the results has been moved to pkihelper.py, and configuration.py
no longer calls a separate jython process to create the Configuration
object and parse the results. The jython code has therefore been removed.
Also added status servlet to other java subsystems, to be tested prior
to starting configuration.
Trac Ticket 532
Diffstat (limited to 'base/deploy/src/scriptlets/configuration.jy')
| -rw-r--r-- | base/deploy/src/scriptlets/configuration.jy | 111 |
1 files changed, 0 insertions, 111 deletions
diff --git a/base/deploy/src/scriptlets/configuration.jy b/base/deploy/src/scriptlets/configuration.jy deleted file mode 100644 index d6af9b1ca..000000000 --- a/base/deploy/src/scriptlets/configuration.jy +++ /dev/null @@ -1,111 +0,0 @@ -#!/usr/bin/jython - -# System Python Imports -import os -import pickle -import sys - - -# PKI Python Imports -import pkijython as jyutil -import pkiconfig as config -import pkimessages as log - - -# System Java Imports -from java.lang import System as javasystem - - -# PKI Java Imports -from com.netscape.certsrv.client import ClientConfig - - -def main(argv): - rv = 0 - - # Import the master dictionary from 'pkispawn' - master = pickle.loads(argv[1]) - sensitive_parameters = master['sensitive_parameters'].split() - - # Optionally enable a java debugger (e. g. - 'eclipse'): - if config.str2bool(master['pki_enable_java_debugger']): - config.wait_to_attach_an_external_java_debugger() - - - # IMPORTANT: Unfortunately, 'jython 2.2' does NOT support logging! - # - # Until, and unless, 'jython 2.5' or later is used, - # debugging will basically be limited to using 'print' - # since creating a logging mechanism for 'jython 2.2' - # would not make sense at this point in time, although - # a 'customized' manual log process could be created. - # - # Regardless of 'jython' version, the log file generated - # by this standalone 'jython' process would be unique and - # separate to the log file generated for the PKI - # deployment scriptlets 'python' process, as they exist - # as two separate processes (until and unless 'jython 2.7' - # could be used to completely replace 'python 2.7', - # in which case a single process could be executed - # end-to-end from installation through configuration). - # - if master['pki_jython_log_level'] >= config.PKI_JYTHON_DEBUG_LOG_LEVEL: - # javasystem.out.println("Hello") - print "%s %s" %\ - (log.PKI_JYTHON_INDENTATION_2, sys.path) - print "%s %s" %\ - (log.PKI_JYTHON_INDENTATION_2, - javasystem.getProperties()['java.class.path']) - for key in master: - if key in sensitive_parameters: - value = 'XXXXXXXX' - else: - value = master[key] - print "%s '%s' = '%s'" %\ - (log.PKI_JYTHON_INDENTATION_2, key, value) - - # Initialize token - jyutil.security_databases.initialize_token( - master['pki_client_database_dir'], - master['pki_jython_log_level']) - - # Log into token - token = jyutil.security_databases.log_into_token( - master['pki_client_database_dir'], - master['pki_client_password_conf'], - master['pki_jython_log_level']) - - # Setup connection parameters - client_config = ClientConfig() - client_config.setInstanceCreationMode(True) - client_config.setServerURI(master['pki_jython_base_uri']) - - # Establish REST Client - client = jyutil.rest_client.initialize( - client_config, - master) - - # Construct PKI Subsystem Configuration Data - data = None - if master['pki_instance_type'] == "Apache": - if master['pki_subsystem'] == "RA": - print "%s '%s' %s" %\ - (log.PKI_JYTHON_INDENTATION_2, - master['pki_subsystem'], - log.PKI_JYTHON_NOT_YET_IMPLEMENTED) - return rv - elif master['pki_subsystem'] == "TPS": - print "%s '%s' %s" %\ - (log.PKI_JYTHON_INDENTATION_2, - master['pki_subsystem'], - log.PKI_JYTHON_NOT_YET_IMPLEMENTED) - return rv - elif master['pki_instance_type'] == "Tomcat": - # PKI or Cloned CA, KRA, OCSP, or TKS, Subordinate CA, or External CA - data = jyutil.rest_client.construct_pki_configuration_data(token) - - # Formulate PKI Subsystem Configuration Data Response - jyutil.rest_client.configure_pki_data(data) - -if __name__ == "__main__": - main(sys.argv) |
