Skip to content

Commit

Permalink
HPCC-31213 Fix the regress test failure
Browse files Browse the repository at this point in the history
The code in previous commit throws an exception if a file to be
deleted does not exist. That causes the regress test failure:
'File W20240208-191101-spray_input_CSV not found' when deleting
the file from the spray_queue_test.ecl. In this commit, the code
is changed to log the 'file not found'.

Signed-off-by: wangkx <[email protected]>
  • Loading branch information
wangkx committed Feb 9, 2024
1 parent 91b7b7f commit f592bac
Showing 1 changed file with 13 additions and 11 deletions.
24 changes: 13 additions & 11 deletions plugins/fileservices/fileservices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2837,22 +2837,24 @@ FILESERVICES_API void FILESERVICES_CALL fsDeleteExternalFile(ICodeContext * ctx
CDfsLogicalFileName lfn;
lfn.setExternal(location,path);

StringBuffer s("DeleteExternalFile ('");
RemoteFilename rfn;
lfn.getExternalFilename(rfn);
Owned<IFile> f = createIFile(rfn);
if (!f->exists())
throw makeStringExceptionV(-1,"File %s not found",path);
if (f->isDirectory()==fileBool::foundYes)
checkExternalFileRights(ctx,lfn.get(),false,true);
Owned<IFile> file = createIFile(rfn);
if (!file->exists())
s.append(location).append(',').append(path).append("), file not found");
else
{
StringBuffer scopes;
checkExternalFileRights(ctx,lfn.getScopes(scopes),false,true);
if (file->isDirectory()==fileBool::foundYes)
checkExternalFileRights(ctx,lfn.get(),false,true);
else
{
StringBuffer scopes;
checkExternalFileRights(ctx,lfn.getScopes(scopes),false,true);
}
file->remove();
s.append(location).append(',').append(path).append(") done");
}
Owned<IFile> file = createIFile(rfn);
file->remove();
StringBuffer s("DeleteExternalFile ('");
s.append(location).append(',').append(path).append(") done");
WUmessage(ctx,SeverityInformation,NULL,s.str());
AuditMessage(ctx,"DeleteExternalFile",path);
}
Expand Down

0 comments on commit f592bac

Please sign in to comment.