Skip to content

Commit

Permalink
Switched from longer list of unsupported categories to short list of …
Browse files Browse the repository at this point in the history
…supported categories. Remove handling of Exception during create_workflow() for consistency with other errors.
  • Loading branch information
james-strauss-uwa committed Oct 6, 2020
1 parent dde0028 commit 4a5cc20
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 3 additions & 3 deletions daliuge-translator/dlg/dropmake/cwl.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
from dlg import common
from dlg.common import Categories

# the following node categories are not supported by the CWL translator
UNSUPPORTED_CATEGORIES = [Categories.COMPONENT, Categories.MPI, Categories.DYNLIB_APP, Categories.DYNLIB_PROC_APP, Categories.DOCKER]
# the following node categories are supported by the CWL translator
SUPPORTED_CATEGORIES = [Categories.BASH_SHELL_APP, Categories.FILE]

#from ..common import dropdict, get_roots
logger = logging.getLogger(__name__)
Expand All @@ -54,7 +54,7 @@ def create_workflow(drops, cwl_filename, buffer):
# if found, the graph cannot be translated into CWL
for index, node in enumerate(drops):
dataType = node.get('dt', '')
if dataType in UNSUPPORTED_CATEGORIES:
if dataType not in SUPPORTED_CATEGORIES:
raise Exception('Node {0} has an unsupported category: {1}'.format(index, dataType))

# create list for command line tool description files
Expand Down
7 changes: 2 additions & 5 deletions daliuge-translator/dlg/translator/tool_commands.py
Original file line number Diff line number Diff line change
Expand Up @@ -301,11 +301,8 @@ def cwl(parser, args):
from ..dropmake.cwl import create_workflow

# write to file
try:
with _open_o(opts.output, "wb") as f:
create_workflow(pgt, "workflow.cwl", f)
except Exception as e:
logger.error(e)
with _open_o(opts.output, "wb") as f:
create_workflow(pgt, "workflow.cwl", f)

def register_commands():
tool.cmdwrap('lgweb', 'A Web server for the Logical Graph Editor', 'dlg.dropmake.web.lg_web:run')
Expand Down

0 comments on commit 4a5cc20

Please sign in to comment.