Commit 64de2a9f authored by Giorgos Korfiatis's avatar Giorgos Korfiatis
Browse files

astakos: Rename astakos-quota command to quota

Also replace `quotas' with `quota' in strings and command line options.
parent 3c383ec8
......@@ -140,29 +140,29 @@ FIXME: Describe Regex activation method
Setting quota limits
~~~~~~~~~~~~~~~~~~~~
Set default quotas
``````````````````
Set default quota
`````````````````
In 20-snf-astakos-app-settings.conf,
uncomment the default setting ``ASTAKOS_SERVICES``
and customize the ``'uplimit'`` values.
These are the default base quotas for all users.
These are the default base quota for all users.
To apply your configuration run::
# snf-manage astakos-init --load-service-resources
# snf-manage astakos-quota --sync
# snf-manage quota --sync
Set base quotas for individual users
````````````````````````````````````
Set base quota for individual users
```````````````````````````````````
For individual users that need different quotas than the default
For individual users that need different quota than the default
you can set it for each resource like this::
# use this to display quotas / uuid
# snf-manage user-show 'uuid or email' --quotas
# use this to display quota / uuid
# snf-manage user-show 'uuid or email' --quota
# snf-manage user-modify 'user-uuid' --set-quota 'cyclades.vm' 10
# snf-manage user-modify 'user-uuid' --set-base-quota 'cyclades.vm' 10
Enable the Projects feature
......@@ -182,7 +182,7 @@ per user with::
You can also set a user-specific limit with::
# snf-manage user-modify 'user-uuid' --set-quota 'astakos.pending_app' 5
# snf-manage user-modify 'user-uuid' --set-base-quota 'astakos.pending_app' 5
When users apply for projects they are not automatically granted
the resources. They must first be approved by the administrator.
......
......@@ -2001,8 +2001,8 @@ Apply Quotas
.. code-block:: console
node1 # snf-manage astakos-init --load-service-resources
node1 # snf-manage astakos-quota --verify
node1 # snf-manage astakos-quota --sync
node1 # snf-manage quota --verify
node1 # snf-manage quota --sync
node2 # snf-manage pithos-reset-usage
node1 # snf-manage reconcile-resources-cyclades --fix
......
......@@ -140,7 +140,7 @@ Then initialize the Database and register services with:
# snf-manage service-add "cyclades" https://cyclades.example.com/ui/
# snf-manage service-add "pithos+" https://pithos.example.com/ui/
# snf-manage astakos-init --load-service-resources
# snf-manage astakos-quota --sync
# snf-manage quota --sync
# /etc/init.d/gunicorn restart
# /etc/init.d/apache2 restart
......
......@@ -165,7 +165,6 @@ Available as extensions to Django's command-line management utility:
============================ ===========================
Name Description
============================ ===========================
astakos-quota Inspect quotaholder status
fix-superusers Transform superusers created by syncdb into AstakosUser instances
full-cleanup Cleanup sessions and session catalog
invitation-list List invitation
......@@ -173,6 +172,7 @@ invitation-show Show invitation details
project-control Manage projects and applications
project-list List projects
project-show Show project details
quota List and check the integrity of user quota
reconcile-resources-astakos Reconcile resource usage of Quotaholder with Astakos DB
resource-add Add resource
resource-export-astakos Export astakos resources in json format
......
......@@ -48,14 +48,14 @@ logger = logging.getLogger(__name__)
class Command(SynnefoCommand):
help = "Inspect quotaholder status"
help = "List and check the integrity of user quota"
option_list = SynnefoCommand.option_list + (
make_option('--list',
action='store_true',
dest='list',
default=False,
help="List all quotas (default)"),
help="List all quota (default)"),
make_option('--verify',
action='store_true',
dest='verify',
......@@ -69,11 +69,11 @@ class Command(SynnefoCommand):
make_option('--user',
metavar='<uuid or email>',
dest='user',
help="List quotas for a specified user"),
help="List quota for a specified user"),
make_option('--import-base-quota',
dest='import_base_quota',
metavar='<exported-quotas.txt>',
help=("Import base quotas from file. "
metavar='<exported-quota.txt>',
help=("Import base quota from file. "
"The file must contain non-empty lines, and each "
"line must contain a single-space-separated list "
"of values: <user> <resource name> <capacity>")
......@@ -108,7 +108,7 @@ class Command(SynnefoCommand):
qh_limits, qh_quotas, astakos_i, diff_q = list_user_quotas(users)
except BaseException as e:
logger.exception(e)
raise CommandError("Failed to compute quotas.")
raise CommandError("Failed to compute quota.")
info = {}
for user in users:
......@@ -127,7 +127,7 @@ class Command(SynnefoCommand):
set_user_quota(diff_q)
except BaseException as e:
logger.exception(e)
raise CommandError("Failed to sync quotas.")
raise CommandError("Failed to sync quota.")
self.print_sync(diff_q)
def get_user(self, user_ident):
......@@ -170,19 +170,19 @@ class Command(SynnefoCommand):
user = get_user_by_uuid(holder)
if registered is None:
self.stdout.write(
"No quotas for %s (%s) in quotaholder.\n" %
"No quota for %s (%s) in quotaholder.\n" %
(holder, user.username))
else:
self.stdout.write("Quotas differ for %s (%s):\n" %
self.stdout.write("Quota differ for %s (%s):\n" %
(holder, user.username))
self.stdout.write("Quotas according to quotaholder:\n")
self.stdout.write("Quota according to quotaholder:\n")
self.stdout.write("%s\n" % (registered))
self.stdout.write("Quotas according to astakos:\n")
self.stdout.write("Quota according to astakos:\n")
self.stdout.write("%s\n\n" % (local))
diffs = len(diff_quotas)
if diffs:
self.stdout.write("Quotas differ for %d users.\n" % (diffs))
self.stdout.write("Quota differ for %d users.\n" % (diffs))
def import_from_file(self, location):
users = set()
......
......@@ -51,11 +51,11 @@ class Command(SynnefoCommand):
help = "Show user info"
option_list = SynnefoCommand.option_list + (
make_option('--quotas',
make_option('--quota',
action='store_true',
dest='list_quotas',
default=False,
help="Also list user quotas"),
help="Also list user quota"),
)
def handle(self, *args, **options):
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment