diff options
author | 2015-09-10 09:41:16 +0200 | |
---|---|---|
committer | 2015-09-10 09:41:16 +0200 | |
commit | 8d61f68ee3e9449a7c8ce85780e679a9f5312861 (patch) | |
tree | c44915339cb12ecf2cf11090099549e59288f7fb | |
parent | 312b1702ee332a2b8d71d88f849b55d8242fe45b (diff) |
get_aggregation_algorithm_dict now return an empty dictionnary if algorithm is not found.
Change-Id: I53d821ea88958e53ba72467f44251fabcc1ae55e
-rw-r--r-- | keystone-moon/keystone/contrib/moon/backends/sql.py | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/keystone-moon/keystone/contrib/moon/backends/sql.py b/keystone-moon/keystone/contrib/moon/backends/sql.py index 7cbbd4c0..f08038a2 100644 --- a/keystone-moon/keystone/contrib/moon/backends/sql.py +++ b/keystone-moon/keystone/contrib/moon/backends/sql.py @@ -892,7 +892,10 @@ class IntraExtensionConnector(IntraExtensionDriver): query = session.query(AggregationAlgorithm) query = query.filter_by(intra_extension_id=intra_extension_id) ref = query.first() - return {ref.id: ref.aggregation_algorithm} + try: + return {ref.id: ref.aggregation_algorithm} + except AttributeError: + return {} def set_aggregation_algorithm_dict(self, intra_extension_id, aggregation_algorithm_id, aggregation_algorithm_dict): with sql.transaction() as session: |