diff --git a/crmsh/constants.py b/crmsh/constants.py index 89686aa83..f8d14c3f9 100644 --- a/crmsh/constants.py +++ b/crmsh/constants.py @@ -453,4 +453,6 @@ PCMK_SERVICE = "pacemaker.service" SBD_SERVICE = "sbd.service" + +SANITY_FATAL_RC = 100 # vim:ts=4:sw=4:et: diff --git a/crmsh/ra.py b/crmsh/ra.py index 621e371d6..3f6395d08 100644 --- a/crmsh/ra.py +++ b/crmsh/ra.py @@ -592,8 +592,8 @@ def sanity_check_op(op, op_dict): if self.ra_class == "stonith" and op in ("start", "stop"): return rc if op not in self.actions(): - logger.warning("%s: action '%s' not found in Resource Agent meta-data", ident, op) - rc |= 1 + logger.error("Action '%s' not found in Resource Agent meta-data", op) + rc |= constants.SANITY_FATAL_RC return rc rc |= sanity_check_op_interval(op, op_dict) rc |= sanity_check_op_timeout(op, op_dict) diff --git a/crmsh/ui_configure.py b/crmsh/ui_configure.py index 1812cfa09..e74d6b20a 100644 --- a/crmsh/ui_configure.py +++ b/crmsh/ui_configure.py @@ -744,6 +744,8 @@ def _verify(self, set_obj_semantic, set_obj_all): rc1 = set_obj_all.verify() if config.core.check_frequency != "never": rc2 = set_obj_semantic.semantic_check(set_obj_all) + if rc2 >= constants.SANITY_FATAL_RC: + cib_factory.reset() else: rc2 = 0 return rc1 and rc2 <= 1 @@ -926,6 +928,8 @@ def _commit(self, force=False, replace=False): rc2 = self._verify(mkset_obj("xml", "changed"), mkset_obj("xml")) if rc1 and rc2: return cib_factory.commit(replace=replace) + if not cib_factory.has_cib_changed(): + return False if force or config.core.force: logger.info("commit forced") return cib_factory.commit(force=True, replace=replace)