Skip to content

Commit af8c0a2

Browse files
committed
add logic for removing folder
1 parent cb09219 commit af8c0a2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

jobrunner/lib/_filetools.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ def RemoveNodeFiles(config, nodedir):
245245

246246
# loop over archive_list and archive contents
247247
for filename in remove_list:
248-
os.remove(filename)
248+
if os.path.isfile(filename):
249+
os.remove(filename)
250+
elif os.path.isdir(filename):
251+
shutil.rmtree(filename)
249252

250253
# return back to working directory
251254
os.chdir(config.job.workdir)

0 commit comments

Comments
 (0)