Fix lint error about too many variables
authorHelga Velroyen <helgav@google.com>
Wed, 21 Nov 2012 10:35:18 +0000 (11:35 +0100)
committerIustin Pop <iustin@google.com>
Wed, 21 Nov 2012 10:53:12 +0000 (11:53 +0100)
Lint complains about too many variables in the CheckPrereq
method. While I think that this method/class would need
some refactoring in general, at least this patch makes lint
shut up for now.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Michele Tartara <mtartara@google.com>
Signed-off-by: Iustin Pop <iustin@google.com>

lib/cmdlib.py

index 29b527f..163baad 100644 (file)
@@ -13346,11 +13346,11 @@ class LUInstanceSetParams(LogicalUnit):
       res_min = _ComputeIPolicyInstanceSpecViolation(ipolicy, ispec_min)
 
       if (res_max or res_min):
-        res = set(res_max + res_min)
         # FIXME: Improve error message by including information about whether
         # the upper or lower limit of the parameter fails the ipolicy.
         msg = ("Instance allocation to group %s (%s) violates policy: %s" %
-               (group_info, group_info.name, utils.CommaJoin(res)))
+               (group_info, group_info.name,
+                utils.CommaJoin(set(res_max + res_min))))
         raise errors.OpPrereqError(msg, errors.ECODE_INVAL)
 
   def _ConvertPlainToDrbd(self, feedback_fn):