Skip to content

Commit b399b04

Browse files
author
Dean Troyer
committed
Remove quota set workaround for SDK <0.9.13
Change-Id: I89732c49e73ac5a789fdbe19536389f7e93ac0e6
1 parent 3b562ff commit b399b04

1 file changed

Lines changed: 3 additions & 30 deletions

File tree

openstackclient/common/quota.py

Lines changed: 3 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -182,36 +182,9 @@ def take_action(self, parsed_args):
182182
project,
183183
**volume_kwargs)
184184
if network_kwargs:
185-
if hasattr(_quota.Quota, 'allow_get'):
186-
# TODO(huanxuan): Remove this block once the fixed
187-
# SDK Quota class is the minimum required version.
188-
# This is expected to be SDK release 0.9.13
189-
res = network_client._get_resource(
190-
_quota.Quota, project, **network_kwargs)
191-
if any([res._body.dirty, res._header.dirty]):
192-
request = res._prepare_request(prepend_key=True)
193-
# remove the id in the body
194-
if 'id' in request.body[res.resource_key]:
195-
del request.body[res.resource_key]['id']
196-
if res.patch_update:
197-
response = network_client.session.patch(
198-
request.uri,
199-
endpoint_filter=res.service,
200-
json=request.body,
201-
headers=request.headers
202-
)
203-
else:
204-
response = network_client.session.put(
205-
request.uri,
206-
endpoint_filter=res.service,
207-
json=request.body,
208-
headers=request.headers
209-
)
210-
res._translate_response(response, has_body=True)
211-
else:
212-
network_client.update_quota(
213-
project,
214-
**network_kwargs)
185+
network_client.update_quota(
186+
project,
187+
**network_kwargs)
215188

216189

217190
class ShowQuota(command.ShowOne):

0 commit comments

Comments
 (0)