diff options
author | Simo Sorce <simo@redhat.com> | 2015-08-07 11:44:59 -0400 |
---|---|---|
committer | Jan Cholasta <jcholast@redhat.com> | 2015-10-15 14:24:33 +0200 |
commit | 86240938b58cd9bf85a96d34c39b55f6d59a36b8 (patch) | |
tree | c6eb2343cd05eb73d4979816f6d38716aedf18ed /ipapython/secrets/client.py | |
parent | 5761f73e2598dc404a3b51c6810e3dd250d2ba11 (diff) | |
download | freeipa-86240938b58cd9bf85a96d34c39b55f6d59a36b8.tar.gz freeipa-86240938b58cd9bf85a96d34c39b55f6d59a36b8.tar.xz freeipa-86240938b58cd9bf85a96d34c39b55f6d59a36b8.zip |
Add function to extract CA certs for install
Signed-off-by: Simo Sorce <simo@redhat.com>
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
Diffstat (limited to 'ipapython/secrets/client.py')
-rw-r--r-- | ipapython/secrets/client.py | 8 |
1 files changed, 6 insertions, 2 deletions
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 |