Commit 473f2d23 authored by Giorgos Korfiatis's avatar Giorgos Korfiatis Committed by Christos Stavrakakis

astakos: Rename --limit to --default-quota

Use a more descriptive name for this resource-modify option. Also change
resource-list column `limit' to `default_quota'.
parent 053bcb0d
......@@ -306,10 +306,9 @@ uncomment the default setting ``ASTAKOS_SERVICES``
and customize the ``'uplimit'`` values.
These are the default base quota for all users.
To apply your configuration run::
You can modify the default base quota limit for all future users with::
# snf-manage astakos-init --load-service-resources
# snf-manage quota --sync
# snf-manage resource-modify <resource_name> --default-quota <value>
Set base quota for individual users
```````````````````````````````````
......@@ -336,7 +335,7 @@ in ``20-snf-astakos-app-settings.conf`` set::
You can change the maximum allowed number of pending project applications
per user with::
# snf-manage resource-modify astakos.pending_app --limit <number>
# snf-manage resource-modify astakos.pending_app --default-quota <number>
You can also set a user-specific limit with::
......
......@@ -914,7 +914,7 @@ We now have to specify the limit on resources that each user can employ
.. code-block:: console
# snf-manage resource-modify --limit-interactive
# snf-manage resource-modify --default-quota-interactive
Servers Initialization
......
......@@ -53,13 +53,13 @@ class Command(ListCommand):
"name": ("name", "Resource Name"),
"service type": ("service_type", "Service type"),
"service origin": ("service_origin", "Service"),
"limit": ("limit_with_unit", "Base Quota"),
"default_quota": ("limit_with_unit", "Default Quota"),
"description": ("desc", "Description"),
"allow_in_projects": ("allow_in_projects",
"Make resource available in projects"),
}
fields = ["id", "name", "service origin", "limit",
fields = ["id", "name", "service origin", "default_quota",
"description"]
def show_limit(self, resource):
......
......@@ -46,15 +46,16 @@ class Command(BaseCommand):
help = "Modify a resource's default base quota and boolean flags."
option_list = BaseCommand.option_list + (
make_option('--limit',
make_option('--default-quota',
metavar='<limit>',
help="Specify default base quota"),
make_option('--limit-interactive',
make_option('--default-quota-interactive',
action='store_true',
default=None,
help=("Prompt user to change default base quota. "
"If no resource is given, prompts for all "
"resources.")),
make_option('--limit-from-file',
make_option('--default-quota-from-file',
metavar='<limits_file.json>',
help=("Read default base quota from a file. "
"File should contain a json dict mapping resource "
......@@ -73,9 +74,9 @@ class Command(BaseCommand):
resource_name = args[0] if len(args) > 0 else None
actions = {
'limit': self.change_limit,
'limit_interactive': self.change_interactive,
'limit_from_file': self.change_from_file,
'default_quota': self.change_limit,
'default_quota_interactive': self.change_interactive,
'default_quota_from_file': self.change_from_file,
'allow_in_projects': self.set_allow_in_projects,
}
......@@ -85,8 +86,9 @@ class Command(BaseCommand):
if len(opts) != 1:
raise CommandError("Please provide exactly one of the options: "
"--limit, --limit-interactive, "
"--limit-from-file, --allow-in-projects.")
"--default-quota, --default-quota-interactive, "
"--default-quota-from-file, "
"--allow-in-projects.")
self.unit_style = options['unit_style']
check_style(self.unit_style)
......
......@@ -1256,16 +1256,16 @@ def import_services():
debug(env.host, " * Setting default quota...")
cmd = """
snf-manage resource-modify --limit 40G pithos.diskspace
snf-manage resource-modify --limit 2 astakos.pending_app
snf-manage resource-modify --limit 4 cyclades.vm
snf-manage resource-modify --limit 40G cyclades.disk
snf-manage resource-modify --limit 16G cyclades.total_ram
snf-manage resource-modify --limit 8G cyclades.ram
snf-manage resource-modify --limit 32 cyclades.total_cpu
snf-manage resource-modify --limit 16 cyclades.cpu
snf-manage resource-modify --limit 4 cyclades.network.private
snf-manage resource-modify --limit 4 cyclades.floating_ip
snf-manage resource-modify --default-quota 40G pithos.diskspace
snf-manage resource-modify --default-quota 2 astakos.pending_app
snf-manage resource-modify --default-quota 4 cyclades.vm
snf-manage resource-modify --default-quota 40G cyclades.disk
snf-manage resource-modify --default-quota 16G cyclades.total_ram
snf-manage resource-modify --default-quota 8G cyclades.ram
snf-manage resource-modify --default-quota 32 cyclades.total_cpu
snf-manage resource-modify --default-quota 16 cyclades.cpu
snf-manage resource-modify --default-quota 4 cyclades.network.private
snf-manage resource-modify --default-quota 4 cyclades.floating_ip
"""
try_run(cmd)
......
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