Lazy load oauthlib for plugin loading
If oauthlib is not available the oauth plugins should not be marked as available when iterating plugins. Change-Id: Idabb7adf61dc5ca36fc1524af47e346f8f296245
This commit is contained in:
parent
88d4fdb14a
commit
6306504c58
@ -22,6 +22,10 @@ class V3OAuth1(loading.BaseIdentityLoader):
|
||||
def plugin_class(self):
|
||||
return v3.OAuth1
|
||||
|
||||
@property
|
||||
def available(self):
|
||||
return v3.oauth1 is not None
|
||||
|
||||
def get_options(self):
|
||||
options = super(V3OAuth1, self).get_options()
|
||||
|
||||
|
@ -23,7 +23,10 @@
|
||||
|
||||
import logging
|
||||
|
||||
try:
|
||||
from oauthlib import oauth1
|
||||
except ImportError:
|
||||
oauth1 = None
|
||||
|
||||
from keystoneauth1.identity import v3
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user