Make ipolicy violations a warning
authorHelga Velroyen <helgav@google.com>
Wed, 21 Nov 2012 17:55:50 +0000 (18:55 +0100)
committerHelga Velroyen <helgav@google.com>
Thu, 22 Nov 2012 11:40:21 +0000 (12:40 +0100)
So far, when running 'gnt-cluster verify' on a cluster which
has instances that violate the instance policy, those
violations were shown as an error. This patch makes them a
warning.

Signed-off-by: Helga Velroyen <helgav@google.com>
Reviewed-by: Iustin Pop <iusin@google.com>

lib/cmdlib.py

index 57746f7..2f3aab7 100644 (file)
@@ -2550,7 +2550,8 @@ class LUClusterVerifyGroup(LogicalUnit, _VerifyErrors):
     ipolicy = ganeti.masterd.instance.CalculateGroupIPolicy(cluster,
                                                             self.group_info)
     err = _ComputeIPolicyInstanceViolation(ipolicy, instanceconfig)
-    _ErrorIf(err, constants.CV_EINSTANCEPOLICY, instance, utils.CommaJoin(err))
+    _ErrorIf(err, constants.CV_EINSTANCEPOLICY, instance, utils.CommaJoin(err),
+             code=self.ETYPE_WARNING)
 
     for node in node_vol_should:
       n_img = node_image[node]