From 1cf475d7a135c1078cf7df11c261618af501dc37 Mon Sep 17 00:00:00 2001 From: Eoghan Glynn Date: Thu, 16 Aug 2012 16:11:03 +0100 Subject: 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 --- bin/nova-manage | 51 --------------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'bin') 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='', - help='Project name') - @args('--key', dest="key", metavar='', help='Key') - @args('--value', dest="value", metavar='', 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='', - help='Project name') - @args('--key', dest="key", metavar='', help='Key') - @args('--value', dest="value", metavar='', 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='', - help='User name') - @args('--project', dest="project_id", metavar='', - help='Project name') - @args('--key', dest="key", metavar='', help='Key') - @args('--value', dest="value", metavar='', 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), -- cgit