Fix default for --default-iallocator-params
authorKlaus Aehlig <aehlig@google.com>
Wed, 21 Oct 2015 15:36:23 +0000 (17:36 +0200)
committerKlaus Aehlig <aehlig@google.com>
Wed, 21 Oct 2015 15:55:17 +0000 (17:55 +0200)
We need to distinguish between the option not being provided
(i.e., no change requested) and the option being empty (i.e.,
a request to reset the value). Therefore, use None as a default,
not {}.

Signed-off-by: Klaus Aehlig <aehlig@google.com>
Reviewed-by: Hrvoje Ribicic <riba@google.com>

lib/cli.py
lib/client/gnt_cluster.py

index 2eee68b..81e362a 100644 (file)
@@ -942,7 +942,7 @@ DEFAULT_IALLOCATOR_PARAMS_OPT = cli_option("--default-iallocator-params",
                                            " template:option=value,"
                                            " option=value,...",
                                            type="keyval",
-                                           default={})
+                                           default=None)
 
 OS_OPT = cli_option("-o", "--os-type", dest="os", help="What OS to run",
                     metavar="<os>",
index cc4b990..0ee757f 100644 (file)
@@ -1120,7 +1120,7 @@ def SetClusterParams(opts, args):
           opts.add_uids is not None or
           opts.remove_uids is not None or
           opts.default_iallocator is not None or
-          opts.default_iallocator_params or
+          opts.default_iallocator_params is not None or
           opts.reserved_lvs is not None or
           opts.master_netdev is not None or
           opts.master_netmask is not None or