Correctly report available for ADFS plugin

The ADFS plugin doesn't correctly catch when lxml is not available. This
will fail when a user then tries to iterate all available plugins.

Closes-Bug: #1608169
Change-Id: Ie9d228751306e6df24b43a62392a8f903f82ab82
This commit is contained in:
Jamie Lennox 2016-07-30 23:52:21 -05:00
parent cbd2e4021e
commit 2e227b9952
5 changed files with 17 additions and 3 deletions

View File

@ -13,6 +13,7 @@
from keystoneauth1.extras._saml2 import v3
_V3_SAML2_AVAILABLE = v3._SAML2_AVAILABLE
_V3_ADFS_AVAILABLE = v3._ADFS_AVAILABLE
V3Saml2Password = v3.Saml2Password
V3ADFSPassword = v3.ADFSPassword

View File

@ -44,6 +44,10 @@ class ADFSPassword(loading.BaseFederationLoader):
def plugin_class(self):
return _saml2.V3ADFSPassword
@property
def available(self):
return _saml2._V3_ADFS_AVAILABLE
def get_options(self):
options = super(ADFSPassword, self).get_options()

View File

@ -11,9 +11,11 @@
# under the License.
from keystoneauth1.extras._saml2.v3 import adfs
from keystoneauth1.extras._saml2.v3 import base
from keystoneauth1.extras._saml2.v3 import saml2
_SAML2_AVAILABLE = saml2.etree is not None
_SAML2_AVAILABLE = base.etree is not None and saml2.etree is not None
_ADFS_AVAILABLE = base.etree is not None and adfs.etree is not None
Saml2Password = saml2.Password
ADFSPassword = adfs.Password

View File

@ -13,7 +13,11 @@
import datetime
import uuid
from lxml import etree
try:
from lxml import etree
except ImportError:
etree = None
from six.moves import urllib
from keystoneauth1 import access

View File

@ -10,7 +10,10 @@
# License for the specific language governing permissions and limitations
# under the License.
from lxml import etree
try:
from lxml import etree
except ImportError:
etree = None
from keystoneauth1 import exceptions
from keystoneauth1.identity import v3