From 86240938b58cd9bf85a96d34c39b55f6d59a36b8 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Fri, 7 Aug 2015 11:44:59 -0400 Subject: Add function to extract CA certs for install Signed-off-by: Simo Sorce Reviewed-By: Jan Cholasta --- ipapython/secrets/client.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'ipapython') diff --git a/ipapython/secrets/client.py b/ipapython/secrets/client.py index 81d066f84..5b671988d 100644 --- a/ipapython/secrets/client.py +++ b/ipapython/secrets/client.py @@ -74,7 +74,7 @@ class CustodiaClient(object): authtok = ctx.step() return {'Authorization': 'Negotiate %s' % b64encode(authtok)} - def fetch_key(self, keyname): + def fetch_key(self, keyname, store=True): # Prepare URL url = 'https://%s/ipa/keys/%s' % (self.server, keyname) @@ -96,4 +96,8 @@ class CustodiaClient(object): raise RuntimeError('Invlid JSON response type') value = self.kemcli.parse_reply(keyname, reply['value']) - self.keystore.set('keys/%s' % keyname, value) + + if store: + self.keystore.set('keys/%s' % keyname, value) + else: + return value -- cgit