Fixes quota-class-update commands

The quota-class-update commands for v1 and v2 are both broken,
Fix v1 by returning result for update method in QuotaClassSetManager,
fix v2 by changing arg 'class-name' to 'class_name' for consistent
with v1.

Change-Id: Ic7188f485b914dc55048cf056a0685618134e87a
Closes-bug: #1423884
This commit is contained in:
liyingjun 2015-03-02 16:01:34 +08:00
parent ae9dd86093
commit 9db3430ccd
3 changed files with 10 additions and 6 deletions

View File

@ -26,7 +26,7 @@ class QuotaClassSet(base.Resource):
return self.class_name
def update(self, *args, **kwargs):
self.manager.update(self.class_name, *args, **kwargs)
return self.manager.update(self.class_name, *args, **kwargs)
class QuotaClassSetManager(base.Manager):
@ -42,4 +42,6 @@ class QuotaClassSetManager(base.Manager):
for update in updates:
body['quota_class_set'][update] = updates[update]
self._update('/os-quota-class-sets/%s' % (class_name), body)
result = self._update('/os-quota-class-sets/%s' % (class_name), body)
return self.resource_class(self,
result['quota_class_set'], loaded=True)

View File

@ -24,7 +24,7 @@ class QuotaClassSet(base.Resource):
return self.class_name
def update(self, *args, **kwargs):
self.manager.update(self.class_name, *args, **kwargs)
return self.manager.update(self.class_name, *args, **kwargs)
class QuotaClassSetManager(base.Manager):
@ -40,4 +40,6 @@ class QuotaClassSetManager(base.Manager):
for update in updates:
body['quota_class_set'][update] = updates[update]
self._update('/os-quota-class-sets/%s' % (class_name), body)
result = self._update('/os-quota-class-sets/%s' % (class_name), body)
return self.resource_class(self,
result['quota_class_set'], loaded=True)

View File

@ -997,8 +997,8 @@ def do_quota_class_show(cs, args):
_quota_show(cs.quota_classes.get(args.class_name))
@utils.arg('class-name',
metavar='<class-name>',
@utils.arg('class_name',
metavar='<class_name>',
help='Name of quota class for which to set quotas.')
@utils.arg('--volumes',
metavar='<volumes>',