Bug 1269332 - "cinder quota-class-update default" does not work
"cinder quota-class-update default" does not work
Status: CLOSED ERRATA
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-cinderclient (Show other bugs)
6.0 (Juno)
Unspecified Unspecified
medium Severity high
: ---
: 6.0 (Juno)
Assigned To: Sergey Gotliv
lkuchlan
: Reopened, ZStream
: 1297613 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2015-10-06 23:07 EDT by Shinobu KINJO
Modified: 2018-02-08 05:58 EST (History)
8 users (show)

See Also:
Fixed In Version: python-cinderclient-1.1.1-3.el7ost
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2016-06-23 14:37:27 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Shinobu KINJO 2015-10-06 23:07:43 EDT
Description of problem:

    "cinder quota-class-update default" does not work

 Note:
  Customer is using:
   python-cinderclient-1.1.1-1.el7ost

DETAILS is below:

When "cinder quota-class-update default" was executed, it's always failed.

I'm assuming, for instance v1:

When that command is executed, it ends up with calling:


    do_quota_class_update


defined in:


    /usr/lib/python2.7/site-packages/cinderclient/v1/shell.py

       788 def do_quota_class_update(cs, args):


And quota is updated by:


    update


defined in:


    /usr/lib/python2.7/site-packages/cinderclient/v1/quota_classes.py

       39     def update(self, class_name, **updates):


In quota_classes.py, there are 2 classes and each of 2 has 2 functions.


    QuotaClassSet

      id
      update

    QuotaClassSetManager

      get
      update


Each update function are called but as belows, it seems not to return 
anything.


    19 class QuotaClassSet(base.Resource):
       ...
    28     def update(self, *args, **kwargs):
    29         self.manager.update(self.class_name, *args, **kwargs)


    32 class QuotaClassSetManager(base.Manager):
      ...
    39     def update(self, class_name, **updates):
    40         body = {'quota_class_set': {'class_name': class_name}}
    41 
    42         for update in updates:
    43             body['quota_class_set'][update] = updates[update]
    44 
    45         self._update('/os-quota-class-sets/%s' % (class_name), body)


Is this procedure right?
I don't think it's supposed to work as expected.

And there is confusion to me about inconsistency format between 
"class_name" and "class-name".


usr/lib/python2.7/site-packages/cinderclient/v1/shell.py:760:@utils.arg('class_name', 
usr/lib/python2.7/site-packages/cinderclient/v1/shell.py:769:@utils.arg('class_name', 
usr/lib/python2.7/site-packages/cinderclient/v2/shell.py:866:@utils.arg('class_name',
usr/lib/python2.7/site-packages/cinderclient/v2/shell.py:876:@utils.arg('class-name',


Let me know If I've missed anything.


Version-Release number of selected component (if applicable):

    python-cinderclient-1.1.1-1.el7ost

How reproducible:

    cinder quota-class-update default

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:
Comment 3 Sergey Gotliv 2015-12-06 14:02:06 EST
I think its already reported [1] and fixed [2] upstream in python-cinderclient 1.3.1.
 
[1] https://bugs.launchpad.net/python-cinderclient/+bug/1423884
[2] https://review.openstack.org/#/c/160253/
Comment 4 Sergey Gotliv 2015-12-06 14:04:36 EST
Shinobu,

Can you, please, ask partner to use cinder client version >= 1.3.1. See my previous comment.
Comment 9 Sergey Gotliv 2016-01-04 02:38:03 EST
@Shinobu,

I created python-cinderclient-1.1.1-2.el7ost which is basically customer's python-cinderclient-1.1.1-1.el7ost with the fix [1] on top. You can find the new build here [2], can you, please, give it to the customer as a test package?

[1] https://review.openstack.org/#/c/160253/
[2] [1] https://brewweb.devel.redhat.com/buildinfo?buildID=471951
Comment 16 Lee Yarwood 2016-01-12 11:32:06 EST
*** Bug 1297613 has been marked as a duplicate of this bug. ***
Comment 22 lkuchlan 2016-06-23 02:04:37 EDT
Tested using:
python-cinderclient-1.1.1-3.el7ost.noarch

Verification flow:

[root@dhcp162-21 ~(keystone_admin)]# cinder quota-class-show default
+-----------------+-------+
|     Property    | Value |
+-----------------+-------+
|    gigabytes    |  1000 |
| gigabytes_iscsi |   -1  |
|    snapshots    |   10  |
| snapshots_iscsi |   -1  |
|     volumes     |   10  |
|  volumes_iscsi  |   -1  |
+-----------------+-------+
[root@dhcp162-21 ~(keystone_admin)]# cinder --os-volume-api-version 1 quota-class-update --volumes 1 default
+-----------------+-------+
|     Property    | Value |
+-----------------+-------+
|    gigabytes    |  1000 |
| gigabytes_iscsi |   -1  |
|    snapshots    |   10  |
| snapshots_iscsi |   -1  |
|     volumes     |   1   |
|  volumes_iscsi  |   -1  |
+-----------------+-------+
[root@dhcp162-21 ~(keystone_admin)]# cinder quota-class-show default
+-----------------+-------+
|     Property    | Value |
+-----------------+-------+
|    gigabytes    |  1000 |
| gigabytes_iscsi |   -1  |
|    snapshots    |   10  |
| snapshots_iscsi |   -1  |
|     volumes     |   1   |
|  volumes_iscsi  |   -1  |
+-----------------+-------+
[root@dhcp162-21 ~(keystone_admin)]# cinder --os-volume-api-version 2 quota-class-update --volumes 2 default
+-----------------+-------+
|     Property    | Value |
+-----------------+-------+
|    gigabytes    |  1000 |
| gigabytes_iscsi |   -1  |
|    snapshots    |   10  |
| snapshots_iscsi |   -1  |
|     volumes     |   2   |
|  volumes_iscsi  |   -1  |
+-----------------+-------+
[root@dhcp162-21 ~(keystone_admin)]# cinder quota-class-show default
+-----------------+-------+
|     Property    | Value |
+-----------------+-------+
|    gigabytes    |  1000 |
| gigabytes_iscsi |   -1  |
|    snapshots    |   10  |
| snapshots_iscsi |   -1  |
|     volumes     |   2   |
|  volumes_iscsi  |   -1  |
+-----------------+-------+
Comment 24 errata-xmlrpc 2016-06-23 14:37:27 EDT
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2016:1315

Note You need to log in before you can comment on or make changes to this bug.