mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-24 23:25:24 +00:00
Add fixtures
This commit is contained in:
parent
2ed6ca6518
commit
cbba654538
7 changed files with 122 additions and 3 deletions
4
Vagrantfile
vendored
4
Vagrantfile
vendored
|
@ -6,10 +6,10 @@ Vagrant.configure(2) do |config|
|
|||
config.vm.hostname = "webvirtmgr"
|
||||
config.vm.network "private_network", ip: "192.168.33.10"
|
||||
config.vm.provision "shell", inline: <<-SHELL
|
||||
sudo sh /vagrant/dev-env/libvirt-bootstrap.sh
|
||||
sudo sh /vagrant/development/libvirt-bootstrap.sh
|
||||
sudo sed -i 's/auth_tcp = \"sasl\"/auth_tcp = \"none\"/g' /etc/libvirt/libvirtd.conf
|
||||
sudo service libvirt-bin restart
|
||||
sudo apt-get -y install python-pip python-dev python-libvirt python-libxml2
|
||||
sudo pip install -r /vagrant/dev-env/requirements.txt
|
||||
sudo pip install -r /vagrant/development/requirements.txt
|
||||
SHELL
|
||||
end
|
||||
|
|
26
accounts/migrations/0002_auto_20150227_1353.py
Normal file
26
accounts/migrations/0002_auto_20150227_1353.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
('accounts', '0001_initial'),
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.AddField(
|
||||
model_name='userinstance',
|
||||
name='is_change',
|
||||
field=models.BooleanField(default=False),
|
||||
preserve_default=True,
|
||||
),
|
||||
migrations.AddField(
|
||||
model_name='userinstance',
|
||||
name='is_delete',
|
||||
field=models.BooleanField(default=False),
|
||||
preserve_default=True,
|
||||
),
|
||||
]
|
62
create/fixtures/initial_data.json
Normal file
62
create/fixtures/initial_data.json
Normal file
|
@ -0,0 +1,62 @@
|
|||
[
|
||||
{
|
||||
"model": "create.Flavor",
|
||||
"pk": 1,
|
||||
"fields": {
|
||||
"label": "micro",
|
||||
"vcpu": "1",
|
||||
"memory": "512",
|
||||
"disk": "20"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "create.Flavor",
|
||||
"pk": 2,
|
||||
"fields": {
|
||||
"label": "mini",
|
||||
"vcpu": "2",
|
||||
"memory": "1024",
|
||||
"disk": "30"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "create.Flavor",
|
||||
"pk": 3,
|
||||
"fields": {
|
||||
"label": "small",
|
||||
"vcpu": "2",
|
||||
"memory": "2048",
|
||||
"disk": "40"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "create.Flavor",
|
||||
"pk": 4,
|
||||
"fields": {
|
||||
"label": "medium",
|
||||
"vcpu": "2",
|
||||
"memory": "4096",
|
||||
"disk": "60"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "create.Flavor",
|
||||
"pk": 5,
|
||||
"fields": {
|
||||
"label": "large",
|
||||
"vcpu": "4",
|
||||
"memory": "8192",
|
||||
"disk": "80"
|
||||
}
|
||||
},
|
||||
{
|
||||
"model": "create.Flavor",
|
||||
"pk": 6,
|
||||
"fields": {
|
||||
"label": "xlarge",
|
||||
"vcpu": "8",
|
||||
"memory": "16384",
|
||||
"disk": "160"
|
||||
}
|
||||
}
|
||||
]
|
26
create/migrations/0001_initial.py
Normal file
26
create/migrations/0001_initial.py
Normal file
|
@ -0,0 +1,26 @@
|
|||
# -*- coding: utf-8 -*-
|
||||
from __future__ import unicode_literals
|
||||
|
||||
from django.db import models, migrations
|
||||
|
||||
|
||||
class Migration(migrations.Migration):
|
||||
|
||||
dependencies = [
|
||||
]
|
||||
|
||||
operations = [
|
||||
migrations.CreateModel(
|
||||
name='Flavor',
|
||||
fields=[
|
||||
('id', models.AutoField(verbose_name='ID', serialize=False, auto_created=True, primary_key=True)),
|
||||
('label', models.CharField(max_length=12)),
|
||||
('memory', models.IntegerField()),
|
||||
('vcpu', models.IntegerField()),
|
||||
('disk', models.IntegerField()),
|
||||
],
|
||||
options={
|
||||
},
|
||||
bases=(models.Model,),
|
||||
),
|
||||
]
|
|
@ -24,6 +24,7 @@ INSTALLED_APPS = (
|
|||
'computes',
|
||||
'instances',
|
||||
'accounts',
|
||||
'create',
|
||||
)
|
||||
|
||||
MIDDLEWARE_CLASSES = (
|
||||
|
@ -86,3 +87,7 @@ QEMU_CONSOLE_TYPES = ['vnc', 'spice']
|
|||
|
||||
# default console type
|
||||
QEMU_CONSOLE_DEFAULT_TYPE = 'vnc'
|
||||
|
||||
# keepalive interval and count for libvirt connections
|
||||
LIBVIRT_KEEPALIVE_INTERVAL = 5
|
||||
LIBVIRT_KEEPALIVE_COUNT = 5
|
||||
|
|
Loading…
Reference in a new issue