Merge lp:~hopem/charms/precise/keystone/stable-fix-legacy-import-error into lp:~openstack-charmers-archive/charms/precise/keystone/trunk

Proposed by Edward Hope-Morley
Status: Merged
Merge reported by: Edward Hope-Morley
Merged at revision: not available
Proposed branch: lp:~hopem/charms/precise/keystone/stable-fix-legacy-import-error
Merge into: lp:~openstack-charmers-archive/charms/precise/keystone/trunk
Diff against target: 17 lines (+6/-1)
1 file modified
hooks/keystone_utils.py (+6/-1)
To merge this branch: bzr merge lp:~hopem/charms/precise/keystone/stable-fix-legacy-import-error
Reviewer Review Type Date Requested Status
Liam Young (community) Approve
Review via email: mp+250317@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Liam Young (gnuoy) wrote :

Approve

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'hooks/keystone_utils.py'
2--- hooks/keystone_utils.py 2015-02-06 12:29:53 +0000
3+++ hooks/keystone_utils.py 2015-02-19 14:41:16 +0000
4@@ -560,7 +560,12 @@
5 # Allow retry on fail since leader may not be ready yet.
6 # NOTE(hopem): ks client may not be installed at module import time so we
7 # use this wrapped approach instead.
8- from keystoneclient.apiclient.exceptions import InternalServerError
9+ try:
10+ from keystoneclient.apiclient.exceptions import InternalServerError
11+ except:
12+ # Backwards-compatibility for earlier versions of keystoneclient (< I)
13+ from keystoneclient.exceptions import (ClientException as
14+ InternalServerError)
15
16 @retry_on_exception(3, base_delay=3, exc_type=InternalServerError)
17 def _ensure_initial_admin(config):

Subscribers

People subscribed via source and target branches