From aaebc76f590a31f6dc44efa98dba950985dc6dd2 Mon Sep 17 00:00:00 2001 From: Matthew Harmsen Date: Thu, 16 Aug 2012 20:09:20 -0700 Subject: PKI Deployment Scriptlets * TRAC Ticket #266 - for non-master CA subsystems, pkidestroy needs to contact the security domain to update the domain * Made Fedora 17 rely upon tomcatjss 7.0.0 or later * Changed Dogtag 10 build-time and runtime requirements for 'pki-deploy' * Altered PKI Package Dependency Chain (top-to-bottom): pki-ca, pki-kra, pki-ocsp, pki-tks --> pki-deploy --> pki-common * Changed TPS to require a build-time dependency of 'httpd-devel >= 2.4.2' * Clarified RPM build script's usage message --- base/deploy/src/scriptlets/pkiparser.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'base/deploy/src/scriptlets/pkiparser.py') diff --git a/base/deploy/src/scriptlets/pkiparser.py b/base/deploy/src/scriptlets/pkiparser.py index dd1f93bd3..1fe74e835 100644 --- a/base/deploy/src/scriptlets/pkiparser.py +++ b/base/deploy/src/scriptlets/pkiparser.py @@ -188,6 +188,32 @@ def process_command_line_arguments(argv): return +# The following code is based heavily upon +# "http://www.decalage.info/en/python/configparser" +COMMENT_CHAR = '#' +OPTION_CHAR = '=' + +def read_simple_configuration_file(filename): + values = {} + f = open(filename) + for line in f: + # First, remove comments: + if COMMENT_CHAR in line: + # split on comment char, keep only the part before + line, comment = line.split(COMMENT_CHAR, 1) + # Second, find lines with an name=value: + if OPTION_CHAR in line: + # split on name char: + name, value = line.split(OPTION_CHAR, 1) + # strip spaces: + name = name.strip() + value = value.strip() + # store in dictionary: + values[name] = value + f.close() + return values + + def read_pki_configuration_file(): "Read configuration file sections into dictionaries" rv = 0 -- cgit