On 12/02/2014 03:32 PM, 'Klaus Aehlig' via ganeti-devel wrote:
Add a function recursively removing the forthcoming
flag of a list of disk objects. In this way, when disks
are committed, all parameters can be preserved.
Signed-off-by: Klaus Aehlig <[email protected]>
---
lib/cmdlib/instance_storage.py | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/lib/cmdlib/instance_storage.py b/lib/cmdlib/instance_storage.py
index c5258ae..5d1741e 100644
--- a/lib/cmdlib/instance_storage.py
+++ b/lib/cmdlib/instance_storage.py
@@ -696,6 +696,15 @@ def GenerateDiskTemplate(
return disks
+def CommitDisks(disks):
+ """Recursively remove the forthcoming flag
+
+ """
+ for disk in disks:
+ disk.forthcoming = False
+ CommitDisks(disk.children)
+
+
def CheckSpindlesExclusiveStorage(diskdict, es_flag, required):
"""Check the presence of the spindle options with exclusive_storage.
LGTM
--
Niklas Hambüchen
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores