diff options
| author | Jenkins <jenkins@review.openstack.org> | 2012-05-23 19:22:16 +0000 |
|---|---|---|
| committer | Gerrit Code Review <review@openstack.org> | 2012-05-23 19:22:16 +0000 |
| commit | d9ee3bd9bc8509b15889083aa29359022c5569b1 (patch) | |
| tree | c383b298e839a806599975c17947ae7882aa0041 /bin | |
| parent | 19ec093e81f94c9b00bddf2af25ac6dcc406590b (diff) | |
| parent | b7f0946bbd071bc76809eca440ab7d21a03eb1a3 (diff) | |
Merge "Finish quota refactor."
Diffstat (limited to 'bin')
| -rwxr-xr-x | bin/nova-manage | 10 |
1 files changed, 6 insertions, 4 deletions
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='<Project name>', help='Project name') |
