From f7c8f153b6340d03686a942665649933d0af677f Mon Sep 17 00:00:00 2001
From: Michael Hanselmann <hansmi@google.com>
Date: Wed, 5 Jan 2011 17:45:54 +0100
Subject: [PATCH] Fix OpSetInstanceParams.disk_template check

When moving the opcode parameters I moved two or three checks from an
opcode's CheckArguments function to the type checks. This was one of
them and unfortunately I didn't notice the parameter can be None.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Iustin Pop <iustin@google.com>
---
 lib/opcodes.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/opcodes.py b/lib/opcodes.py
index 927b0788c..e15716625 100644
--- a/lib/opcodes.py
+++ b/lib/opcodes.py
@@ -990,7 +990,7 @@ class OpSetInstanceParams(OpCode):
     ("disks", ht.EmptyList, ht.TList),
     ("beparams", ht.EmptyDict, ht.TDict),
     ("hvparams", ht.EmptyDict, ht.TDict),
-    ("disk_template", None, _CheckDiskTemplate),
+    ("disk_template", None, ht.TOr(ht.TNone, _CheckDiskTemplate)),
     ("remote_node", None, ht.TMaybeString),
     ("os_name", None, ht.TMaybeString),
     ("force_variant", False, ht.TBool),
-- 
GitLab