Fix xmldsig import

After commit https://goo.gl/TjLQFz to pysaml2, xmldsig was moved
under saml2, no longer being at the top level. Craeting a
conditional import, so it can work now and when the pysaml2
commit is included in a new release.

Change-Id: If01a93a18cef6159adad50496e6335e88f86024d
This commit is contained in:
Javier Pena 2015-05-20 11:32:18 +02:00
parent d7798a2e8a
commit c90dd3a0f8
2 changed files with 8 additions and 2 deletions

View File

@ -17,6 +17,7 @@ import uuid
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from oslo_utils import importutils
from oslo_utils import timeutils from oslo_utils import timeutils
import saml2 import saml2
from saml2 import client_base from saml2 import client_base
@ -26,7 +27,9 @@ from saml2 import saml
from saml2 import samlp from saml2 import samlp
from saml2.schema import soapenv from saml2.schema import soapenv
from saml2 import sigver from saml2 import sigver
import xmldsig xmldsig = importutils.try_import("saml2.xmldsig")
if not xmldsig:
xmldsig = importutils.try_import("xmldsig")
from keystone import exception from keystone import exception
from keystone.i18n import _, _LE from keystone.i18n import _, _LE

View File

@ -21,12 +21,15 @@ import mock
from oslo_config import cfg from oslo_config import cfg
from oslo_log import log from oslo_log import log
from oslo_serialization import jsonutils from oslo_serialization import jsonutils
from oslo_utils import importutils
from oslotest import mockpatch from oslotest import mockpatch
import saml2 import saml2
from saml2 import saml from saml2 import saml
from saml2 import sigver from saml2 import sigver
from six.moves import range, urllib, zip from six.moves import range, urllib, zip
import xmldsig xmldsig = importutils.try_import("saml2.xmldsig")
if not xmldsig:
xmldsig = importutils.try_import("xmldsig")
from keystone.auth import controllers as auth_controllers from keystone.auth import controllers as auth_controllers
from keystone.auth.plugins import mapped from keystone.auth.plugins import mapped