From 4a9a7949cb3c26fb6e6cf24b915b866f0620b491 Mon Sep 17 00:00:00 2001 From: Afonne-CID Date: Thu, 15 Feb 2024 15:06:02 +0100 Subject: [PATCH] Improve clarity of exception message If user runs `ironic node-create -d ` with a driver that is not enabled or activated, or when no registered conductor service which supports the given driver in a specified conductor group is found, the current exception may not be clear enough or confusing for users. This proposed change would prompt user to ensure that the input driver is valid and enabled, and guide to run the `driver-list` subcommand to show the current supported drivers; adding context for the reason for the exception. Now, if input driver is not valid or enabled, we get below message: "No conductor service registered which supports driver for conductor group "". Ensure the driver is valid and enabled. (HTTP 400)" Implements: clarity of exception message Closes-Bug: #1398286 Change-Id: I592f3ce278d1b536ed91c3340b7f270985e309ac Signed-off-by: Afonne-CID --- ironic/conductor/rpcapi.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ironic/conductor/rpcapi.py b/ironic/conductor/rpcapi.py index cb11a7f43f..b5e0b279f2 100644 --- a/ironic/conductor/rpcapi.py +++ b/ironic/conductor/rpcapi.py @@ -236,7 +236,8 @@ class ConductorAPI(object): return dest.pop() except exception.DriverNotFound: reason = (_('No conductor service registered which supports ' - 'driver %(driver)s for conductor group "%(group)s".') % + 'driver %(driver)s for conductor group "%(group)s". ' + 'Ensure the driver is valid and enabled.') % {'driver': node.driver, 'group': node.conductor_group}) raise exception.NoValidHost(reason=reason)