Skip to content
Snippets Groups Projects
Commit c10f565c authored by Vaclav Svaton's avatar Vaclav Svaton
Browse files

Delete job fix and wrong credentials exception handler fix

Delete job is enabled for Configuring state (before job submission to queue).
Fix for unhandled exception during login with the wrong username.
parent 59df83c8
No related branches found
No related tags found
No related merge requests found
...@@ -90,7 +90,7 @@ namespace HaaSMiddleware.BusinessLogicTier.Logic.JobManagement { ...@@ -90,7 +90,7 @@ namespace HaaSMiddleware.BusinessLogicTier.Logic.JobManagement {
{ {
log.Info("User " + loggedUser.GetLogIdentification() + " is deleting the job with info Id " + submittedJobInfoId); log.Info("User " + loggedUser.GetLogIdentification() + " is deleting the job with info Id " + submittedJobInfoId);
SubmittedJobInfo jobInfo = GetSubmittedJobInfoById(submittedJobInfoId, loggedUser); SubmittedJobInfo jobInfo = GetSubmittedJobInfoById(submittedJobInfoId, loggedUser);
if (jobInfo.State >= JobState.Finished) if (jobInfo.State == JobState.Configuring || jobInfo.State >= JobState.Finished)
{ {
#warning Renci SSH.NET bug - resolving paths when deleting symlink, use ssh delete instead #warning Renci SSH.NET bug - resolving paths when deleting symlink, use ssh delete instead
//FileSystemFactory.GetInstance(jobInfo.NodeType.FileTransferMethod.Protocol) //FileSystemFactory.GetInstance(jobInfo.NodeType.FileTransferMethod.Protocol)
......
...@@ -44,7 +44,11 @@ namespace HaaSMiddleware.BusinessLogicTier.Logic.UserAndLimitationManagement { ...@@ -44,7 +44,11 @@ namespace HaaSMiddleware.BusinessLogicTier.Logic.UserAndLimitationManagement {
// Get user // Get user
AdaptorUser user = unitOfWork.AdaptorUserRepository.GetByName(credentials.Username); AdaptorUser user = unitOfWork.AdaptorUserRepository.GetByName(credentials.Username);
if ( user.Deleted ) { if (user == null) {
log.Error("Authentication of user " + credentials.Username + " was not successful due to wrong credentials.");
throw new InvalidAuthenticationCredentialsException("Authentication of user " + credentials.Username + " was not successful due to wrong credentials.");
}
if ( user.Deleted ) {
log.Error("User " + user.Username + " that requested authentication was already deleted from the system."); log.Error("User " + user.Username + " that requested authentication was already deleted from the system.");
throw new AuthenticatedUserAlreadyDeletedException("User " + user.Username + " that requested authentication was already deleted from the system."); throw new AuthenticatedUserAlreadyDeletedException("User " + user.Username + " that requested authentication was already deleted from the system.");
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment