Closed ehaligow closed 1 year ago
I do not see that error. Could you provide more information? It is probably the login session was deleted by manual before you login that device but DM does not know it.
According to Redfish Specification (section 7.5.2 Modification success responses) for deleting operation (in this case deleting session), not only 200 status code should be accepted, but also 202 and 204. DeviceMgr receives from BMC Simulator status code 204, but DeviceMgr accepts only 200 (as in the following code from accountService.go):
func (s *Server) deleteDeviceSession(deviceIPAddress, authStr, userName string, userAuthData userAuth) (statusCode int, err error) {
id, status, statusCode, err := s.getUserLoginID(deviceIPAddress, authStr, userName)
if err == nil && status == true {
_, statusCode, err = deleteHTTPDataByRfAPI(deviceIPAddress, RfSessionServiceSessions, userAuthData, id)
if statusCode != http.StatusOK {
logrus.Errorf(ErrDeleteLoginFailed.String(id, strconv.Itoa(statusCode)))
return statusCode, errors.New(ErrDeleteLoginFailed.String(id, strconv.Itoa(statusCode)))
}
}
return statusCode, err
}
@ehaligow Yes, you could add those conditions of the HTTP status code (202 and 204) to this function.
Deleting device session returns error, after receiving status code 204 from BMC Simulator.
intel@ubuntu:functional_test$ ./dm logindevice 192.168.40.247:8888:admin:admin:1 Failed to delete login session id f4b31e66-add7-4fd7-a364-7b5e5de84d64, status code 204
According to code, receiving status codes other than 200 returns error.