From 4d487104f8b391985ad969880bb9a9284d66fea1 Mon Sep 17 00:00:00 2001 From: Chance Zibolski Date: Mon, 29 Jul 2013 13:51:42 -0700 Subject: [PATCH] Cluster sync methods now call refresh on nodes and vms sync_nodes and sync_virtual_machines previously only synced missing or extra items from the database. Now it also refreshes the data on all vms/nodes. refs #14127 --- ganeti_web/models.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/ganeti_web/models.py b/ganeti_web/models.py index fc60221f..b43dad41 100644 --- a/ganeti_web/models.py +++ b/ganeti_web/models.py @@ -1278,6 +1278,13 @@ class Cluster(CachedClusterObject): self.virtual_machines \ .filter(hostname__in=missing_ganeti).delete() + # Get up to date data on all VMs + self.refresh_virtual_machines() + + def refresh_virtual_machines(self): + for vm in self.virtual_machines.all(): + vm.refresh() + def sync_nodes(self, remove=False): """ Synchronizes the Nodes in the database with the information @@ -1299,6 +1306,13 @@ class Cluster(CachedClusterObject): if missing_ganeti: self.nodes.filter(hostname__in=missing_ganeti).delete() + # Get up to date data for all Nodes + self.refresh_nodes() + + def refresh_nodes(self): + for node in self.nodes.all(): + node.refresh() + @property def missing_in_ganeti(self): """ -- 2.11.4.GIT