summaryrefslogtreecommitdiffstats
path: root/ipapython/certmonger.py
diff options
context:
space:
mode:
authorPetr Viktorin <pviktori@redhat.com>2012-10-31 10:37:33 -0400
committerMartin Kosek <mkosek@redhat.com>2012-11-23 12:19:19 +0100
commitd1574136754ff7e2190b0cf9a99b211c1bfededa (patch)
tree0fe8fbd1d7c1158b8bf3ddde88479850e5aaa176 /ipapython/certmonger.py
parent1d3ddeff54d91111d7f4f3042a22af76275ef361 (diff)
downloadfreeipa-d1574136754ff7e2190b0cf9a99b211c1bfededa.tar.gz
freeipa-d1574136754ff7e2190b0cf9a99b211c1bfededa.tar.xz
freeipa-d1574136754ff7e2190b0cf9a99b211c1bfededa.zip
Use correct Dogtag configuration in get_pin and get_ca_certchain
Some install utilities used Dogtag configuration before Dogtag was configured. Fix by passing the relevant dogtag_constants where they're needed.
Diffstat (limited to 'ipapython/certmonger.py')
-rw-r--r--ipapython/certmonger.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/ipapython/certmonger.py b/ipapython/certmonger.py
index 22678dadb..f29050ea9 100644
--- a/ipapython/certmonger.py
+++ b/ipapython/certmonger.py
@@ -353,13 +353,15 @@ def remove_principal_from_cas():
fp.close()
# Routines specific to renewing dogtag CA certificates
-def get_pin(token):
+def get_pin(token, dogtag_constants=None):
"""
Dogtag stores its NSS pin in a file formatted as token:PIN.
The caller is expected to handle any exceptions raised.
"""
- with open(dogtag.configured_constants().PASSWORD_CONF_PATH, 'r') as f:
+ if dogtag_constants is None:
+ dogtag_constants = dogtag.configured_constants()
+ with open(dogtag_constants.PASSWORD_CONF_PATH, 'r') as f:
for line in f:
(tok, pin) = line.split('=', 1)
if token == tok: