summaryrefslogtreecommitdiffstats
path: root/base/deploy/src/pkispawn
diff options
context:
space:
mode:
authorMatthew Harmsen <mharmsen@redhat.com>2012-05-04 20:29:35 -0700
committerMatthew Harmsen <mharmsen@redhat.com>2012-05-07 11:28:10 -0700
commit391d345b5a6a1a905e3db4105a65dd4fdd0d19a9 (patch)
treecf73a152055f6bbc217c42bf8a8f0396ab3fd3dd /base/deploy/src/pkispawn
parent9ad4d60592fdc37ae89672c29859b8463e183718 (diff)
downloadpki-391d345b5a6a1a905e3db4105a65dd4fdd0d19a9.tar.gz
pki-391d345b5a6a1a905e3db4105a65dd4fdd0d19a9.tar.xz
pki-391d345b5a6a1a905e3db4105a65dd4fdd0d19a9.zip
PKI Deployment Scriptlets
* Re-aligned code to account for revised layout documented at http://pki.fedoraproject.org/wiki/PKI_Instance_Deployment * Massaged logic to comply with PKI subsystem running within a shared instance * Developed code to take advantage of a single shared NSS security database model * Completed the following two 'scriptlets': * Dogtag 10: Python 'slot_assignment.py' Installation Scriptlet (https://fedorahosted.org/pki/ticket/146) * Dogtag 10: Python 'security_databases.py' Installation Scriptlet (https://fedorahosted.org/pki/ticket/136) * Created several additional PKI deployment helper utilities.
Diffstat (limited to 'base/deploy/src/pkispawn')
-rwxr-xr-xbase/deploy/src/pkispawn32
1 files changed, 31 insertions, 1 deletions
diff --git a/base/deploy/src/pkispawn b/base/deploy/src/pkispawn
index 2ac21a60a..c537b8e4d 100755
--- a/base/deploy/src/pkispawn
+++ b/base/deploy/src/pkispawn
@@ -30,6 +30,10 @@ try:
import logging
import os
import pprint
+ import random
+ import socket
+ import string
+ import time
from time import strftime as date
from pki.deployment import pkiconfig as config
from pki.deployment import pkiparser as parse
@@ -56,8 +60,27 @@ def main(argv):
# Set the umask
os.umask(config.PKI_DEPLOYMENT_DEFAULT_UMASK)
+ # Set installation time
+ ticks = time.time()
+ config.pki_install_time = time.asctime(time.localtime(ticks))
+
# Generate a timestamp
- config.pki_timestamp = date('%Y%m%d%H%M%S')
+ config.pki_timestamp = date('%Y%m%d%H%M%S', time.localtime(ticks))
+ config.pki_certificate_timestamp =\
+ date('%Y-%m-%d %H:%M:%S', time.localtime(ticks))
+
+ # Retrieve hostname
+ config.pki_hostname = socket.gethostname()
+
+ # Generate a random 'pin' for use as the security database password
+ pin_low = 100000000000
+ pin_high = 999999999999
+ config.pki_pin = random.randint(pin_low, pin_high)
+
+ # Generate a one-time pin to be used prior to configuration
+ config.pki_one_time_pin =\
+ ''.join(random.choice(string.ascii_letters + string.digits)\
+ for x in range(20))
# Initialize 'pretty print' for objects
pp = pprint.PrettyPrinter(indent=4)
@@ -151,6 +174,13 @@ def main(argv):
config.pki_log.debug(pp.pformat(config.pki_subsystem_dict),
extra=config.PKI_INDENTATION_LEVEL_0)
+ # Read in the PKI slots configuration file.
+ parse.compose_pki_slots_dictionary()
+ config.pki_log.debug(log.PKI_DICTIONARY_SLOTS,
+ extra=config.PKI_INDENTATION_LEVEL_0)
+ config.pki_log.debug(pp.pformat(config.pki_slots_dict),
+ extra=config.PKI_INDENTATION_LEVEL_0)
+
# Combine the various sectional dictionaries into a PKI master dictionary
parse.compose_pki_master_dictionary()
if not config.pki_update_flag: