Watcher: Use hvparams when listing instances
authorHelga Velroyen <helgav@google.com>
Wed, 5 Jun 2013 15:15:49 +0000 (17:15 +0200)
committerHelga Velroyen <helgav@google.com>
Wed, 12 Jun 2013 07:17:50 +0000 (09:17 +0200)
This patch makes the watcher use the hvparams from ssconf
to retrieve the list of instances from the hypervisors.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Thomas Thrainer <thomasth@google.com>

lib/watcher/nodemaint.py

index b9ca7e9..8228a7c 100644 (file)
@@ -64,11 +64,12 @@ class NodeMaintenance(object):
 
     """
     hyp_list = ssconf.SimpleStore().GetHypervisorList()
+    hvparams = ssconf.SimpleStore().GetHvparams()
     results = []
     for hv_name in hyp_list:
       try:
         hv = hypervisor.GetHypervisor(hv_name)
-        ilist = hv.ListInstances()
+        ilist = hv.ListInstances(hvparams=hvparams)
         results.extend([(iname, hv_name) for iname in ilist])
       except: # pylint: disable=W0702
         logging.error("Error while listing instances for hypervisor %s",