summaryrefslogtreecommitdiffstats
path: root/bin
diff options
context:
space:
mode:
authorEoghan Glynn <eglynn@redhat.com>2012-08-16 16:11:03 +0100
committerVishvananda Ishaya <vishvananda@gmail.com>2012-08-16 22:51:02 -0700
commit1cf475d7a135c1078cf7df11c261618af501dc37 (patch)
tree2edca13cb18fd30557f745db9cf5ace886b1e82c /bin
parent06d1f0dfd5d22ace96b414fd0b71fbaa668b95ce (diff)
Revert per-user-quotas
See bug 1034384, bug 1037590. This reverts commit https://github.com/openstack/nova/commit/391f345d, but leaves the DB migration in place while adding a further migration to reverse it. The motivation for reversion is that the per-user quota logic would totally undermine the per-project quotas set for a pre-existing openstack install. The per-user quota logic could be re-introduced in a fixed state after Folsom-3. Change-Id: Idd4b55a2404a25f43f6737b661f828c28501066f
Diffstat (limited to 'bin')
-rwxr-xr-xbin/nova-manage51
1 files changed, 0 insertions, 51 deletions
diff --git a/bin/nova-manage b/bin/nova-manage
index 7005c7fcf..9a09a8b5a 100755
--- a/bin/nova-manage
+++ b/bin/nova-manage
@@ -224,10 +224,6 @@ def _db_error(caught_exception):
class ProjectCommands(object):
"""Class for managing projects."""
- @args('--project', dest="project_id", metavar='<Project name>',
- help='Project name')
- @args('--key', dest="key", metavar='<key>', help='Key')
- @args('--value', dest="value", metavar='<value>', help='Value')
def quota(self, project_id, key=None, value=None):
"""Set or display quotas for project"""
ctxt = context.get_admin_context()
@@ -260,52 +256,6 @@ class ProjectCommands(object):
AccountCommands = ProjectCommands
-class QuotaCommands(object):
- """Class for managing quotas."""
-
- @args('--project', dest="project_id", metavar='<Project name>',
- help='Project name')
- @args('--key', dest="key", metavar='<key>', help='Key')
- @args('--value', dest="value", metavar='<value>', help='Value')
- def project(self, project_id, key=None, value=None):
- """Set or display quotas for project"""
- ctxt = context.get_admin_context()
- if key:
- if value.lower() == 'unlimited':
- value = None
- try:
- db.quota_update(ctxt, project_id, key, value)
- except exception.ProjectQuotaNotFound:
- db.quota_create(ctxt, project_id, key, value)
- project_quota = QUOTAS.get_project_quotas(ctxt, project_id)
- for key, value in project_quota.iteritems():
- if value['limit'] < 0 or value['limit'] is None:
- value['limit'] = 'unlimited'
- print '%s: %s' % (key, value['limit'])
-
- @args('--user', dest="user_id", metavar='<User name>',
- help='User name')
- @args('--project', dest="project_id", metavar='<Project name>',
- help='Project name')
- @args('--key', dest="key", metavar='<key>', help='Key')
- @args('--value', dest="value", metavar='<value>', help='Value')
- def user(self, user_id, project_id, key=None, value=None):
- """Set or display quotas for user"""
- ctxt = context.get_admin_context()
- if key:
- if value.lower() == 'unlimited':
- value = None
- try:
- db.quota_update_for_user(ctxt, user_id, project_id, key, value)
- except exception.UserQuotaNotFound:
- db.quota_create_for_user(ctxt, user_id, project_id, key, value)
- user_quota = QUOTAS.get_user_quotas(ctxt, user_id, project_id)
- for key, value in user_quota.iteritems():
- if value['limit'] < 0 or value['limit'] is None:
- value['limit'] = 'unlimited'
- print '%s: %s' % (key, value['limit'])
-
-
class FixedIpCommands(object):
"""Class for managing fixed ip."""
@@ -1364,7 +1314,6 @@ CATEGORIES = [
('logs', GetLogCommands),
('network', NetworkCommands),
('project', ProjectCommands),
- ('quota', QuotaCommands),
('service', ServiceCommands),
('shell', ShellCommands),
('sm', StorageManagerCommands),