Commit a5871282 by Bach Dániel

devenv: jól szétbachtuk a devenvet, mindenki jön a másiknak egy sörrel :(

parent 8228841b
...@@ -5,15 +5,13 @@ for i in cloudstore toplist django ...@@ -5,15 +5,13 @@ for i in cloudstore toplist django
do do
sudo stop $i || true sudo stop $i || true
done done
set -x
cd /opt/webadmin/cloud sudo apt-get install rabbitmq-server
./manage.py syncdb --noinput sudo rabbitmqctl delete_user guest || true
./manage.py migrate sudo rabbitmqctl add_user nyuszi teszt || true
./manage.py loaddata miscellaneous/dump.json sudo rabbitmqctl add_vhost django || true
./manage.py loaddata miscellaneous/devenv/dev.json sudo rabbitmqctl set_permissions -p django nyuszi '.*' '.*' '.*' || true
./manage.py update
./manage.py loaddata miscellaneous/devenv/dev.json
set +x
#Set up store server #Set up store server
rm -rf /var/www/* rm -rf /var/www/*
...@@ -44,6 +42,18 @@ do ...@@ -44,6 +42,18 @@ do
sudo start $i sudo start $i
done done
set -x
cd /opt/webadmin/cloud
./manage.py syncdb --noinput
./manage.py migrate
./manage.py loaddata miscellaneous/dump.json
./manage.py loaddata miscellaneous/devenv/dev.json
./manage.py update
./manage.py loaddata miscellaneous/devenv/dev.json
set +x
cd /opt/webadmin/cloud/miscellaneous/devenv cd /opt/webadmin/cloud/miscellaneous/devenv
sudo cp vimrc.local /etc/vim/vimrc.local sudo cp vimrc.local /etc/vim/vimrc.local
...@@ -59,9 +69,3 @@ git config --global core.editor vim ...@@ -59,9 +69,3 @@ git config --global core.editor vim
true true
sudo apt-get install rabbitmq-server
sudo rabbitmqctl delete_user guest
sudo rabbitmqctl add_user nyuszi teszt
sudo rabbitmqctl add_vhost django
sudo rabbitmqctl set_permissions -p django nyuszi '.*' '.*' '.*'
...@@ -138,13 +138,18 @@ ...@@ -138,13 +138,18 @@
"model": "auth.user", "model": "auth.user",
"fields": { "fields": {
"username": "test", "username": "test",
"first_name": "Teszt", "first_name": "teszt",
"last_name": "Elek", "last_name": "elek",
"is_active": true, "is_active": true,
"is_superuser": true, "is_superuser": true,
"is_staff": true, "is_staff": true,
"last_login": "2013-02-15T23:25:57Z", "last_login": "2013-02-25T18:32:39Z",
"groups": [], "groups": [
3,
4,
1,
2
],
"user_permissions": [], "user_permissions": [],
"email": "", "email": "",
"date_joined": "2013-01-16T12:36:01Z" "date_joined": "2013-01-16T12:36:01Z"
...@@ -556,51 +561,6 @@ ...@@ -556,51 +561,6 @@
} }
}, },
{ {
"pk": 11,
"model": "one.share",
"fields": {
"group": 1,
"name": "Ubuntu 12s.04 desktop",
"created_at": "2013-02-11T14:35:46Z",
"instance_limit": 10,
"template": 17,
"owner": 7,
"per_user_limit": 1,
"type": "LAB",
"description": ""
}
},
{
"pk": 13,
"model": "one.share",
"fields": {
"group": 1,
"name": "Ubuntu 12s.04 desktop",
"created_at": "2013-02-12T10:05:08Z",
"instance_limit": 2,
"template": 17,
"owner": 7,
"per_user_limit": 4,
"type": "LAB",
"description": ""
}
},
{
"pk": 15,
"model": "one.share",
"fields": {
"group": 2,
"name": "Ubuntu 12s.04 desktop",
"created_at": "2013-02-12T20:36:46Z",
"instance_limit": 10,
"template": 17,
"owner": 7,
"per_user_limit": 1,
"type": "LAB",
"description": ""
}
},
{
"pk": 16, "pk": 16,
"model": "one.share", "model": "one.share",
"fields": { "fields": {
...@@ -639,97 +599,6 @@ ...@@ -639,97 +599,6 @@
}, },
{ {
"pk": 2, "pk": 2,
"model": "one.disk",
"fields": {
"name": "template-10"
}
},
{
"pk": 3,
"model": "one.disk",
"fields": {
"name": "template-11-298"
}
},
{
"pk": 4,
"model": "one.disk",
"fields": {
"name": "template-12-300"
}
},
{
"pk": 5,
"model": "one.disk",
"fields": {
"name": "template-13-301"
}
},
{
"pk": 6,
"model": "one.disk",
"fields": {
"name": "template-14-303"
}
},
{
"pk": 7,
"model": "one.disk",
"fields": {
"name": "template-15-308"
}
},
{
"pk": 8,
"model": "one.disk",
"fields": {
"name": "template-16-309"
}
},
{
"pk": 9,
"model": "one.disk",
"fields": {
"name": "template-17-310"
}
},
{
"pk": 10,
"model": "one.disk",
"fields": {
"name": "template-19-318"
}
},
{
"pk": 11,
"model": "one.disk",
"fields": {
"name": "template-21-321"
}
},
{
"pk": 12,
"model": "one.disk",
"fields": {
"name": "template-29-326"
}
},
{
"pk": 13,
"model": "one.disk",
"fields": {
"name": "template-31-330"
}
},
{
"pk": 14,
"model": "one.disk",
"fields": {
"name": "template-32-331"
}
},
{
"pk": 2,
"model": "one.network", "model": "one.network",
"fields": { "fields": {
"name": "VM-NET", "name": "VM-NET",
...@@ -789,7 +658,7 @@ ...@@ -789,7 +658,7 @@
"state": "NEW", "state": "NEW",
"owner": 1, "owner": 1,
"disk": 1, "disk": 1,
"public": true, "public": false,
"network": 2 "network": 2
} }
}, },
...@@ -799,98 +668,13 @@ ...@@ -799,98 +668,13 @@
"fields": { "fields": {
"name": "Windows 7", "name": "Windows 7",
"created_at": "2013-01-31T10:11:21Z", "created_at": "2013-01-31T10:11:21Z",
"description": "Ez j\u00f3 cuccos", "description": "",
"system": "Windows 7 Entersp\u00e1jzi 64 bites", "system": "",
"access_type": "rdp", "access_type": "rdp",
"instance_type": 2, "instance_type": 2,
"state": "READY", "state": "NEW",
"owner": 1, "owner": 1,
"disk": 1, "disk": 1,
"public": true,
"network": 2
}
},
{
"pk": 17,
"model": "one.template",
"fields": {
"name": "Ubuntu 12s.04 desktop",
"created_at": "2013-02-10T21:45:05Z",
"description": "",
"system": "",
"access_type": "nx",
"instance_type": 2,
"state": "READY",
"owner": 7,
"disk": 9,
"public": false,
"network": 2
}
},
{
"pk": 19,
"model": "one.template",
"fields": {
"name": "Ubuntu 12.04 desktop a",
"created_at": "2013-02-12T14:45:50Z",
"description": "h",
"system": "",
"access_type": "nx",
"instance_type": 2,
"state": "READY",
"owner": 7,
"disk": 10,
"public": false,
"network": 2
}
},
{
"pk": 21,
"model": "one.template",
"fields": {
"name": "Windows 7asdasd",
"created_at": "2013-02-12T20:31:13Z",
"description": "Ez j\u00f3 cuccos \u00e9s nagy l\u00f3fasz",
"system": "Windows 7 Entersp\u00e1jzi 64 bites",
"access_type": "rdp",
"instance_type": 1,
"state": "READY",
"owner": 7,
"disk": 11,
"public": false,
"network": 2
}
},
{
"pk": 29,
"model": "one.template",
"fields": {
"name": "Ubuntu 12.04 desktop 22",
"created_at": "2013-02-12T23:59:54Z",
"description": "",
"system": "",
"access_type": "nx",
"instance_type": 3,
"state": "READY",
"owner": 7,
"disk": 12,
"public": false,
"network": 2
}
},
{
"pk": 32,
"model": "one.template",
"fields": {
"name": "Windows 7asdasd 30",
"created_at": "2013-02-13T00:40:52Z",
"description": "Ez j\u00f3 cuccos \u00e9s nagy l\u00f3fasz",
"system": "Windows 7 Entersp\u00e1jzi 64 bites",
"access_type": "rdp",
"instance_type": 1,
"state": "READY",
"owner": 7,
"disk": 14,
"public": false, "public": false,
"network": 2 "network": 2
} }
...@@ -916,26 +700,6 @@ ...@@ -916,26 +700,6 @@
} }
}, },
{ {
"pk": 310,
"model": "one.instance",
"fields": {
"name": "test Ubuntu 12s.04 desktop (53)",
"time_of_suspend": null,
"ip": "10.9.1.15",
"created_at": "2013-02-10T21:45:05Z",
"share": null,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 17,
"owner": 7,
"time_of_delete": null,
"one_id": 53,
"pw": "WdwrHAxtPj"
}
},
{
"pk": 312, "pk": 312,
"model": "one.instance", "model": "one.instance",
"fields": { "fields": {
...@@ -956,343 +720,227 @@ ...@@ -956,343 +720,227 @@
} }
}, },
{ {
"pk": 314, "pk": 324,
"model": "one.instance", "model": "one.instance",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (57)", "name": "test Windows 7 (67)",
"time_of_suspend": "2013-02-12T15:00:35Z", "time_of_suspend": "2013-02-13T01:44:44Z",
"ip": "10.9.1.16", "ip": "10.9.1.26",
"created_at": "2013-02-12T19:36:54Z", "created_at": "2013-02-12T22:33:49Z",
"share": 11, "share": null,
"waiting": false, "waiting": false,
"firewall_host": null, "firewall_host": null,
"active_since": null, "active_since": null,
"state": "DONE", "state": "DONE",
"template": 17, "template": 10,
"owner": 7, "owner": 7,
"time_of_delete": "2013-02-27T10:00:35Z", "time_of_delete": "2013-02-27T20:44:44Z",
"one_id": 57, "one_id": 67,
"pw": "YLNvyFBMNa" "pw": "YjQxeHaNkh"
} }
}, },
{ {
"pk": 315, "pk": 1,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (58)", "code": "root",
"time_of_suspend": "2013-02-12T15:01:35Z", "user": null,
"ip": "10.9.1.17", "language": "hu"
"created_at": "2013-02-12T21:57:50Z",
"share": 11,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 17,
"owner": 7,
"time_of_delete": "2013-02-27T10:01:35Z",
"one_id": 58,
"pw": "mfQk6wxMJB"
} }
}, },
{ {
"pk": 316, "pk": 2,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (59)", "code": "bd",
"time_of_suspend": "2013-02-12T15:05:22Z", "user": null,
"ip": "10.9.1.18", "language": "hu"
"created_at": "2013-02-12T22:33:18Z",
"share": 13,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 17,
"owner": 7,
"time_of_delete": "2013-02-27T10:05:22Z",
"one_id": 59,
"pw": "fdrrRxm33W"
} }
}, },
{ {
"pk": 317, "pk": 3,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (60)", "code": "mate",
"time_of_suspend": "2013-02-13T01:14:28Z", "user": null,
"ip": "10.9.1.19", "language": "hu"
"created_at": "2013-02-12T20:43:59Z",
"share": 13,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 17,
"owner": 7,
"time_of_delete": "2013-02-27T20:14:42Z",
"one_id": 60,
"pw": "WZ6pQatURa"
} }
}, },
{ {
"pk": 318, "pk": 4,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12.04 desktop a (61)", "code": "tarokkk",
"time_of_suspend": "2013-02-12T19:45:50Z", "user": null,
"ip": "10.9.1.20", "language": "hu"
"created_at": "2013-02-12T23:25:17Z",
"share": null,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 19,
"owner": 7,
"time_of_delete": "2013-02-27T14:45:50Z",
"one_id": 61,
"pw": "zpYJBjErtQ"
} }
}, },
{ {
"pk": 320, "pk": 5,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (63)", "code": "opennebula",
"time_of_suspend": "2013-02-13T01:30:46Z", "user": null,
"ip": "10.9.1.22", "language": "hu"
"created_at": "2013-02-12T23:36:02Z",
"share": null,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 17,
"owner": 7,
"time_of_delete": "2013-02-27T20:30:46Z",
"one_id": 63,
"pw": "wZRvZZXbxd"
} }
}, },
{ {
"pk": 321, "pk": 6,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Windows 7asdasd (64)", "code": "lennon",
"time_of_suspend": "2013-02-13T01:31:13Z", "user": null,
"ip": "10.9.1.23", "language": "hu"
"created_at": "2013-02-12T23:33:09Z",
"share": null,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 21,
"owner": 7,
"time_of_delete": "2013-02-27T20:31:13Z",
"one_id": 64,
"pw": "6y6Mbh779P"
} }
}, },
{ {
"pk": 324, "pk": 7,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Windows 7 (67)", "code": "test",
"time_of_suspend": "2013-02-13T01:44:44Z", "user": 7,
"ip": "10.9.1.26", "language": "hu"
"created_at": "2013-02-12T22:33:49Z",
"share": null,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 10,
"owner": 7,
"time_of_delete": "2013-02-27T20:44:44Z",
"one_id": 67,
"pw": "YjQxeHaNkh"
} }
}, },
{ {
"pk": 326, "pk": 8,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12.04 desktop 22 (69)", "code": "JI1M92",
"time_of_suspend": "2013-02-13T04:59:54Z", "user": null,
"ip": "10.9.1.27", "language": "hu"
"created_at": "2013-02-12T23:59:54Z", }
"share": null, },
"waiting": false, {
"firewall_host": null, "pk": 9,
"active_since": null, "model": "school.person",
"state": "DONE", "fields": {
"template": 29, "code": "TFDAZ6",
"owner": 7, "user": null,
"time_of_delete": "2013-02-27T23:59:54Z", "language": "hu"
"one_id": 69, }
"pw": "yXuM8pSNCZ" },
{
"pk": 10,
"model": "school.person",
"fields": {
"code": "K7YLW5",
"user": null,
"language": "hu"
}
},
{
"pk": 11,
"model": "school.person",
"fields": {
"code": "UYD1S5",
"user": null,
"language": "hu"
}
},
{
"pk": 12,
"model": "school.person",
"fields": {
"code": "FFRUNU",
"user": null,
"language": "hu"
} }
}, },
{ {
"pk": 328, "pk": 13,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (71)", "code": "HUT3L3",
"time_of_suspend": "2013-02-13T05:14:35Z", "user": null,
"ip": "10.9.1.27", "language": "hu"
"created_at": "2013-02-13T00:15:24Z",
"share": 11,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 17,
"owner": 7,
"time_of_delete": "2013-02-28T00:14:35Z",
"one_id": 71,
"pw": "KmP82kfFp6"
} }
}, },
{ {
"pk": 329, "pk": 14,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12.04 desktop a (72)", "code": "ORL3EA",
"time_of_suspend": "2013-02-13T05:18:34Z", "user": null,
"ip": "10.9.1.27", "language": "hu"
"created_at": "2013-02-13T00:18:59Z",
"share": null,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 19,
"owner": 7,
"time_of_delete": "2013-02-28T00:18:34Z",
"one_id": 72,
"pw": "99czHqQFp6"
} }
}, },
{ {
"pk": 331, "pk": 15,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Windows 7asdasd 30 (74)", "code": "B6AFNQ",
"time_of_suspend": "2013-02-13T05:40:52Z", "user": null,
"ip": "10.9.1.27", "language": "hu"
"created_at": "2013-02-13T00:40:52Z",
"share": null,
"waiting": false,
"firewall_host": null,
"active_since": "2013-02-13T00:42:18Z",
"state": "DONE",
"template": 32,
"owner": 7,
"time_of_delete": "2013-02-28T00:40:52Z",
"one_id": 74,
"pw": "2YPTmTzHsR"
} }
}, },
{ {
"pk": 332, "pk": 16,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (75)", "code": "UKWBFI",
"time_of_suspend": "2013-02-13T05:42:34Z", "user": null,
"ip": "10.9.1.27", "language": "hu"
"created_at": "2013-02-13T00:42:34Z",
"share": 11,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 17,
"owner": 7,
"time_of_delete": "2013-02-28T00:42:34Z",
"one_id": 75,
"pw": "RZfD72Jgmn"
} }
}, },
{ {
"pk": 333, "pk": 17,
"model": "one.instance", "model": "school.person",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (76)", "code": "K2JL24",
"time_of_suspend": "2013-02-13T05:54:47Z", "user": null,
"ip": "10.9.1.28", "language": "hu"
"created_at": "2013-02-13T00:54:47Z",
"share": null,
"waiting": false,
"firewall_host": 843,
"active_since": null,
"state": "DONE",
"template": 17,
"owner": 7,
"time_of_delete": "2013-02-28T00:54:47Z",
"one_id": 76,
"pw": "HnYSzsMxZX"
} }
}, },
{ {
"pk": 347, "pk": 1,
"model": "one.instance", "model": "school.semester",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (79)", "start": "2013-02-01",
"time_of_suspend": null, "end": "2013-06-01",
"ip": "10.9.1.31", "name": "asd"
"created_at": "2013-02-15T23:35:45Z",
"share": 11,
"waiting": false,
"firewall_host": null,
"active_since": null,
"state": "DONE",
"template": 17,
"owner": 7,
"time_of_delete": null,
"one_id": 79,
"pw": "6CaERLLwLg"
} }
}, },
{ {
"pk": 372, "pk": 1,
"model": "one.instance", "model": "school.group",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (104)", "course": null,
"time_of_suspend": "2013-02-19T23:34:19Z", "semester": 1,
"ip": "10.9.1.14", "owners": [],
"created_at": "2013-02-19T18:34:19Z", "name": "asd",
"share": 11, "members": []
"waiting": false,
"firewall_host": 877,
"active_since": null,
"state": "ACTIVE",
"template": 17,
"owner": 7,
"time_of_delete": "2013-03-06T18:34:19Z",
"one_id": 104,
"pw": "U4XAAEhDRT"
} }
}, },
{ {
"pk": 374, "pk": 2,
"model": "one.instance", "model": "school.group",
"fields": { "fields": {
"name": "test Ubuntu 12s.04 desktop (105)", "course": null,
"time_of_suspend": "2013-02-19T23:43:17Z", "semester": 1,
"ip": "10.9.1.15", "owners": [
"created_at": "2013-02-19T18:43:17Z", 7
"share": 13, ],
"waiting": false, "name": "asd",
"firewall_host": 878, "members": [
"active_since": null, 1,
"state": "PENDING", 2,
"template": 17, 3,
"owner": 7, 4,
"time_of_delete": "2013-03-06T18:43:17Z", 5,
"one_id": 105, 6,
"pw": "55W5neEvpx" 7,
8,
9,
10,
11,
12,
13,
14,
15,
16,
17
]
} }
}, },
{ {
...@@ -2371,81 +2019,6 @@ ...@@ -2371,81 +2019,6 @@
} }
}, },
{ {
"pk": 1262,
"model": "firewall.rule",
"fields": {
"r_type": "host",
"direction": "1",
"vlan": null,
"description": "",
"proto": "tcp",
"firewall": null,
"created_at": "2013-02-13T00:54:47Z",
"extra": "",
"modified_at": "2013-02-13T00:54:47Z",
"owner": 7,
"accept": true,
"dport": 22284,
"host": 843,
"nat_dport": 22,
"hostgroup": null,
"nat": true,
"foreign_network": 2,
"sport": null,
"vlangroup": null
}
},
{
"pk": 1263,
"model": "firewall.rule",
"fields": {
"r_type": "host",
"direction": "1",
"vlan": null,
"description": "",
"proto": "tcp",
"firewall": null,
"created_at": "2013-02-19T18:40:00Z",
"extra": "",
"modified_at": "2013-02-19T18:40:00Z",
"owner": 7,
"accept": true,
"dport": 22270,
"host": 877,
"nat_dport": 22,
"hostgroup": null,
"nat": true,
"foreign_network": 2,
"sport": null,
"vlangroup": null
}
},
{
"pk": 1264,
"model": "firewall.rule",
"fields": {
"r_type": "host",
"direction": "1",
"vlan": null,
"description": "",
"proto": "tcp",
"firewall": null,
"created_at": "2013-02-19T18:43:17Z",
"extra": "",
"modified_at": "2013-02-19T18:43:17Z",
"owner": 7,
"accept": true,
"dport": 22271,
"host": 878,
"nat_dport": 22,
"hostgroup": null,
"nat": true,
"foreign_network": 2,
"sport": null,
"vlangroup": null
}
},
{
"pk": 1, "pk": 1,
"model": "firewall.vlan", "model": "firewall.vlan",
"fields": { "fields": {
...@@ -4703,29 +4276,6 @@ ...@@ -4703,29 +4276,6 @@
} }
}, },
{ {
"pk": 843,
"model": "firewall.host",
"fields": {
"comment": "",
"vlan": 10,
"reverse": null,
"created_at": "2013-02-13T00:54:47Z",
"hostname": "id-333_user-test",
"modified_at": "2013-02-13T00:54:47Z",
"location": "",
"pub_ipv4": "152.66.243.62",
"mac": "02:00:0a:09:01:1c",
"shared_ip": true,
"ipv4": "10.9.1.28",
"groups": [
4
],
"ipv6": "2001:738:2001:4031:9:1:28:0",
"owner": 7,
"description": ""
}
},
{
"pk": 846, "pk": 846,
"model": "firewall.host", "model": "firewall.host",
"fields": { "fields": {
...@@ -4909,7 +4459,7 @@ ...@@ -4909,7 +4459,7 @@
"shared_ip": true, "shared_ip": true,
"ipv4": "10.9.1.111", "ipv4": "10.9.1.111",
"groups": [], "groups": [],
"ipv6": "21001:738:2001:4031:9:1:11:0", "ipv6": "2001:738:2001:4031:9:1:111:0",
"owner": 7, "owner": 7,
"description": "" "description": ""
} }
...@@ -4936,52 +4486,6 @@ ...@@ -4936,52 +4486,6 @@
} }
}, },
{ {
"pk": 877,
"model": "firewall.host",
"fields": {
"comment": "",
"vlan": 10,
"reverse": null,
"created_at": "2013-02-19T18:34:19Z",
"hostname": "id-372_user-test",
"modified_at": "2013-02-19T18:34:19Z",
"location": "",
"pub_ipv4": "152.66.243.62",
"mac": "02:00:0a:09:01:0e",
"shared_ip": true,
"ipv4": "10.9.1.14",
"groups": [
4
],
"ipv6": "2001:738:2001:4031:9:1:14:0",
"owner": 7,
"description": ""
}
},
{
"pk": 878,
"model": "firewall.host",
"fields": {
"comment": "",
"vlan": 10,
"reverse": null,
"created_at": "2013-02-19T18:43:17Z",
"hostname": "id-374_user-test",
"modified_at": "2013-02-19T18:43:17Z",
"location": "",
"pub_ipv4": "152.66.243.62",
"mac": "02:00:0a:09:01:0f",
"shared_ip": true,
"ipv4": "10.9.1.15",
"groups": [
4
],
"ipv6": "2001:738:2001:4031:9:1:15:0",
"owner": 7,
"description": ""
}
},
{
"pk": 1, "pk": 1,
"model": "firewall.firewall", "model": "firewall.firewall",
"fields": { "fields": {
...@@ -6357,102 +5861,6 @@ ...@@ -6357,102 +5861,6 @@
} }
}, },
{ {
"pk": 175,
"model": "firewall.record",
"fields": {
"domain": 8,
"name": null,
"created_at": "2013-02-13T00:54:47Z",
"address": null,
"modified_at": "2013-02-13T00:54:47Z",
"host": 843,
"ttl": 600,
"owner": 7,
"type": "A",
"description": ""
}
},
{
"pk": 176,
"model": "firewall.record",
"fields": {
"domain": 8,
"name": null,
"created_at": "2013-02-13T00:54:47Z",
"address": null,
"modified_at": "2013-02-13T00:54:47Z",
"host": 843,
"ttl": 600,
"owner": 7,
"type": "AAAA",
"description": ""
}
},
{
"pk": 177,
"model": "firewall.record",
"fields": {
"domain": 8,
"name": null,
"created_at": "2013-02-19T18:40:00Z",
"address": null,
"modified_at": "2013-02-19T18:40:00Z",
"host": 877,
"ttl": 600,
"owner": 7,
"type": "A",
"description": ""
}
},
{
"pk": 178,
"model": "firewall.record",
"fields": {
"domain": 8,
"name": null,
"created_at": "2013-02-19T18:40:00Z",
"address": null,
"modified_at": "2013-02-19T18:40:00Z",
"host": 877,
"ttl": 600,
"owner": 7,
"type": "AAAA",
"description": ""
}
},
{
"pk": 179,
"model": "firewall.record",
"fields": {
"domain": 8,
"name": null,
"created_at": "2013-02-19T18:43:17Z",
"address": null,
"modified_at": "2013-02-19T18:43:17Z",
"host": 878,
"ttl": 600,
"owner": 7,
"type": "A",
"description": ""
}
},
{
"pk": 180,
"model": "firewall.record",
"fields": {
"domain": 8,
"name": null,
"created_at": "2013-02-19T18:43:17Z",
"address": null,
"modified_at": "2013-02-19T18:43:17Z",
"host": 878,
"ttl": 600,
"owner": 7,
"type": "AAAA",
"description": ""
}
},
{
"pk": 1, "pk": 1,
"model": "south.migrationhistory", "model": "south.migrationhistory",
"fields": { "fields": {
...@@ -6939,6 +6347,15 @@ ...@@ -6939,6 +6347,15 @@
} }
}, },
{ {
"pk": 55,
"model": "south.migrationhistory",
"fields": {
"applied": "2013-02-25T18:31:52Z",
"app_name": "firewall",
"migration": "0028_auto__del_field_vlan_domain"
}
},
{
"pk": 56, "pk": 56,
"model": "south.migrationhistory", "model": "south.migrationhistory",
"fields": { "fields": {
......
...@@ -262,7 +262,7 @@ class Network(models.Model): ...@@ -262,7 +262,7 @@ class Network(models.Model):
return self.name return self.name
@staticmethod @staticmethod
def update(): def update(delete=True):
"""Get and register virtual networks from OpenNebula.""" """Get and register virtual networks from OpenNebula."""
import subprocess import subprocess
proc = subprocess.Popen(["/opt/occi.sh", "network", "list"], proc = subprocess.Popen(["/opt/occi.sh", "network", "list"],
...@@ -282,7 +282,8 @@ class Network(models.Model): ...@@ -282,7 +282,8 @@ class Network(models.Model):
except: except:
Network(id=id, name=name).save() Network(id=id, name=name).save()
l.append(id) l.append(id)
cls.objects.exclude(id__in=l).delete() if delete:
Network.objects.exclude(id__in=l).delete()
class InstanceType(models.Model): class InstanceType(models.Model):
...@@ -575,7 +576,10 @@ class Instance(models.Model): ...@@ -575,7 +576,10 @@ class Instance(models.Model):
if self.firewall_host: if self.firewall_host:
h = self.firewall_host h = self.firewall_host
self.firewall_host = None self.firewall_host = None
try:
self.save() self.save()
except:
pass
h.delete() h.delete()
def _update_vm(self, template): def _update_vm(self, template):
...@@ -633,7 +637,7 @@ class Instance(models.Model): ...@@ -633,7 +637,7 @@ class Instance(models.Model):
def check_if_is_save_as_done(self): def check_if_is_save_as_done(self):
if self.state != 'DONE': if self.state != 'DONE':
return False return False
Disk.update() Disk.update(delete=False)
imgname = "template-%d-%d" % (self.template.id, self.id) imgname = "template-%d-%d" % (self.template.id, self.id)
disks = Disk.objects.filter(name=imgname) disks = Disk.objects.filter(name=imgname)
if len(disks) != 1: if len(disks) != 1:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment