diff options
-rw-r--r-- | master/custom/db_defaults.py | 4 | ||||
-rw-r--r-- | master/master/models.py | 2 | ||||
-rwxr-xr-x | master/setup-master.py | 8 |
3 files changed, 11 insertions, 3 deletions
diff --git a/master/custom/db_defaults.py b/master/custom/db_defaults.py index b659060..2af2171 100644 --- a/master/custom/db_defaults.py +++ b/master/custom/db_defaults.py @@ -8,6 +8,10 @@ # Database initialization values +## User-related defaults +groups = ('dev', 'at', 'user',) + +## Job-related defaults providers = ('gentoo', 'funtoo',) # No 'arm' in here because the dir structure is weird # and it hasn't been updated in forever anyway. diff --git a/master/master/models.py b/master/master/models.py index 844ba74..7f4163c 100644 --- a/master/master/models.py +++ b/master/master/models.py @@ -8,7 +8,7 @@ from django.db import models from django.forms import ModelForm, ModelChoiceField -from django.contrib.auth.models import User +from django.contrib.auth.models import User, Group from autotua import jobuild, sync import const, random, urllib2 diff --git a/master/setup-master.py b/master/setup-master.py index ba67e11..4f66699 100755 --- a/master/setup-master.py +++ b/master/setup-master.py @@ -72,10 +72,14 @@ def install_master(): def syncdb_master(): """Initialize the database""" - from db_defaults import providers, archs, stages, releases, mirrors + from db_defaults import groups, providers, archs, stages, releases, mirrors import copy management.call_command('syncdb') + # User-related defaults + for group in groups: + Group(name=group).save() + # Job-related defaults for provider in providers: provobj = StageProvider(name=provider) provobj.save() @@ -159,7 +163,7 @@ elif sys.argv[1] == 'syncdb': import settings from django.core.management import setup_environ setup_environ(settings) - from master.models import User, StageProvider, Arch, Stage, Release, Mirror, Job + from master.models import User, Group, StageProvider, Arch, Stage, Release, Mirror, Job # Start stuff syncdb_master() setup_sample_job() |