Importing from trove-client compat first

- Switched the logic so that the compat version is imported first

Fixes bug #1250237

Change-Id: I7650fc6c3ce93164ca8bee610d5fe2293df3ecc7
This commit is contained in:
Steve Leon 2013-11-14 15:44:18 -08:00
parent e543879af6
commit 0f9617cb55
6 changed files with 16 additions and 16 deletions

View File

@ -17,13 +17,13 @@
from django.conf import settings # noqa
try:
from troveclient import auth
from troveclient import client
from troveclient.compat import auth
from troveclient.compat import client
with_trove = True
except ImportError:
try:
from troveclient.compat import auth
from troveclient.compat import client
from troveclient import auth
from troveclient import client
with_trove = True
except ImportError:
with_trove = False

View File

@ -25,10 +25,10 @@ from openstack_dashboard.test import helpers as test
if api.trove.with_trove:
try:
from troveclient import common
from troveclient.compat import common
except ImportError:
try:
from troveclient.compat import common
from troveclient import common
except ImportError:
pass

View File

@ -26,11 +26,11 @@ from neutronclient.common import exceptions as neutronclient
from novaclient import exceptions as novaclient
from swiftclient import client as swiftclient
try:
from troveclient import exceptions as troveclient
from troveclient.compat import exceptions as troveclient
with_trove = True
except ImportError:
try:
from troveclient.compat import exceptions as troveclient
from troveclient import exceptions as troveclient
with_trove = True
except ImportError:
with_trove = False

View File

@ -39,11 +39,11 @@ from neutronclient.v2_0 import client as neutron_client
from novaclient.v1_1 import client as nova_client
from swiftclient import client as swift_client
try:
from troveclient import client as trove_client
from troveclient.compat import client as trove_client
with_trove = True
except ImportError:
try:
from troveclient.compat import client as trove_client
from troveclient import client as trove_client
with_trove = True
except ImportError:
with_trove = False

View File

@ -20,11 +20,11 @@ from neutronclient.common import exceptions as neutron_exceptions
from novaclient import exceptions as nova_exceptions
from swiftclient import client as swift_exceptions
try:
from troveclient import exceptions as trove_exceptions
from troveclient.compat import exceptions as trove_exceptions
with_trove = True
except ImportError:
try:
from troveclient.compat import exceptions as trove_exceptions
from troveclient import exceptions as trove_exceptions
with_trove = True
except ImportError:
with_trove = False

View File

@ -15,13 +15,13 @@
# under the License.
try:
from troveclient import backups
from troveclient import instances
from troveclient.v1 import backups
from troveclient.v1 import instances
with_trove = True
except ImportError:
try:
from troveclient.v1 import backups
from troveclient.v1 import instances
from troveclient import backups
from troveclient import instances
with_trove = True
except ImportError:
with_trove = False