<s> import django <EOL> django . setup ( ) <EOL> from vimma . util import create_vimma_user <EOL> from vimma . models import ( <EOL> TimeZone , Schedule , Role , Permission , Project , <EOL> User , Provider , DummyProvider , AWSProvider , <EOL> VMConfig , DummyVMConfig , AWSVMConfig , <EOL> ) <EOL> from vimma . perms import Perms , ALL_PERMS <EOL> import json , os <EOL> for perm in ALL_PERMS : <EOL> p , _ = Permission . objects . get_or_create ( name = perm ) <EOL> prj1 , _ = Project . objects . get_or_create ( name = '<STR_LIT>' , email = '<STR_LIT>' ) <EOL> prj2 , _ = Project . objects . get_or_create ( name = '<STR_LIT>' , email = '<STR_LIT>' ) <EOL> for u in User . objects . all ( ) : <EOL> u . projects . add ( prj2 ) <EOL> u1 = create_vimma_user ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> tz_hki , _ = TimeZone . objects . get_or_create ( name = '<STR_LIT>' ) <EOL> TimeZone . objects . get_or_create ( name = '<STR_LIT>' ) <EOL> TimeZone . objects . get_or_create ( name = '<STR_LIT>' ) <EOL> s1 , _ = Schedule . objects . get_or_create ( name = '<STR_LIT>' , timezone = tz_hki , <EOL> matrix = json . dumps ( <NUM_LIT:7> * [ <NUM_LIT:10> * <NUM_LIT:2> * [ False ] + <NUM_LIT:8> * <NUM_LIT:2> * [ True ] + <NUM_LIT:6> * <NUM_LIT:2> * [ False ] ] ) <EOL> ) <EOL> s2 , _ = Schedule . objects . get_or_create ( name = '<STR_LIT>' , timezone = tz_hki , <EOL> matrix = json . dumps ( <NUM_LIT:7> * [ <NUM_LIT> * [ True ] ] ) , is_special = True , <EOL> ) <EOL> u2 = create_vimma_user ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> r2 , _ = Role . objects . get_or_create ( name = '<STR_LIT>' ) <EOL> for u2Perm in ( <EOL> Perms . EDIT_SCHEDULE , <EOL> Perms . USE_SPECIAL_SCHEDULE , <EOL> Perms . READ_ANY_PROJECT , <EOL> Perms . USE_SPECIAL_VM_CONFIG , <EOL> ) : <EOL> r2 . permissions . add ( Permission . objects . get ( name = u2Perm ) ) <EOL> u2 . roles . add ( r2 ) <EOL> u3 = create_vimma_user ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> rOmni , _ = Role . objects . get_or_create ( name = '<STR_LIT>' ) <EOL> pOmni = Permission . objects . get ( name = Perms . OMNIPOTENT ) <EOL> rOmni . permissions . add ( pOmni ) <EOL> u3 . roles . add ( rOmni ) <EOL> u1 . projects . add ( prj1 ) <EOL> u2 . projects . add ( prj2 ) <EOL> u4 = create_vimma_user ( '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' ) <EOL> u4 . projects . add ( prj1 ) <EOL> prov1 , _ = Provider . objects . get_or_create ( name = '<STR_LIT>' , <EOL> type = Provider . TYPE_DUMMY , max_override_seconds = <NUM_LIT> * <NUM_LIT> ) <EOL> DummyProvider . objects . get_or_create ( provider = prov1 ) <EOL> vmc1A , _ = VMConfig . objects . get_or_create ( provider = prov1 , name = '<STR_LIT>' , <EOL> default_schedule = s1 ) <EOL> DummyVMConfig . objects . get_or_create ( vmconfig = vmc1A ) <EOL> vmc1B , _ = VMConfig . objects . get_or_create ( provider = prov1 , name = '<STR_LIT>' , <EOL> default_schedule = s1 , is_special = True ) <EOL> DummyVMConfig . objects . get_or_create ( vmconfig = vmc1B ) <EOL> prov3 , _ = Provider . objects . get_or_create ( name = '<STR_LIT>' , <EOL> type = Provider . TYPE_AWS , max_override_seconds = <NUM_LIT> * <NUM_LIT> ) <EOL> AWSProvider . objects . get_or_create ( provider = prov3 , <EOL> access_key_id = os . getenv ( '<STR_LIT>' ) , <EOL> access_key_secret = os . getenv ( '<STR_LIT>' ) , <EOL> ssh_key_name = os . getenv ( '<STR_LIT>' ) , <EOL> route_53_zone = os . getenv ( '<STR_LIT>' ) , <EOL> default_security_group_id = os . getenv ( '<STR_LIT>' ) , <EOL> vpc_id = os . getenv ( '<STR_LIT>' ) , ) <EOL> vmc3A , _ = VMConfig . objects . get_or_create ( provider = prov3 , name = '<STR_LIT>' , <EOL> default_schedule = s1 ) <EOL> AWSVMConfig . objects . get_or_create ( vmconfig = vmc3A , <EOL> ami_id = '<STR_LIT>' , instance_type = '<STR_LIT>' , region = '<STR_LIT>' , <EOL> root_device_size = <NUM_LIT:8> , root_device_volume_type = '<STR_LIT>' ) <EOL> vmc3B , _ = VMConfig . objects . get_or_create ( provider = prov3 , <EOL> name = '<STR_LIT>' , default_schedule = s1 , default = True ) <EOL> AWSVMConfig . objects . get_or_create ( vmconfig = vmc3B , <EOL> ami_id = '<STR_LIT>' , instance_type = '<STR_LIT>' , <EOL> region = '<STR_LIT>' , <EOL> root_device_size = <NUM_LIT:12> , root_device_volume_type = '<STR_LIT>' ) </s>
