blob: 47f5529a185db8bfbf49268b4a9b025002fd12fd [file] [log] [blame]
Scott Bakerca78dc42015-02-06 17:05:17 -08001import os
2import sys
3sys.path.append("/opt/xos")
4os.environ.setdefault("DJANGO_SETTINGS_MODULE", "planetstack.settings")
5import django
6from core.models import *
7django.setup()
8
9# python ./manage.py sqlflush | python ./manage.py dbshell
10
11os.system("python /opt/xos/manage.py sqlflush | python /opt/xos/manage.py dbshell")
12
13ADMIN_USERNAME = "padmin@vicci.org"
14ADMIN_PASSWORD = "letmein"
15FLAVORS = ["m1.small", "m1.medium", "m1.large"]
16SITE_ROLES = ["admin", "pi", "tech"]
17SLICE_ROLES = ["admin", "access"]
18DEPLOYMENT_ROLES = ["admin"]
19
20d = Deployment(name="Enterprise")
21d.save()
22
23s = Site(name="MySite", enabled=True, login_base="mysite", is_public=True, abbreviated_name="mysite")
24s.save()
25
26sd = SiteDeployment(site=s, deployment=d)
27sd.save();
28
29u = User(email = "padmin@vicci.org", password="letmein", is_admin=True, is_active=True, site=s, firstname="XOS",
30 lastname="admin")
31u.save()
32
33for flavor_name in FLAVORS:
34 f = Flavor(name=flavor_name, flavor=flavor_name)
35 f.save()
36 f.deployments.add(d)
37 f.save()
38
39for site_role_name in SITE_ROLES:
40 sr = SiteRole(role=site_role_name)
41 sr.save()
42
43for slice_role_name in SLICE_ROLES:
44 sr = SliceRole(role=slice_role_name)
45 sr.save()
46
47for deployment_role_name in DEPLOYMENT_ROLES:
48 dr = DeploymentRole(role=deployment_role_name)
49 dr.save()
50
51DashboardView(name="xsh", url="template:xsh", enabled=True).save()
52DashboardView(name="Customize", url="template:customize", enabled=True).save()
53DashboardView(name="Tenant", url="template:xosTenant", enabled=True).save()
54DashboardView(name="Developer", url="template:xosDeveloper_datatables", enabled=True).save()
55
56ServiceClass(name="Best Effort", description="Best Effort").save()
57