The following error is disguised by "self.stubs" getting assigned in 3 different places in the test class setup for TestRegistryV1Client.
This error would only manifest if the original self.stubs in glance.tests.utils.BaseTestCase got GC'd and the __del__ method in stubout.StubOutForTesting unset all the stubs, including the one that enabled _FATAL_EXCEPTION_FORMAT_ERRORS. Without _FATAL_EXCEPTION_FORMAT_ERRORS == True, the message formatting error in the exception got silently swallowed.
======================================================================
ERROR: glance.tests.unit.v1.test_registry_client.TestRegistryV1Client.test_get_image_members_not_existing
----------------------------------------------------------------------
_StringException: Traceback (most recent call last):
File "/home/bde/glance/glance/tests/unit/v1/test_registry_client.py", line 1165, in test_get_image_members_not_existing
_gen_uuid())
File "/home/bde/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 394, in assertRaises
self.assertThat(our_callable, matcher)
File "/home/bde/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 406, in assertThat
mismatch = matcher.match(matchee)
File "/home/bde/glance/.venv/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 99, in match
mismatch = self.exception_matcher.match(exc_info)
File "/home/bde/glance/.venv/local/lib/python2.7/site-packages/testtools/matchers/_higherorder.py", line 61, in match
mismatch = matcher.match(matchee)
File "/home/bde/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 386, in match
reraise(*matchee)
File "/home/bde/glance/.venv/local/lib/python2.7/site-packages/testtools/matchers/_exception.py", line 92, in match
result = matchee()
File "/home/bde/glance/.venv/local/lib/python2.7/site-packages/testtools/testcase.py", line 867, in __call__
return self._callable_object(*self._args, **self._kwargs)
File "/home/bde/glance/glance/registry/client/v1/client.py", line 186, in get_image_members
res = self.do_request("GET", "/images/%s/members" % image_id)
File "/home/bde/glance/glance/registry/client/v1/client.py", line 93, in do_request
**kwargs)
File "/home/bde/glance/glance/common/client.py", line 64, in wrapped
return func(self, *args, **kwargs)
File "/home/bde/glance/glance/common/client.py", line 383, in do_request
headers=copy.deepcopy(headers))
File "/home/bde/glance/glance/common/client.py", line 81, in wrapped
return func(self, method, url, body, headers)
File "/home/bde/glance/glance/common/client.py", line 528, in _do_request
raise exception.NotFound(res.read())
File "/home/bde/glance/glance/common/exception.py", line 45, in __init__
message = message % kwargs
KeyError: 'id'
Fix proposed to branch: master /review. openstack. org/38696
Review: https:/