Skip to content

Commit

Permalink
Fix keystone_wait_for_propagation test helper (juju#144)
Browse files Browse the repository at this point in the history
keystone_wait_for_propagation had a key error when raising
a custom exception message because it was trying to use a
dict key which may not always exist.

Use dict.get instead of dict explicit key reference, as
dict.get returns None when the key does not exist.

Fixes juju#143
  • Loading branch information
ryan-beisner authored and wolsen committed Apr 2, 2018
1 parent 6a16d5f commit 1117ba6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion charmhelpers/contrib/openstack/amulet/utils.py
Expand Up @@ -441,7 +441,7 @@ def keystone_wait_for_propagation(self, sentry_relation_pairs,
if rel.get('api_version') != str(api_version):
raise Exception("api_version not propagated through relation"
" data yet ('{}' != '{}')."
"".format(rel['api_version'], api_version))
"".format(rel.get('api_version'), api_version))

def keystone_configure_api_version(self, sentry_relation_pairs, deployment,
api_version):
Expand Down

0 comments on commit 1117ba6

Please sign in to comment.