From 391d345b5a6a1a905e3db4105a65dd4fdd0d19a9 Mon Sep 17 00:00:00 2001 From: Matthew Harmsen Date: Fri, 4 May 2012 20:29:35 -0700 Subject: 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. --- base/deploy/src/pkidestroy | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) (limited to 'base/deploy/src/pkidestroy') diff --git a/base/deploy/src/pkidestroy b/base/deploy/src/pkidestroy index 6d0afd2b0..c54ba9a78 100755 --- a/base/deploy/src/pkidestroy +++ b/base/deploy/src/pkidestroy @@ -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) -- cgit