mirror of
https://github.com/retspen/webvirtcloud
synced 2024-12-25 23:55:24 +00:00
commit
0e858a7eb6
3 changed files with 10 additions and 3 deletions
|
@ -41,7 +41,9 @@
|
||||||
<tr host="{{ compute.id }}">
|
<tr host="{{ compute.id }}">
|
||||||
<td class="text-right">{{ forloop.counter }} </td>
|
<td class="text-right">{{ forloop.counter }} </td>
|
||||||
<td>
|
<td>
|
||||||
<a class="text-secondary" href="{% url 'instances:instance' instance.id %}">{{ instance.name }}</a><br>
|
<a class="text-secondary" href="{% url 'instances:instance' instance.id %}">{{ instance.name }}</a>
|
||||||
|
<br>
|
||||||
|
<p class="m-0 small font-italic">{{ instance.title }}</p>
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<em>
|
<em>
|
||||||
|
|
|
@ -19,8 +19,9 @@
|
||||||
<td>
|
<td>
|
||||||
<a class="text-secondary" href="{% url 'instances:instance' instance.id %}">
|
<a class="text-secondary" href="{% url 'instances:instance' instance.id %}">
|
||||||
{{ instance.name }}
|
{{ instance.name }}
|
||||||
</a><br>
|
</a>
|
||||||
<small><em>{{ instance.title }}</em></small>
|
<br>
|
||||||
|
<p class="m-0 small font-italic">{{ instance.title }}</p>
|
||||||
</td>
|
</td>
|
||||||
{% if request.user.is_superuser %}
|
{% if request.user.is_superuser %}
|
||||||
<td>
|
<td>
|
||||||
|
|
|
@ -173,9 +173,13 @@ def refr(compute):
|
||||||
Instance.objects.filter(compute=compute).exclude(name__in=domain_names).delete()
|
Instance.objects.filter(compute=compute).exclude(name__in=domain_names).delete()
|
||||||
# Create instances that're not in DB
|
# Create instances that're not in DB
|
||||||
names = Instance.objects.filter(compute=compute).values_list('name', flat=True)
|
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:
|
for domain in domains:
|
||||||
if domain.name() not in names:
|
if domain.name() not in names:
|
||||||
Instance(compute=compute, name=domain.name(), uuid=domain.UUIDString()).save()
|
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):
|
def get_dhcp_mac_address(vname):
|
||||||
|
|
Loading…
Reference in a new issue