Commit acdf8145 by Őry Máté

django: remove update_state calls (temp. fix??)

parent b9e6d1b4
......@@ -236,7 +236,7 @@ class Host(models.Model):
res = self.record_set.filter(type='A')
return unicode(res[0].get_data()['name'])
except:
raise
# raise
if self.shared_ip:
return self.pub_ipv4
else:
......
......@@ -66,19 +66,16 @@ submit_vm.short_description = _('Submit VM')
def delete_vm(modeladmin, request, queryset):
for i in queryset.exclude(state='DONE').all():
i.one_delete()
i.update_state()
delete_vm.short_description = _('Delete VM')
def suspend_vm(modeladmin, request, queryset):
for i in queryset.filter(state='ACTIVE').all():
i.stop()
i.update_state()
suspend_vm.short_description = _('Suspend VM')
def resume_vm(modeladmin, request, queryset):
for i in queryset.filter(state__in=('STOPPED', 'SUSPENDED')).all():
i.resume()
i.update_state()
resume_vm.short_description = _('Resume VM')
......
......@@ -7,6 +7,6 @@ class Job(HourlyJob):
def execute(self):
Disk.update()
Network.update()
for i in Instance.objects.filter(state__in=['ACTIVE', 'STOPPED'], time_of_delete__isnull=False):
i.update_state()
# for i in Instance.objects.filter(state__in=['ACTIVE', 'STOPPED'], time_of_delete__isnull=False):
# i.update_state()
pass
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