diff --git a/crmsh/constants.py b/crmsh/constants.py index b44875ea8..a89fbd334 100644 --- a/crmsh/constants.py +++ b/crmsh/constants.py @@ -511,6 +511,8 @@ RSC_ROLE_PROMOTED_LEGACY = "Master" RSC_ROLE_UNPROMOTED_LEGACY = "Slave" PCMK_VERSION_DEFAULT = "2.0.0" +# pacemaker 2.1.8 introduced `crm_attribute --list-options` +PCMK_MIN_VERSION_SUPPORT_LIST_OPTIONS = "2.1.8" COROSYNC_STATUS_TYPES = ("ring", "quorum", "qdevice", "qnetd", "cpg") diff --git a/crmsh/ui_ra.py b/crmsh/ui_ra.py index 2704d1cfa..5a2737a04 100644 --- a/crmsh/ui_ra.py +++ b/crmsh/ui_ra.py @@ -9,6 +9,10 @@ from . import ra from . import constants from . import options +from . import log + + +logger = log.setup_logger(__name__) def complete_class_provider_type(args): @@ -120,6 +124,13 @@ def do_info(self, context, *args): else: ra_type, ra_class, ra_provider = args[0], args[1], args[2] elif args[0] in constants.meta_progs: + if utils.is_min_pcmk_ver(constants.PCMK_MIN_VERSION_SUPPORT_LIST_OPTIONS): + if args[0] == "stonithd": + alternative = r"`crm ra info pacemaker-fenced`" + else: + alternative = r"`crm configure property --help`" + warning_msg = f"`crm ra info {args[0]}` is deprecated and is replaced by {alternative} going forward." + logger.warning(warning_msg) ra_class, ra_provider, ra_type = args[0], None, None elif args[0] in constants.meta_progs_20: ra_class, ra_provider, ra_type = args[0], None, None