1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

Add fixtures

This commit is contained in:
Retspen 2015-02-27 15:56:10 +02:00
parent 2ed6ca6518
commit cbba654538
7 changed files with 122 additions and 3 deletions

4
Vagrantfile vendored
View file

@ -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

View 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,
),
]

View 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"
}
}
]

View 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,),
),
]

View file

@ -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