summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdam Young <ayoung@redhat.com>2013-03-06 11:54:25 -0500
committerDolph Mathews <dolph.mathews@gmail.com>2013-03-07 09:02:08 -0600
commit38bf87bd52c25e23c866fcabaf2916d5d0ef5db9 (patch)
tree7c23bb8eae593e34fdf333fe83f8a4d5d4da0450
parent1f7c863a9ce3df695fbc98c3a53f0e6b4d172e4d (diff)
fix typo in kvs backend
Change-Id: I74134bae9abff847d317e0074cae1878cf76aae8
-rw-r--r--keystone/trust/backends/kvs.py19
1 files changed, 10 insertions, 9 deletions
diff --git a/keystone/trust/backends/kvs.py b/keystone/trust/backends/kvs.py
index ef528626..75be2b7a 100644
--- a/keystone/trust/backends/kvs.py
+++ b/keystone/trust/backends/kvs.py
@@ -27,6 +27,15 @@ from keystone import exception
from keystone import trust
+def _filter_trust(ref):
+ if ref['deleted']:
+ return None
+ if ref.get('expires_at') and timeutils.utcnow() > ref['expires_at']:
+ return None
+ ref = copy.deepcopy(ref)
+ return ref
+
+
class Trust(kvs.Base, trust.Driver):
def create_trust(self, trust_id, trust, roles):
trust_ref = trust
@@ -49,18 +58,10 @@ class Trust(kvs.Base, trust.Driver):
self.db.set('trustor-%s' % trustor_user_id, trustor_list)
return copy.deepcopy(trust_ref)
- def _filter_trust(selfself, ref):
- if ref['deleted']:
- return None
- if ref.get('expires_at') and timeutils.utcnow() > ref['expires_at']:
- return None
- ref = copy.deepcopy(ref)
- return ref
-
def get_trust(self, trust_id):
try:
ref = self.db.get('trust-%s' % trust_id)
- return self._filter_trust(ref)
+ return _filter_trust(ref)
except exception.NotFound:
return None