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 '.*' '.*' '.*'
...@@ -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