From 098c05cf7905359dbc81029662066ce01d4975ea Mon Sep 17 00:00:00 2001 From: xin liang Date: Tue, 21 Oct 2025 22:10:05 +0800 Subject: [PATCH 1/2] Dev: ui_cluster: Hint the watchdog option should be used with sbd option --- crmsh/bootstrap.py | 3 +++ crmsh/ui_cluster.py | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/crmsh/bootstrap.py b/crmsh/bootstrap.py index ec0022f3d..674325672 100644 --- a/crmsh/bootstrap.py +++ b/crmsh/bootstrap.py @@ -210,6 +210,9 @@ def _validate_sbd_option(self): """ Validate sbd options """ + no_sbd_option = not self.sbd_devices and not self.diskless_sbd + if self.watchdog and no_sbd_option: + utils.fatal("-w option should be used with -s or -S option") if self.sbd_devices and self.diskless_sbd: utils.fatal("Can't use -s and -S options together") if self.stage == "sbd": diff --git a/crmsh/ui_cluster.py b/crmsh/ui_cluster.py index 47aa029eb..676023e7e 100644 --- a/crmsh/ui_cluster.py +++ b/crmsh/ui_cluster.py @@ -438,7 +438,7 @@ def do_init(self, context, *args): parser.add_argument("-S", "--enable-sbd", dest="diskless_sbd", action="store_true", help="Enable SBD even if no SBD device is configured (diskless mode)") parser.add_argument("-w", "--watchdog", dest="watchdog", metavar="WATCHDOG", - help="Use the given watchdog device or driver name") + help="Use the given watchdog device or driver name (only valid together with -s or -S option)") parser.add_argument("-x", "--skip-csync2-sync", dest="skip_csync2", action="store_true", help="Skip csync2 initialization (an experimental option)") parser.add_argument("--no-overwrite-sshkey", action="store_true", dest="no_overwrite_sshkey", From b10cfc75be37f76ffa0abef7f2a704ae006fd1a1 Mon Sep 17 00:00:00 2001 From: xin liang Date: Tue, 21 Oct 2025 22:15:17 +0800 Subject: [PATCH 2/2] Dev: behave: Adjust functional test for previous commit --- test/features/steps/const.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/features/steps/const.py b/test/features/steps/const.py index 9ae053d57..73d046964 100644 --- a/test/features/steps/const.py +++ b/test/features/steps/const.py @@ -76,7 +76,8 @@ -S, --enable-sbd Enable SBD even if no SBD device is configured (diskless mode) -w WATCHDOG, --watchdog WATCHDOG - Use the given watchdog device or driver name + Use the given watchdog device or driver name (only + valid together with -s or -S option) -x, --skip-csync2-sync Skip csync2 initialization (an experimental option) --no-overwrite-sshkey