Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion cmd/smd/smd-api.go
Original file line number Diff line number Diff line change
Expand Up @@ -2693,12 +2693,20 @@ func (s *SmD) doRedfishEndpointsPost(w http.ResponseWriter, r *http.Request) {
} else {
if s.openchami {
s.lg.Printf("Payload does not contain PDUInventory key, routing to default V2 parser.")
if s.getSchemaVersion(w, body) > 0 { // Simplified from original
schemaVersion := s.getSchemaVersion(w, body)
if schemaVersion > 0 {
err = s.parseRedfishEndpointDataV2(w, body, false)
if err != nil {
sendJsonError(w, http.StatusInternalServerError,
fmt.Sprintf("failed parsing post data (V2): %v", err))
}
} else {
// This routes legacy requests (schemaVersion <= 0) to the old parser
err = s.parseRedfishEndpointData(w, eps, body)
if err != nil {
sendJsonError(w, http.StatusInternalServerError,
fmt.Sprintf("failed parsing post data: %v", err))
}
}
}
}
Expand Down
Loading