Fix validation of vgname in OpClusterSetParams
authorIustin Pop <iustin@google.com>
Tue, 30 Oct 2012 11:53:26 +0000 (12:53 +0100)
committerIustin Pop <iustin@google.com>
Tue, 30 Oct 2012 12:17:26 +0000 (13:17 +0100)
This variable can be empty, when we want to disable LVM, so we can't
use TMaybeString.

Fixes issue 285.

Signed-off-by: Iustin Pop <iustin@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/opcodes.py

index 3243e0e..17bdc25 100644 (file)
@@ -823,7 +823,7 @@ class OpClusterSetParams(OpCode):
   OP_PARAMS = [
     _PHvState,
     _PDiskState,
-    ("vg_name", None, ht.TMaybeString, "Volume group name"),
+    ("vg_name", None, ht.TOr(ht.TString, ht.TNone), "Volume group name"),
     ("enabled_hypervisors", None,
      ht.TOr(ht.TAnd(ht.TListOf(ht.TElemOf(constants.HYPER_TYPES)), ht.TTrue),
             ht.TNone),