summaryrefslogtreecommitdiff
path: root/keystoneclient/fixture
diff options
context:
space:
mode:
authorJamie Lennox <jamielennox@redhat.com>2015-03-24 21:29:36 +1100
committerJamie Lennox <jamielennox@redhat.com>2015-03-24 21:31:27 +1100
commit161c869c6c29800ee0ba9c2b81564cdc5e9664a2 (patch)
tree737c1d51bd228fb51319a8c195e21f833be9b4b2 /keystoneclient/fixture
parent26230c5a7ebbbd84ed3d5bccf475070219f5a0a4 (diff)
downloadpython-keystoneclient-161c869c6c29800ee0ba9c2b81564cdc5e9664a2.tar.gz
Return None for missing trust_id in fixture
If the trust_id is unset it raises a KeyError. This is unusual from a python perspective (if nothing else it should be AttributeError) and different to all the other attributes of the fixture. Return None if no trust_id is set on the fixture. Change-Id: I15d33d77027a188fa47df18387c4610908f8e2d2
Diffstat (limited to 'keystoneclient/fixture')
-rw-r--r--keystoneclient/fixture/v2.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/keystoneclient/fixture/v2.py b/keystoneclient/fixture/v2.py
index cd4207b..81bc70e 100644
--- a/keystoneclient/fixture/v2.py
+++ b/keystoneclient/fixture/v2.py
@@ -166,7 +166,7 @@ class Token(dict):
@property
def trust_id(self):
- return self.root.setdefault('trust', {})['id']
+ return self.root.setdefault('trust', {}).get('id')
@trust_id.setter
def trust_id(self, value):