[StableOnly] Reset eventlet hub after patching

Patching the eventlet hub by setting the environment variable will not be
effective if hub singleton was already set by some imported module.
Calling `use_hub()` will reset it's value based on the current overrides.

Change-Id: Ida6756b50266b4b2b2545f82e03e83e1c3be1e9e
Closes-Bug: #1897877
This commit is contained in:
Jacek Tomasiak 2020-09-30 11:26:11 +02:00 committed by Stephen Finucane
parent 615cfad757
commit 7f75fc1d4e
1 changed files with 2 additions and 0 deletions

View File

@ -31,3 +31,5 @@ def service_hub():
os.environ['EVENTLET_HUB'] = 'oslo_service:service_hub'
# reset hub in case it was initialized already by some imported module
eventlet.hubs.use_hub(os.environ['EVENTLET_HUB'])