Merge "Lazy load oauthlib for plugin loading"

This commit is contained in:
Jenkins 2016-07-22 22:24:36 +00:00 committed by Gerrit Code Review
commit 86e010cc83
2 changed files with 8 additions and 1 deletions

View File

@ -22,6 +22,10 @@ class V3OAuth1(loading.BaseIdentityLoader):
def plugin_class(self): def plugin_class(self):
return v3.OAuth1 return v3.OAuth1
@property
def available(self):
return v3.oauth1 is not None
def get_options(self): def get_options(self):
options = super(V3OAuth1, self).get_options() options = super(V3OAuth1, self).get_options()

View File

@ -23,7 +23,10 @@
import logging import logging
from oauthlib import oauth1 try:
from oauthlib import oauth1
except ImportError:
oauth1 = None
from keystoneauth1.identity import v3 from keystoneauth1.identity import v3