1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2024-12-24 23:25:24 +00:00

update uuid number if it is changed to fix console view error

This commit is contained in:
catborise 2020-12-15 11:39:58 +03:00
parent bd44b03bb0
commit 993a247228

View file

@ -173,9 +173,13 @@ def refr(compute):
Instance.objects.filter(compute=compute).exclude(name__in=domain_names).delete()
# Create instances that're not in DB
names = Instance.objects.filter(compute=compute).values_list('name', flat=True)
uuids = Instance.objects.filter(compute=compute).values_list('uuid', flat=True)
for domain in domains:
if domain.name() not in names:
Instance(compute=compute, name=domain.name(), uuid=domain.UUIDString()).save()
continue
if domain.UUIDString() not in uuids:
Instance(compute=compute, name=domain.name(), uuid=domain.UUIDString()).save()
def get_dhcp_mac_address(vname):