c6b0d8ff5a
If the report client is able to access keystone to get a service catalog, but that catalog does not include a placement service (because it hasn't been added to the catalog yet), creating resource providers and other placement entities will fail. This is expected. What's not expected is that creating entities will continue to fail for quite some time, even if placement is added to the catalog. This is because the keystone session caches the service catalog for some amount of time. Therefore we need to create a new client session when EndpointNotFound happens. This has been added in this change by extracting creation of the report client's _client to its own method that we can call from the exception handler. The resource provider and aggregate maps are wiped at this time, to make sure we are starting from a clean slate. While this isn't likely to cause a problem in real life scenarios, in the manual testing I was doing it created issues. I've made the _client method synchronized so that in the unlikely event that the resource tracker is trying to do its update job while some other thing is happening, we won't waste the client. This may not be necessary, but probably doesn't harm anything. Change-Id: I02ac615dc26a4a0d1fd28a638f622777e41d14e4 Co-Authored-By: zhangzhenzhong <zzzhang0118@gmail.com> Closes-Bug: #1697825 |
||
---|---|---|
.. | ||
__init__.py | ||
test_query.py | ||
test_report.py |