update.py 389 Bytes
Newer Older
Őry Máté committed
1 2 3 4
from one.models import *
from django_extensions.management.jobs import HourlyJob

class Job(HourlyJob):
Bach Dániel committed
5
    help = "Update Disks, Networks and Instances from OpenNebula."
Őry Máté committed
6 7 8 9

    def execute(self):
        Disk.update()
        Network.update()
Bach Dániel committed
10 11
        for i in Instance.objects.filter(state__in=['ACTIVE', 'STOPPED'], time_of_delete__isnull=False):
            i.update_state()
Őry Máté committed
12
        pass