On Thu, Dec 8, 2011 at 9:32 AM, Iustin Pop <[email protected]> wrote:
> On Tue, Dec 06, 2011 at 06:52:18PM +0100, Agata Murawska wrote:
>> Adding new group now allows to take instance policy specs as arguments.
>> Again, sanity checks are preformed.
>
> Typo or… ?
Typo :)

>
> LGTM, thanks.
>
> iustin

Yet another interdiff, yet another change due to previous changes

diff --git a/lib/client/gnt_group.py b/lib/client/gnt_group.py
index 73fc31c..178fda5 100644
--- a/lib/client/gnt_group.py
+++ b/lib/client/gnt_group.py
@@ -48,13 +48,13 @@ def AddGroup(opts, args):
   @return: the desired exit code

   """
-  ipolicy = objects.CreateIPolicyFromOpts(
-    mem_count_ispecs=opts.mem_count_ispecs,
-    cpu_count_ispecs=opts.cpu_count_ispecs,
-    disk_count_ispecs=opts.disk_count_ispecs,
-    disk_size_ispecs=opts.disk_size_ispecs,
-    nic_count_ispecs=opts.nic_count_ispecs,
-    group_ipolicy=True)
+  ipolicy = \
+    objects.CreateIPolicyFromOpts(ispecs_mem_size=opts.ispecs_mem_size,
+                                  ispecs_cpu_count=opts.ispecs_cpu_count,
+                                  ispecs_disk_count=opts.ispecs_disk_count,
+                                  ispecs_disk_size=opts.ispecs_disk_size,
+                                  ispecs_nic_count=opts.ispecs_nic_count,
+                                  group_ipolicy=True)
   for key in ipolicy.keys():
     utils.ForceDictType(ipolicy[key], constants.ISPECS_PARAMETER_TYPES)

@@ -236,13 +236,19 @@ def EvacuateGroup(opts, args):

   return rcode

+INSTANCE_POLICY_OPTS = [
+  SPECS_CPU_COUNT_OPT,
+  SPECS_DISK_COUNT_OPT,
+  SPECS_DISK_SIZE_OPT,
+  SPECS_MEM_SIZE_OPT,
+  SPECS_NIC_COUNT_OPT,
+  ]

 commands = {
   "add": (
-    AddGroup, ARGS_ONE_GROUP, [DRY_RUN_OPT, ALLOC_POLICY_OPT, DISK_PARAMS_OPT,
-                               MEM_COUNT_SPECS_OPT, CPU_COUNT_SPECS_OPT,
-                               DISK_COUNT_SPECS_OPT, DISK_SIZE_SPECS_OPT,
-                               NIC_COUNT_SPECS_OPT, NODE_PARAMS_OPT],
+    AddGroup, ARGS_ONE_GROUP,
+    [DRY_RUN_OPT, ALLOC_POLICY_OPT, NODE_PARAMS_OPT, DISK_PARAMS_OPT] +
+    INSTANCE_POLICY_OPTS,
     "<group_name>", "Add a new node group to the cluster"),
   "assign-nodes": (
     AssignNodes, ARGS_ONE_GROUP + ARGS_MANY_NODES, [DRY_RUN_OPT, FORCE_OPT],

Agata

Reply via email to