From 3812503a1023fdf91493dca80623bad0f386c5fc Mon Sep 17 00:00:00 2001 From: Aleksei Burlakov Date: Fri, 21 Jun 2024 17:15:12 +0200 Subject: [PATCH] Fix: ui_context: crm cluster delete autocompletion #1403 #1460 If you type $ crm configure delete of do it interactively $ crm configure crm(live/node1)configure# delete and then double press tab it, should propose possible resource options. And this commit makes it working again. --- crmsh/ui_context.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/crmsh/ui_context.py b/crmsh/ui_context.py index 8533c2f269..0b71e6d0b8 100644 --- a/crmsh/ui_context.py +++ b/crmsh/ui_context.py @@ -11,6 +11,7 @@ from . import constants from . import log from . import main +from .service_manager import ServiceManager logger = log.setup_logger(__name__) @@ -255,6 +256,9 @@ def enter_level(self, level): self._in_transit = True entry = level() + if ServiceManager().service_is_active("pacemaker.service"): + if 'requires' in dir(entry) and not entry.requires(): + self.fatal_error("Missing requirements") self.stack.append(entry) self.clear_readline_cache()