summaryrefslogtreecommitdiff
path: root/openstackclient/common
diff options
context:
space:
mode:
authorDean Troyer <dtroyer@gmail.com>2017-02-18 15:46:43 -0600
committerDean Troyer <dtroyer@gmail.com>2017-02-19 15:47:20 -0600
commit73809a98ed63af214ced7d3f51814ca91b122bbe (patch)
treea5ce0133bc8134a9bec885bc465e004010f699fb /openstackclient/common
parentb399b0406ce4c55345c8f11064a5e85ef73dd8fd (diff)
downloadpython-openstackclient-73809a98ed63af214ced7d3f51814ca91b122bbe.tar.gz
Remove remaining uses of SDK Proxy.session
SDK commit Ie67c240e3caa5e100ce07db3862718195c894748 exposed lingering uses of Proxy.session in OSC. Get rid of them. Change-Id: Icab230f1897a446cf3deb0e3d0550d24e11a0ef3
Diffstat (limited to 'openstackclient/common')
-rw-r--r--openstackclient/common/quota.py36
1 files changed, 1 insertions, 35 deletions
diff --git a/openstackclient/common/quota.py b/openstackclient/common/quota.py
index fa6c5765..afc6195f 100644
--- a/openstackclient/common/quota.py
+++ b/openstackclient/common/quota.py
@@ -18,8 +18,6 @@
import itertools
import sys
-from openstack import exceptions as sdk_exceptions
-from openstack.network.v2 import quota as _quota
from osc_lib.command import command
from osc_lib import utils
import six
@@ -253,39 +251,7 @@ class ShowQuota(command.ShowOne):
project = self._get_project(parsed_args)
client = self.app.client_manager.network
if parsed_args.default:
- # TODO(dtroyer): Remove the top of this if block once the
- # fixed SDK QuotaDefault class is the minimum
- # required version. This is expected to be
- # SDK release 0.9.13
- if hasattr(_quota.QuotaDefault, 'project'):
- # hack 0.9.11+
- quotadef_obj = client._get_resource(
- _quota.QuotaDefault,
- project,
- )
- quotadef_obj.base_path = quotadef_obj.base_path % {
- 'project': project,
- }
- try:
- network_quota = quotadef_obj.get(
- client.session,
- requires_id=False,
- )
- except sdk_exceptions.NotFoundException as e:
- raise sdk_exceptions.ResourceNotFound(
- message="No %s found for %s" %
- (_quota.QuotaDefault.__name__, project),
- details=e.details,
- response=e.response,
- request_id=e.request_id,
- url=e.url,
- method=e.method,
- http_status=e.http_status,
- cause=e.cause,
- )
- # end hack-around
- else:
- network_quota = client.get_quota_default(project)
+ network_quota = client.get_quota_default(project)
else:
network_quota = client.get_quota(project)
return network_quota