From 04b70920bf9178e486a5c2a73c97c33ed24f6775 Mon Sep 17 00:00:00 2001 From: nicholasyang Date: Fri, 13 Sep 2024 19:00:55 +0800 Subject: [PATCH] Fix: report: should not try interactive authentication when stdin is no a tty (bsc#1228899) --- crmsh/report/core.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/crmsh/report/core.py b/crmsh/report/core.py index 45c10452f..21533c0f9 100644 --- a/crmsh/report/core.py +++ b/crmsh/report/core.py @@ -22,6 +22,11 @@ def collect_for_nodes(nodes, arg_str): """ Start slave collectors """ + if constants.SSH_PASSWORD_NODES and not crmutils.can_ask(): + logger.error('Cannot create a report non-interactively. Interactive authentication is required.') + if userdir.getuser() == 'hacluster': + logger.info('Please setup passwordless ssh authentication for user hacluster.') + raise ValueError('Cannot create a report.') process_list = [] for node in nodes.split(): if node in constants.SSH_PASSWORD_NODES: