diff options
author | Matthew Harmsen <mharmsen@redhat.com> | 2012-05-18 10:52:06 -0700 |
---|---|---|
committer | Matthew Harmsen <mharmsen@redhat.com> | 2012-05-18 11:06:37 -0700 |
commit | 924403a14e92112c3c3d696319759b65eb57a30c (patch) | |
tree | ae097f21c022bd21b4c8b655a0030a8bef3953a3 /base/deploy/src/scriptlets/configuration.jy | |
parent | 488480629da8cd7c7263fab9773ef5860ad12947 (diff) | |
download | pki-924403a14e92112c3c3d696319759b65eb57a30c.tar.gz pki-924403a14e92112c3c3d696319759b65eb57a30c.tar.xz pki-924403a14e92112c3c3d696319759b65eb57a30c.zip |
PKI Deployment Scriptlets
* Introduced concept of "admin-domain" originally as a
separate folder, and later incorporated this concept
into an optional instance prefix
* Revised definition of <pki_instance_id> to be identified
as "[<pki_admin_domain_name>-]<pki_instance_name>
* Changed NSS security database model from one shared
database by BOTH a single Tomcat AND single Apache instance
into one per Tomcat instance (shared by CA/KRA/OCSP/TKS) and
one per Apache instance (shared by RA/TPS)
* Altered Configuration 'scriptlet' to invoke Jython for
access to new Java configuration servlet
* Renamed various "scriptlets" to comply with this new layout
* Re-aligned code to account for revised layout documented at
http://pki.fedoraproject.org/wiki/PKI_Instance_Deployment
Diffstat (limited to 'base/deploy/src/scriptlets/configuration.jy')
-rw-r--r-- | base/deploy/src/scriptlets/configuration.jy | 70 |
1 files changed, 70 insertions, 0 deletions
diff --git a/base/deploy/src/scriptlets/configuration.jy b/base/deploy/src/scriptlets/configuration.jy new file mode 100644 index 000000000..f7366c723 --- /dev/null +++ b/base/deploy/src/scriptlets/configuration.jy @@ -0,0 +1,70 @@ +#!/usr/bin/jython + +# System Python Imports +import os +import pickle +import sys + + +# PKI Python Imports +import pkijython as jyutil +import pkiconfig as config +from pkiconfig import pki_master_jython_dict as master +import pkimessages as log + + +# System Java Imports +from java.lang import System as javasystem + + +def main(argv): + # Establish 'master' as the PKI jython dictionary + master = dict() + + # import the master dictionary from 'pkispawn' + master = pickle.loads(argv[1]) + + # 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: + print "%s '%s' = '%s'" %\ + (log.PKI_JYTHON_INDENTATION_2, key, master[key]) + + # Initialize token + jyutil.security_databases.initialize_token( + master['pki_client_database_path'], + master['pki_dry_run_flag'], + master['pki_jython_log_level']) + + # Log into token + jyutil.security_databases.log_into_token( + master['pki_client_database_path'], + master['pki_client_password_conf'], + master['pki_dry_run_flag'], + master['pki_jython_log_level']) + + +if __name__ == "__main__": + main(sys.argv) |