From bd5d7ffb9413613da11a9c1b560abfa7d9e6895e Mon Sep 17 00:00:00 2001 From: Markus Hilger Date: Fri, 14 Aug 2026 02:52:20 +0200 Subject: [PATCH] Address a redfish account by the id the bmc gave it Redfish identifies an account by a string, and an implementation is free to use the account name, which this one does. The handler converted the last element of the path to an integer, so every per user read, update and delete answered "invalid literal for int() with base 10: 'root'" as an unexpected error, with a traceback to match. Confluent offered the id itself, listing the account as "root", and then could not accept it back. Take the element as given. Everything below already compares ids as strings, and the input parsing already keeps a non numeric uid, so only this conversion stood in the way. nodebmcpassword goes through exactly this path, reading users/all for the id and then writing to that account, so it could not work at all on such a bmc. ipmi users really are numbered slots, so the conversion is right there and stays, but say so when it fails rather than letting a ValueError surface as an unexpected error. --- .../confluent/plugins/hardwaremanagement/ipmi.py | 9 ++++++++- .../confluent/plugins/hardwaremanagement/redfish.py | 5 ++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py index db40e941..d5ed8289 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/ipmi.py @@ -838,7 +838,14 @@ class IpmiHandler: return # Update user elif len(self.element) == 4: - user = int(self.element[-1]) + # ipmi users really are numbered slots, unlike redfish accounts, so + # say that rather than letting the conversion fail as a surprise + try: + user = int(self.element[-1]) + except ValueError: + raise pygexc.InvalidParameterValue( + 'ipmi users are numbered, and "{0}" is not a user ' + 'number'.format(self.element[-1])) if self.op == 'read': data = await self.ipmicmd.get_user(uid=user) await self.output.put(msg.User( diff --git a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py index f3bdc132..8cc84492 100644 --- a/confluent_server/confluent/plugins/hardwaremanagement/redfish.py +++ b/confluent_server/confluent/plugins/hardwaremanagement/redfish.py @@ -734,7 +734,10 @@ class IpmiHandler: return # Update user elif len(self.element) == 4: - user = int(self.element[-1]) + # A redfish account is identified by a string, and an + # implementation is free to use the account name as one, so take it + # as given rather than assuming a number + user = self.element[-1] if self.op == 'read': data = await self.ipmicmd.get_user(uid=user) await self.output.put(msg.User(