diff options
author | Ruan HE <ruan.he@orange.com> | 2015-09-10 07:46:59 +0000 |
---|---|---|
committer | Gerrit Code Review <gerrit@172.30.200.206> | 2015-09-10 07:46:59 +0000 |
commit | 575cbfef10cf202a099717a3d6c93a68be54fcbb (patch) | |
tree | b9d8ebed1b575c5a277c81e6c3f390130b501794 /keystone-moon/keystone/contrib | |
parent | 62bfb49d6936c534735a727f7f4cdeaa1ad4b460 (diff) | |
parent | 8d61f68ee3e9449a7c8ce85780e679a9f5312861 (diff) |
Merge "get_aggregation_algorithm_dict now return an empty dictionnary if algorithm is not found."
Diffstat (limited to 'keystone-moon/keystone/contrib')
-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: |