From b87a9c5fdd0aa5c6838288704c306f3baa429dca Mon Sep 17 00:00:00 2001
From: Christos Stavrakakis <cstavr@grnet.gr>
Date: Thu, 4 Apr 2013 11:51:13 +0300
Subject: [PATCH] Add Disks and NICs to _AllUUIDObjects

Since disks and NICs have UUIDs, they must be considered
to _AllUUIDObjects.

Signed-off-by: Christos Stavrakakis <cstavr@grnet.gr>
Signed-off-by: Dimitris Aragiorgis <dimara@grnet.gr>
Reviewed-by: Helga Velroyen <helgav@google.com>
---
 lib/config.py | 20 ++++++++++++++++++++
 1 file changed, 20 insertions(+)

diff --git a/lib/config.py b/lib/config.py
index 050cdacef..6c829917a 100644
--- a/lib/config.py
+++ b/lib/config.py
@@ -445,6 +445,24 @@ class ConfigWriter:
         lvnames.update(lv_list)
     return lvnames
 
+  def _AllDisks(self):
+    """Compute the list of all Disks.
+
+    """
+    disks = []
+    for instance in self._config_data.instances.values():
+      disks.extend(instance.disks)
+    return disks
+
+  def _AllNICs(self):
+    """Compute the list of all NICs.
+
+    """
+    nics = []
+    for instance in self._config_data.instances.values():
+      nics.extend(instance.nics)
+    return nics
+
   def _AllIDs(self, include_temporary):
     """Compute the list of all UUIDs and names we have.
 
@@ -2038,6 +2056,8 @@ class ConfigWriter:
             self._config_data.nodes.values() +
             self._config_data.nodegroups.values() +
             self._config_data.networks.values() +
+            self._AllDisks() +
+            self._AllNICs() +
             [self._config_data.cluster])
 
   def _OpenConfig(self, accept_foreign):
-- 
GitLab