You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In a circular twist of missing keys, the attempt to raise an exception for missing relation data results in a key error while trying to log details into the exception message.
DEBUG:runner:Traceback (most recent call last):
DEBUG:runner: File "/tmp/bundletester-7ZZqdN/keystone/tests/gate-basic-trusty-kilo", line 24, in <module>
DEBUG:runner: source='cloud:trusty-updates/kilo')
DEBUG:runner: File "/tmp/bundletester-7ZZqdN/keystone/tests/basic_deployment.py", line 66, in __init__
DEBUG:runner: self._initialize_test_differences()
DEBUG:runner: File "/tmp/bundletester-7ZZqdN/keystone/tests/basic_deployment.py", line 331, in _initialize_test_differences
DEBUG:runner: self.set_api_version(2)
DEBUG:runner: File "/tmp/bundletester-7ZZqdN/keystone/tests/basic_deployment.py", line 197, in set_api_version
DEBUG:runner: u.keystone_configure_api_version(se_rels, self, api_version)
DEBUG:runner: File "/tmp/bundletester-7ZZqdN/keystone/tests/charmhelpers/contrib/openstack/amulet/utils.py", line 351, in keystone_configure_api_version
DEBUG:runner: self.keystone_wait_for_propagation(sentry_relation_pairs, api_version)
DEBUG:runner: File "/tmp/bundletester-7ZZqdN/keystone/tests/charmhelpers/contrib/openstack/amulet/utils.py", line 331, in keystone_wait_for_propagation
DEBUG:runner: "".format(rel['api_version'], api_version))
DEBUG:runner:KeyError: 'api_version'
DEBUG:runner:Exit Code: 1
def keystone_wait_for_propagation(self, sentry_relation_pairs,
api_version):
"""Iterate over list of sentry and relation tuples and verify that
api_version has the expected value.
:param sentry_relation_pairs: list of sentry, relation name tuples used
for monitoring propagation of relation
data
:param api_version: api_version to expect in relation data
:returns: None if successful. Raise on error.
"""
for (sentry, relation_name) in sentry_relation_pairs:
rel = sentry.relation('identity-service',
relation_name)
self.log.debug('keystone relation data: {}'.format(rel))
if rel.get('api_version') != str(api_version):
raise Exception("api_version not propagated through relation"
" data yet ('{}' != '{}')."
"".format(rel['api_version'], api_version))
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.
Fixesjuju#143
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#143
In a circular twist of missing keys, the attempt to raise an exception for missing relation data results in a key error while trying to log details into the exception message.
https://openstack-ci-reports.ubuntu.com/artifacts/test_charm_pipeline_amulet_full/openstack/charm-keystone/557680/5/1317/consoleText.test_charm_amulet_full_2504.txt
https://openstack-ci-reports.ubuntu.com/artifacts/test_charm_pipeline_amulet_full/openstack/charm-keystone/557680/3/1316/consoleText.test_charm_amulet_full_2503.txt
The text was updated successfully, but these errors were encountered: