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 8, 2024
1 parent 91b7b7f commit a20d0e7
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions plugins/fileservices/fileservices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2837,22 +2837,25 @@ 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);
s.append(location).append(',').append(path).append("), file not found");
else
{
StringBuffer scopes;
checkExternalFileRights(ctx,lfn.getScopes(scopes),false,true);
if (f->isDirectory()==fileBool::foundYes)
checkExternalFileRights(ctx,lfn.get(),false,true);
else
{
StringBuffer scopes;
checkExternalFileRights(ctx,lfn.getScopes(scopes),false,true);
}
Owned<IFile> file = createIFile(rfn);
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 a20d0e7

Please sign in to comment.