From fbec09c073642462f451aadc747776802511f4cf Mon Sep 17 00:00:00 2001 From: Jarrod Johnson Date: Tue, 30 Jun 2026 15:17:45 -0400 Subject: [PATCH] Fix behavior with IPMI bad user/password --- confluent_server/aiohmi/ipmi/private/session.py | 2 +- confluent_server/confluent/plugins/hardwaremanagement/ipmi.py | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/confluent_server/aiohmi/ipmi/private/session.py b/confluent_server/aiohmi/ipmi/private/session.py index 746c958e..0725fdf3 100644 --- a/confluent_server/aiohmi/ipmi/private/session.py +++ b/confluent_server/aiohmi/ipmi/private/session.py @@ -1623,7 +1623,7 @@ class Session(object): givenhash = struct.pack("%dB" % hashlen, *data[40:hashlen + 40]) if givenhash != expectedhash: self.sessioncontext = "FAILED" - self.onlogon({'error': "Incorrect password provided"}) + await self.onlogon({'error': "Incorrect password provided"}) return -9 # We have now validated that the BMC and client agree on password, time # to store the keys diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index d711679a..04894407 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -353,7 +353,7 @@ class IpmiConsole(conapi.Console): self.error = 'Unknown error' if (self.error.startswith('Incorrect password') or self.error.startswith('Unauthorized name')): - raise exc.TargetEndpointBadCredentials + raise exc.TargetEndpointBadCredentials() else: raise exc.TargetEndpointUnreachable(self.error) self.connected = True @@ -445,6 +445,8 @@ async def perform_request(operator, node, element, excmsg = str(ipmiexc) if excmsg in ('Session no longer connected', 'timeout'): await results.put(msg.ConfluentTargetTimeout(node)) + elif 'Unauthorized name' in excmsg or 'Incorrect password provided' in excmsg: + await results.put(msg.ConfluentTargetInvalidCredentials(node)) else: await results.put(msg.ConfluentNodeError(node, excmsg)) #raise