Refactor BMC superuser creation - #191
Draft
simcod wants to merge 4 commits into
Draft
Conversation
izvyk
reviewed
Jul 8, 2026
| // return fmt.Errorf("failed to create bmc superuser: %s %w", bmcConn.SuperUser().Name, err) | ||
| h.log.Error("failed to create bmc superuser", "user", bmcConn.SuperUser().Name, "error", err) | ||
| return nil | ||
| if !changeIsNeeded { |
There was a problem hiding this comment.
This is just a matter of taste, but still: Here the returned value is trusted although the function returned a non-nil error. The current implementation only returns true with an error, so this implementation follows that correctly. I'd suggest removing the error in case true is returned, see here.
| h.log.Warn("bmc reported an error configuring superuser, but password verification succeeded, proceed", | ||
| "user", bmcConn.SuperUser().Name, "error", err) | ||
| } else { | ||
| h.log.Info("created superuser", "user", bmcConn.SuperUser().Name) |
There was a problem hiding this comment.
Do we want to check if the password was actually changed? Or would it be too much xD
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Refactors the code to check, if a password change for the BMC superuser is necessary.
Used AI-Tools ✨