diff options
author | Ade Lee <alee@redhat.com> | 2014-02-20 17:26:24 -0500 |
---|---|---|
committer | Ade Lee <alee@redhat.com> | 2014-02-26 01:17:29 -0500 |
commit | 0900a0a7e12064171d60345f448b983e91b56239 (patch) | |
tree | 33181ed8a6f1cf28353b1ceb81315f884c684e54 /base/common/python/pki/key.py | |
parent | 640584b8047126b7892e8c635063df4ea11c1faa (diff) | |
download | pki-0900a0a7e12064171d60345f448b983e91b56239.tar.gz pki-0900a0a7e12064171d60345f448b983e91b56239.tar.xz pki-0900a0a7e12064171d60345f448b983e91b56239.zip |
Add getActiveKey() to the python client
Diffstat (limited to 'base/common/python/pki/key.py')
-rw-r--r-- | base/common/python/pki/key.py | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/base/common/python/pki/key.py b/base/common/python/pki/key.py index 235825746..ab6db9625 100644 --- a/base/common/python/pki/key.py +++ b/base/common/python/pki/key.py @@ -27,6 +27,7 @@ import pki.encoder as encoder import json import pki import types +import urllib class KeyId(object): ''' @@ -466,6 +467,14 @@ class KeyClient(object): return KeyInfo.from_json(response.json()) @pki.handle_exceptions() + def get_active_key_info(self, client_id): + ''' Get the info in the KeyRecord for the active secret in the DRM. ''' + url = self.keyURL + '/active/' + urllib.quote_plus(client_id) + response = self.connection.get(url, headers=self.headers) + print response + return KeyInfo.from_json(response.json()) + + @pki.handle_exceptions() def modify_key_status(self, key_id, status): ''' Modify the status of a key ''' url = self.keyURL + '/' + key_id |