"DEFAULT_IALLOCATOR_OPT",
"IDENTIFY_DEFAULTS_OPT",
"IGNORE_CONSIST_OPT",
+ "IGNORE_ERRORS_OPT",
"IGNORE_FAILURES_OPT",
"IGNORE_OFFLINE_OPT",
"IGNORE_REMOVE_FAILURES_OPT",
default=None, action="append",
completion_suggest=OPT_COMPL_ONE_NODEGROUP)
+IGNORE_ERRORS_OPT = cli_option("-I", "--ignore-errors", default=[],
+ action="append", dest="ignore_errors",
+ choices=list(constants.CV_ALL_ECODES_STRINGS),
+ help="Error code to be ignored")
+
#: Options provided by all commands
COMMON_OPTS = [DEBUG_OPT]
error_codes=opts.error_codes,
debug_simulate_errors=opts.simulate_errors,
skip_checks=skip_checks,
+ ignore_errors=opts.ignore_errors,
group_name=opts.nodegroup)
result = SubmitOpCode(op, cl=cl, opts=opts)
"verify": (
VerifyCluster, ARGS_NONE,
[VERBOSE_OPT, DEBUG_SIMERR_OPT, ERROR_CODES_OPT, NONPLUS1_OPT,
- DRY_RUN_OPT, PRIORITY_OPT, NODEGROUP_OPT],
+ DRY_RUN_OPT, PRIORITY_OPT, NODEGROUP_OPT, IGNORE_ERRORS_OPT],
"", "Does a check on the cluster configuration"),
"verify-disks": (
VerifyDisks, ARGS_NONE, [PRIORITY_OPT],
groups = self.cfg.GetNodeGroupList()
# Verify global configuration
- jobs.append([opcodes.OpClusterVerifyConfig()])
+ jobs.append([
+ opcodes.OpClusterVerifyConfig(ignore_errors=self.op.ignore_errors)
+ ])
# Always depend on global verification
depends_fn = lambda: [(-len(jobs), [])]
jobs.extend([opcodes.OpClusterVerifyGroup(group_name=group,
- depends=depends_fn())]
+ ignore_errors=self.op.ignore_errors,
+ depends=depends_fn())]
for group in groups)
# Fix up all parameters
_PSkipChecks = ("skip_checks", ht.EmptyList,
ht.TListOf(ht.TElemOf(constants.VERIFY_OPTIONAL_CHECKS)),
"Which checks to skip")
+_PIgnoreErrors = ("ignore_errors", ht.EmptyList,
+ ht.TListOf(ht.TElemOf(constants.CV_ALL_ECODES_STRINGS)),
+ "List of error codes that should be treated as warnings")
#: OP_ID conversion regular expression
_OPID_RE = re.compile("([a-z])([A-Z])")
_PDebugSimulateErrors,
_PErrorCodes,
_PSkipChecks,
+ _PIgnoreErrors,
_PVerbose,
("group_name", None, ht.TMaybeString, "Group to verify")
]
OP_PARAMS = [
_PDebugSimulateErrors,
_PErrorCodes,
+ _PIgnoreErrors,
_PVerbose,
]
OP_RESULT = ht.TBool
_PDebugSimulateErrors,
_PErrorCodes,
_PSkipChecks,
+ _PIgnoreErrors,
_PVerbose,
]
OP_RESULT = ht.TBool