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
do
sudo stop $i || true
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
sudo apt-get install rabbitmq-server
sudo rabbitmqctl delete_user guest || true
sudo rabbitmqctl add_user nyuszi teszt || true
sudo rabbitmqctl add_vhost django || true
sudo rabbitmqctl set_permissions -p django nyuszi '.*' '.*' '.*' || true
#Set up store server
rm -rf /var/www/*
......@@ -44,6 +42,18 @@ do
sudo start $i
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
sudo cp vimrc.local /etc/vim/vimrc.local
......@@ -59,9 +69,3 @@ git config --global core.editor vim
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):
return self.name
@staticmethod
def update():
def update(delete=True):
"""Get and register virtual networks from OpenNebula."""
import subprocess
proc = subprocess.Popen(["/opt/occi.sh", "network", "list"],
......@@ -282,7 +282,8 @@ class Network(models.Model):
except:
Network(id=id, name=name).save()
l.append(id)
cls.objects.exclude(id__in=l).delete()
if delete:
Network.objects.exclude(id__in=l).delete()
class InstanceType(models.Model):
......@@ -575,7 +576,10 @@ class Instance(models.Model):
if self.firewall_host:
h = self.firewall_host
self.firewall_host = None
self.save()
try:
self.save()
except:
pass
h.delete()
def _update_vm(self, template):
......@@ -633,7 +637,7 @@ class Instance(models.Model):
def check_if_is_save_as_done(self):
if self.state != 'DONE':
return False
Disk.update()
Disk.update(delete=False)
imgname = "template-%d-%d" % (self.template.id, self.id)
disks = Disk.objects.filter(name=imgname)
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