On 12/04/2014 05:20 PM, 'Klaus Aehlig' via ganeti-devel wrote:
....to the new interface of ComputeIPolicySpecViolation.
This is, again, a semantic conflict introduced by the
last merge.

Signed-off-by: Klaus Aehlig <[email protected]>
---
  lib/cmdlib/common.py | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/cmdlib/common.py b/lib/cmdlib/common.py
index ed1f03f..d7a095f 100644
--- a/lib/cmdlib/common.py
+++ b/lib/cmdlib/common.py
@@ -622,12 +622,15 @@ def ComputeIPolicyDiskSizesViolation(ipolicy, disk_sizes,
    @return: A list of violations, or an empty list of no violations are found

    """
+  if disk_template != constants.DT_DISKLESS and disk_sizes == []:
+    return [constants.ISPEC_DISK_COUNT]
+  disk_templates = map (lambda _ : disk_template, disk_sizes)

Pylint might complain about the " " before the ":".

    return ComputeIPolicySpecViolation(ipolicy,
                                       # mem_size, cpu_count, disk_count
                                       None, None, len(disk_sizes),
                                       None, disk_sizes, # nic_count, disk_sizes
                                       None, # spindle_use
-                                     disk_template,
+                                     disk_templates,
                                       _compute_fn=_compute_fn)




LGTM, no need to resend

--
Niklas Hambüchen
Google Germany GmbH, Dienerstr. 12, 80331 Muenchen
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg
Geschaeftsfuehrer: Graham Law, Christine Elizabeth Flores

Reply via email to