summaryrefslogtreecommitdiffstats
path: root/base/deploy/src/scriptlets/pkiparser.py
diff options
context:
space:
mode:
authorMatthew Harmsen <mharmsen@redhat.com>2012-08-16 20:09:20 -0700
committerMatthew Harmsen <mharmsen@redhat.com>2012-08-17 15:07:19 -0700
commitaaebc76f590a31f6dc44efa98dba950985dc6dd2 (patch)
tree4c9c653cec8f5841b9c0c56be322762e2744aed1 /base/deploy/src/scriptlets/pkiparser.py
parent6028b01f64305eda7540cf96bde658d4ebbec2ed (diff)
downloadpki-aaebc76f590a31f6dc44efa98dba950985dc6dd2.tar.gz
pki-aaebc76f590a31f6dc44efa98dba950985dc6dd2.tar.xz
pki-aaebc76f590a31f6dc44efa98dba950985dc6dd2.zip
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
Diffstat (limited to 'base/deploy/src/scriptlets/pkiparser.py')
-rw-r--r--base/deploy/src/scriptlets/pkiparser.py26
1 files changed, 26 insertions, 0 deletions
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