diff options
author | Tim Burke <tim.burke@gmail.com> | 2018-09-07 16:50:10 -0700 |
---|---|---|
committer | Tim Burke <tim.burke@gmail.com> | 2018-09-07 16:56:13 -0700 |
commit | d1e1f8d8d6a8890c71eea8a3c2a488af30a8147b (patch) | |
tree | 775a30177e366da236d3e9401800b5372fcc9953 /tests/unit/utils.py | |
parent | 4330d036cd40299c3fd12d68d319e20757ccadcf (diff) | |
download | python-swiftclient-d1e1f8d8d6a8890c71eea8a3c2a488af30a8147b.tar.gz |
Stop lazy importing keystoneclient
There were two basic problems:
- We'd try to import on every attempt at getting auth, even when we
already know keystoneclient isn't available.
- Sometimes devs would hit some crazy import race involving (some
combination of?) greenthreads and OS threads.
So let's just try the imports *once*, at import time, and have None
sentinels if it fails. Try both versions separately to decouple
failures; this should let us support a wider range of keystoneclient
versions.
Change-Id: I2367310aac74f1b7c5ea0cb1a822a491e4ba8e68
Diffstat (limited to 'tests/unit/utils.py')
-rw-r--r-- | tests/unit/utils.py | 8 |
1 files changed, 0 insertions, 8 deletions
diff --git a/tests/unit/utils.py b/tests/unit/utils.py index 2def73f..aab3b59 100644 --- a/tests/unit/utils.py +++ b/tests/unit/utils.py @@ -542,14 +542,6 @@ class FakeKeystone(object): pass -def _make_fake_import_keystone_client(fake_import): - def _fake_import_keystone_client(auth_version): - fake_import.auth_version = auth_version - return fake_import, fake_import - - return _fake_import_keystone_client - - class FakeStream(object): def __init__(self, size): self.bytes_read = 0 |