diff --git a/horizon/api/nova.py b/horizon/api/nova.py index c237595f6..f7b83bdde 100644 --- a/horizon/api/nova.py +++ b/horizon/api/nova.py @@ -27,6 +27,8 @@ import logging from django.conf import settings from django.utils.translation import ugettext as _ +from cinderclient.v1 import client as cinder_client + from novaclient.v1_1 import client as nova_client from novaclient.v1_1 import security_group_rules as nova_rules from novaclient.v1_1.security_groups import SecurityGroup as NovaSecurityGroup @@ -210,11 +212,11 @@ def cinderclient(request): insecure = getattr(settings, 'OPENSTACK_SSL_NO_VERIFY', False) LOG.debug('cinderclient connection created using token "%s" and url "%s"' % (request.user.token.id, url_for(request, 'volume'))) - c = nova_client.Client(request.user.username, - request.user.token.id, - project_id=request.user.tenant_id, - auth_url=url_for(request, 'volume'), - insecure=insecure) + c = cinder_client.Client(request.user.username, + request.user.token.id, + project_id=request.user.tenant_id, + auth_url=url_for(request, 'volume'), + insecure=insecure) c.client.auth_token = request.user.token.id c.client.management_url = url_for(request, 'volume') return c diff --git a/openstack_dashboard/exceptions.py b/openstack_dashboard/exceptions.py index c025aeb34..8801fc982 100644 --- a/openstack_dashboard/exceptions.py +++ b/openstack_dashboard/exceptions.py @@ -18,6 +18,7 @@ # License for the specific language governing permissions and limitations # under the License. +from cinderclient import exceptions as cinderclient from glanceclient.common import exceptions as glanceclient from keystoneclient import exceptions as keystoneclient from novaclient import exceptions as novaclient @@ -27,6 +28,8 @@ from swiftclient import client as swiftclient UNAUTHORIZED = (keystoneclient.Unauthorized, keystoneclient.Forbidden, + cinderclient.Unauthorized, + cinderclient.Forbidden, novaclient.Unauthorized, novaclient.Forbidden, glanceclient.Unauthorized, @@ -34,6 +37,7 @@ UNAUTHORIZED = (keystoneclient.Unauthorized, quantumclient.Forbidden) NOT_FOUND = (keystoneclient.NotFound, + cinderclient.NotFound, novaclient.NotFound, glanceclient.NotFound, quantumclient.NetworkNotFoundClient, @@ -43,6 +47,7 @@ NOT_FOUND = (keystoneclient.NotFound, RECOVERABLE = (keystoneclient.ClientException, # AuthorizationFailure is raised when Keystone is "unavailable". keystoneclient.AuthorizationFailure, + cinderclient.ClientException, novaclient.ClientException, glanceclient.ClientException, # NOTE(amotoki): Quantum exceptions other than the first one diff --git a/tools/pip-requires b/tools/pip-requires index 4246a56b5..262287d02 100644 --- a/tools/pip-requires +++ b/tools/pip-requires @@ -2,6 +2,7 @@ Django>=1.4 django_compressor django_openstack_auth +python-cinderclient python-glanceclient<2 python-keystoneclient python-novaclient