From 4df86dcdcb5a3d87ba7b9237faa79ad599c9999e Mon Sep 17 00:00:00 2001 From: Arash Ghoreyshi Date: Fri, 16 Aug 2013 14:22:42 -0500 Subject: [PATCH] Change the lookup method for Secret dict fields --- barbicanclient/secrets.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/barbicanclient/secrets.py b/barbicanclient/secrets.py index f2679e6a..0b9e27f4 100644 --- a/barbicanclient/secrets.py +++ b/barbicanclient/secrets.py @@ -14,16 +14,16 @@ class Secret(object): connection object for subtasks. """ self.connection = connection - self.secret_ref = secret_dict['secret_ref'] - self.created = parse_isotime(secret_dict['created']) + self.secret_ref = secret_dict.get('secret_ref') + self.created = parse_isotime(secret_dict.get('created')) self.status = secret_dict.get('status') - self.algorithm = secret_dict['algorithm'] - self.bit_length = secret_dict['bit_length'] + self.algorithm = secret_dict.get('algorithm') + self.bit_length = secret_dict.get('bit_length') self.payload_content_type = secret_dict.get('payload_content_type') self.payload_content_encoding = secret_dict.get('payload_content_encoding') - self.cypher_type = secret_dict['cypher_type'] + self.cypher_type = secret_dict.get('cypher_type') self.name = secret_dict.get('name') if secret_dict.get('expiration') is not None: