From b7f0946bbd071bc76809eca440ab7d21a03eb1a3 Mon Sep 17 00:00:00 2001 From: "Kevin L. Mitchell" Date: Fri, 11 May 2012 15:30:14 -0500 Subject: Finish quota refactor. Finishes quota refactoring by making use of the new quota infrastructure. Partially implements blueprint quota-refactor (the final piece is to remove the old quota architecture). This change is fairly substantial. To make it easier to review, it has been broken up into 3 parts. This is the second part. Change-Id: I1c8b43198f0d44e9e13a45575361aa043fd0639e --- bin/nova-manage | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'bin') diff --git a/bin/nova-manage b/bin/nova-manage index f81272436..a4eaf9d6b 100755 --- a/bin/nova-manage +++ b/bin/nova-manage @@ -105,6 +105,8 @@ flags.DECLARE('vpn_start', 'nova.network.manager') flags.DECLARE('default_floating_pool', 'nova.network.manager') flags.DECLARE('public_interface', 'nova.network.linux_net') +QUOTAS = quota.QUOTAS + # Decorators for actions def args(*args, **kwargs): @@ -493,11 +495,11 @@ class ProjectCommands(object): db.quota_update(ctxt, project_id, key, value) except exception.ProjectQuotaNotFound: db.quota_create(ctxt, project_id, key, value) - project_quota = quota.get_project_quotas(ctxt, project_id) + project_quota = QUOTAS.get_project_quotas(ctxt, project_id) for key, value in project_quota.iteritems(): - if value is None: - value = 'unlimited' - print '%s: %s' % (key, value) + if value['limit'] < 0 or value['limit'] is None: + value['limit'] = 'unlimited' + print '%s: %s' % (key, value['limit']) @args('--project', dest="project_id", metavar='', help='Project name') -- cgit