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.
This commit is contained in:
Petr Viktorin authored and Martin Kosek committed 2012-11-23 12:19:19 +01:00
1 parent 1d3ddeff54
commit d157413675
3 files changed
+20 -16

No files matched your search

+4 -2
View File
@@ -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: