Cinder quotas does not accept None arguments

Bug #1336057 reported by Tyler North
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Opinion
Undecided
Unassigned

Bug Description

If you attempt to update the cinder quotas with a None argument, this errors. This is unlike nova quotas and every other module i have ever encountered with OpenStack.

Example from a python shell:
tnorth@ubuntu:~$ keystone tenant-create --name "foo"
+-------------+----------------------------------+
| Property | Value |
+-------------+----------------------------------+
| description | |
| enabled | True |
| id | 23eb582ecf534026b188f336640f3417 |
| name | foo |
+-------------+----------------------------------+

>>> from cinderclient.v1 import client as cinder
>>> c = cinder.Client('admin', 'password', 'admin', 'http://10.0.2.15:5000/v2.0')
>>> c.quotas.update('23eb582ecf534026b188f336640f3417', volumes=None)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/stack/python-cinderclient/cinderclient/v1/quotas.py", line 47, in update
    self._update('/os-quota-sets/%s' % (tenant_id), body)
  File "/opt/stack/python-cinderclient/cinderclient/base.py", line 166, in _update
    resp, body = self.api.client.put(url, body=body)
  File "/opt/stack/python-cinderclient/cinderclient/client.py", line 335, in put
    return self._cs_request(url, 'PUT', **kwargs)
  File "/opt/stack/python-cinderclient/cinderclient/client.py", line 296, in _cs_request
    **kwargs)
  File "/opt/stack/python-cinderclient/cinderclient/client.py", line 279, in request
    raise exceptions.from_response(resp, body)
cinderclient.exceptions.BadRequest: The server could not comply with the request since it is either malformed or otherwise incorrect. (HTTP 400) (Request-ID: req-84780d2a-02e5-44f9-b4a7-f9ff4b5f47eb)
>>> c.quotas.update('23eb582ecf534026b188f336640f3417', volumes=5)
>>> c.quotas.get('23eb582ecf534026b188f336640f3417')
<QuotaSet gigabytes=1000, snapshots=10, volumes=5>

Changed in cinder:
assignee: nobody → chandan kumar (chkumar246)
Revision history for this message
Vincent Hou (houshengbo) wrote :

What is your expected bahavior if None is passed as a parameter? Set the quota to 0?

Revision history for this message
Tyler North (ty-north) wrote :

To not affect the quota at all. So if the volumes quota was 20, and you pass volumes=None, it would be expected that the volumes quota would stay at 20

Revision history for this message
Duncan Thomas (duncan-thomas) wrote :

That seems a rather odd expectation... what is the reason for wanting such behaviour? Is that behaviour documented elsewhere?

Changed in cinder:
status: New → Opinion
Revision history for this message
Tyler North (ty-north) wrote :

The reason I would expect it to take None arguments is every other client allows this, nova, keystone, etc...

The cinder client should allow for the same argument types as every other client.

Revision history for this message
Sean McGinnis (sean-mcginnis) wrote : Bug Assignee Expired

Unassigning due to no activity for > 6 months.

Changed in cinder:
assignee: chandan kumar (chkumar246) → nobody
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.