Skip to content

Commit

Permalink
Fixed wrong file creation in process.py
Browse files Browse the repository at this point in the history
If the output is a File in a subdirectory of the output folder, the
local dummy file creation fails with a NotFound error. It is
therefore necessary to recreate the whole directory hierarchy
before touching the file.
  • Loading branch information
GlassOfWhiskey committed Jun 17, 2020
1 parent 8a4491f commit f975dfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions streamflow/cwl/process.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import os
import urllib.parse
from datetime import datetime
from pathlib import Path
from typing import Type, Any, MutableMapping, Mapping, Callable, Generator, Union, Optional, Dict, Text, List

from cwltool.command_line_tool import CommandLineTool, CallbackJob
Expand Down Expand Up @@ -167,6 +168,8 @@ def receive_output(self,
if element.get('class') == 'Directory':
os.makedirs(abs_path, exist_ok=True)
else:
parent_dir = str(Path(abs_path).parent)
os.makedirs(parent_dir, exist_ok=True)
open(abs_path, 'a').close()
super().receive_output(output_callback, jobout, processStatus)
if job_context is not None:
Expand Down
2 changes: 1 addition & 1 deletion streamflow/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
VERSION = "0.0.20"
VERSION = "0.0.21"

0 comments on commit f975dfd

Please sign in to comment.