From bd44b03bb086e9b3ee14efe9707c48321214c114 Mon Sep 17 00:00:00 2001 From: catborise Date: Tue, 1 Dec 2020 09:46:00 +0300 Subject: [PATCH 1/2] add missing instance title for grouped instances list --- instances/templates/allinstances_index_grouped.html | 4 +++- instances/templates/allinstances_index_nongrouped.html | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/instances/templates/allinstances_index_grouped.html b/instances/templates/allinstances_index_grouped.html index b441829..f1d9440 100644 --- a/instances/templates/allinstances_index_grouped.html +++ b/instances/templates/allinstances_index_grouped.html @@ -41,7 +41,9 @@ {{ forloop.counter }} - {{ instance.name }}
+ {{ instance.name }} +
+

{{ instance.title }}

diff --git a/instances/templates/allinstances_index_nongrouped.html b/instances/templates/allinstances_index_nongrouped.html index 03e3331..cde9d77 100644 --- a/instances/templates/allinstances_index_nongrouped.html +++ b/instances/templates/allinstances_index_nongrouped.html @@ -19,8 +19,9 @@ {{ instance.name }} -
- {{ instance.title }} + +
+

{{ instance.title }}

{% if request.user.is_superuser %} From 993a247228c6af26ef0baf3f2212c0550af5ab27 Mon Sep 17 00:00:00 2001 From: catborise Date: Tue, 15 Dec 2020 11:39:58 +0300 Subject: [PATCH 2/2] update uuid number if it is changed to fix console view error --- instances/utils.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/instances/utils.py b/instances/utils.py index 7624bab..365ade7 100644 --- a/instances/utils.py +++ b/instances/utils.py @@ -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):