Fix passing of ispecs in cluster init during QA
authorThomas Thrainer <thomasth@google.com>
Mon, 12 May 2014 08:28:12 +0000 (10:28 +0200)
committerThomas Thrainer <thomasth@google.com>
Mon, 12 May 2014 10:49:34 +0000 (12:49 +0200)
The ispecs were previously passed as multiple parameters to gnt-cluster
init, which did not yield the desired result. This patch changes this
behavior and passes the min/std/max values in one parameter.

Signed-off-by: Thomas Thrainer <thomasth@google.com>
Reviewed-by: Klaus Aehlig <aehlig@google.com>

qa/qa_cluster.py

index a67eec0..5ab96c2 100644 (file)
@@ -192,11 +192,14 @@ def TestClusterInit(rapi_user, rapi_secret):
 
   for spec_type in ("mem-size", "disk-size", "disk-count", "cpu-count",
                     "nic-count"):
+    spec_values = []
     for spec_val in ("min", "max", "std"):
       spec = qa_config.get("ispec_%s_%s" %
                            (spec_type.replace("-", "_"), spec_val), None)
       if spec is not None:
-        cmd.append("--specs-%s=%s=%d" % (spec_type, spec_val, spec))
+        spec_values.append("%s=%d" % (spec_val, spec))
+    if spec_values:
+      cmd.append("--specs-%s=%s" % (spec_type, ",".join(spec_values)))
 
   if master.secondary:
     cmd.append("--secondary-ip=%s" % master.secondary)