Fix non-drbd instance creation
authorIustin Pop <iustin@google.com>
Mon, 19 Jan 2009 14:32:21 +0000 (14:32 +0000)
committerIustin Pop <iustin@google.com>
Mon, 19 Jan 2009 14:32:21 +0000 (14:32 +0000)
Commit 2294 introduced a new instance.all_nodes property, which
unfortunately is working incorrectly for non-drbd instances.

This patch fixes it by making sure the primary node is always added to
the set, even before recursing over (any potential) children.

Reviewed-by: imsnah

lib/objects.py

index 26facb6..551ead6 100644 (file)
@@ -548,6 +548,7 @@ class Instance(TaggableObject):
           _Helper(nodes, child)
 
     all_nodes = set()
+    all_nodes.add(self.primary_node)
     for device in self.disks:
       _Helper(all_nodes, device)
     return tuple(all_nodes)