summaryrefslogtreecommitdiffstats
path: root/base/deploy/src/pkidestroy
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/pkidestroy
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/pkidestroy')
-rwxr-xr-xbase/deploy/src/pkidestroy25
1 files changed, 24 insertions, 1 deletions
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)