summaryrefslogtreecommitdiff
path: root/openstack_dashboard/exceptions.py
diff options
context:
space:
mode:
authorRobert Myers <robert.myers@rackspace.com>2013-10-17 08:50:32 -0500
committerSteve Leon <steve.leon@hp.com>2013-11-25 08:25:32 -0800
commit8bca2eb3633cc95d1bb22025ef5e89696c641c40 (patch)
treef1c99452f76a724241baaeaefd3950d0aed407a9 /openstack_dashboard/exceptions.py
parentdfbafa51cc9bd7790e3a3140cfbe9976cebfe407 (diff)
downloadhorizon-8bca2eb3633cc95d1bb22025ef5e89696c641c40.tar.gz
Update troveclient to 1.0.0
Closes-Bug: #1238121 Author: Robert Myers <robert.myers@rackspace.com> Change-Id: I03d3d95602f4009c97d37fdf8e241ec8ab82389d
Diffstat (limited to 'openstack_dashboard/exceptions.py')
-rw-r--r--openstack_dashboard/exceptions.py96
1 files changed, 47 insertions, 49 deletions
diff --git a/openstack_dashboard/exceptions.py b/openstack_dashboard/exceptions.py
index 78e677f4f..949a0ea58 100644
--- a/openstack_dashboard/exceptions.py
+++ b/openstack_dashboard/exceptions.py
@@ -25,57 +25,55 @@ from keystoneclient import exceptions as keystoneclient
from neutronclient.common import exceptions as neutronclient
from novaclient import exceptions as novaclient
from swiftclient import client as swiftclient
-try:
- from troveclient.compat import exceptions as troveclient
- with_trove = True
-except ImportError:
- try:
- from troveclient import exceptions as troveclient
- with_trove = True
- except ImportError:
- with_trove = False
+from troveclient import exceptions as troveclient
-UNAUTHORIZED = (keystoneclient.Unauthorized,
- keystoneclient.Forbidden,
- cinderclient.Unauthorized,
- cinderclient.Forbidden,
- novaclient.Unauthorized,
- novaclient.Forbidden,
- glanceclient.Unauthorized,
- neutronclient.Unauthorized,
- neutronclient.Forbidden,
- heatclient.HTTPUnauthorized,
- heatclient.HTTPForbidden,)
+UNAUTHORIZED = (
+ keystoneclient.Unauthorized,
+ keystoneclient.Forbidden,
+ cinderclient.Unauthorized,
+ cinderclient.Forbidden,
+ novaclient.Unauthorized,
+ novaclient.Forbidden,
+ glanceclient.Unauthorized,
+ neutronclient.Unauthorized,
+ neutronclient.Forbidden,
+ heatclient.HTTPUnauthorized,
+ heatclient.HTTPForbidden,
+ troveclient.Unauthorized,
+)
-NOT_FOUND = (keystoneclient.NotFound,
- cinderclient.NotFound,
- novaclient.NotFound,
- glanceclient.NotFound,
- neutronclient.NetworkNotFoundClient,
- neutronclient.PortNotFoundClient,
- heatclient.HTTPNotFound,)
-# NOTE(gabriel): This is very broad, and may need to be dialed in.
-RECOVERABLE = (keystoneclient.ClientException,
- # AuthorizationFailure is raised when Keystone is "unavailable".
- keystoneclient.AuthorizationFailure,
- cinderclient.ClientException,
- cinderclient.ConnectionError,
- novaclient.ClientException,
- glanceclient.ClientException,
- # NOTE(amotoki): Neutron exceptions other than the first one
- # are recoverable in many cases (e.g., NetworkInUse is not
- # raised once VMs which use the network are terminated).
- neutronclient.NeutronClientException,
- neutronclient.NetworkInUseClient,
- neutronclient.PortInUseClient,
- neutronclient.AlreadyAttachedClient,
- neutronclient.StateInvalidClient,
- swiftclient.ClientException,
- heatclient.HTTPException,)
+NOT_FOUND = (
+ keystoneclient.NotFound,
+ cinderclient.NotFound,
+ novaclient.NotFound,
+ glanceclient.NotFound,
+ neutronclient.NetworkNotFoundClient,
+ neutronclient.PortNotFoundClient,
+ heatclient.HTTPNotFound,
+ troveclient.NotFound,
+)
+
-if with_trove:
- UNAUTHORIZED += (troveclient.Unauthorized,)
- NOT_FOUND += (troveclient.NotFound,)
- RECOVERABLE += (troveclient.ClientException,)
+# NOTE(gabriel): This is very broad, and may need to be dialed in.
+RECOVERABLE = (
+ keystoneclient.ClientException,
+ # AuthorizationFailure is raised when Keystone is "unavailable".
+ keystoneclient.AuthorizationFailure,
+ cinderclient.ClientException,
+ cinderclient.ConnectionError,
+ novaclient.ClientException,
+ glanceclient.ClientException,
+ # NOTE(amotoki): Neutron exceptions other than the first one
+ # are recoverable in many cases (e.g., NetworkInUse is not
+ # raised once VMs which use the network are terminated).
+ neutronclient.NeutronClientException,
+ neutronclient.NetworkInUseClient,
+ neutronclient.PortInUseClient,
+ neutronclient.AlreadyAttachedClient,
+ neutronclient.StateInvalidClient,
+ swiftclient.ClientException,
+ heatclient.HTTPException,
+ troveclient.ClientException
+)