Commit 980d1330 authored by Andrea Spadaccini's avatar Andrea Spadaccini
Browse files

Demote to warnings the errors in --ignore-errors

Treat the gnt-cluster verify errors identified by the error codes in
--ignore-errors as warnings; just print a warning message for the user.
Signed-off-by: default avatarAndrea Spadaccini <>
Reviewed-by: default avatarMichael Hanselmann <>
parent 93f2399e
......@@ -1464,14 +1464,22 @@ class _VerifyErrors(object):
# and finally report it via the feedback_fn
self._feedback_fn(" - %s" % msg) # Mix-in. pylint: disable=E1101
def _ErrorIf(self, cond, *args, **kwargs):
def _ErrorIf(self, cond, ecode, *args, **kwargs):
"""Log an error message if the passed condition is True.
cond = (bool(cond)
or self.op.debug_simulate_errors) # pylint: disable=E1101
# If the error code is in the list of ignored errors, demote the error to a
# warning
(_, etxt) = ecode
if etxt in self.op.ignore_errors: # pylint: disable=E1101
kwargs[self.ETYPE_FIELD] = self.ETYPE_WARNING
if cond:
self._Error(*args, **kwargs)
self._Error(ecode, *args, **kwargs)
# do not mark the operation as failed for WARN cases only
if kwargs.get(self.ETYPE_FIELD, self.ETYPE_ERROR) == self.ETYPE_ERROR:
self.bad = self.bad or cond
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment