Skip to content

Commit

Permalink
Fixed replacement for output port(s)
Browse files Browse the repository at this point in the history
  • Loading branch information
awicenec committed Jul 20, 2022
1 parent 3793895 commit 44f6c1f
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
13 changes: 13 additions & 0 deletions daliuge-engine/dlg/apps/bash_shell_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,19 @@ def _run_bash(self, inputs, outputs, stdin=None, stdout=subprocess.PIPE):
else:
for i in range(min(len(inputs), len(pargs))):
keyargs.update({pargs[i]: list(inputs.values())[i]})
if "outputs" in self.parameters and isinstance(self.parameters['outputs'][0], dict):
pkeyargs = droputils.identify_named_ports(
outputs_dict,
self.parameters["outputs"],
pargs,
pargsDict,
appArgs,
check_len=len(outputs),
mode="outputs")
keyargs.update(pkeyargs)
else:
for i in range(min(len(outputs), len(pargs))):
keyargs.update({pargs[i]: list(outputs.values())[i]})
keyargs = droputils.serialize_kwargs(keyargs,
prefix=self._argumentPrefix,
separator=self._paramValueSeparator)
Expand Down
2 changes: 1 addition & 1 deletion daliuge-engine/dlg/droputils.py
Original file line number Diff line number Diff line change
Expand Up @@ -583,7 +583,7 @@ def identify_named_ports(ports, port_dict, posargs, pargsDict, appArgs, check_le
for i in range(check_len):
# key for final dict is value in named ports dict
key = list(port_dict[i].values())[0]
# value for final dict is value in inputs dict
# value for final dict is value in ports dict
value = ports[list(port_dict[i].keys())[0]]
if not value: value = '' # make sure we are passing NULL drop events
if key in posargs:
Expand Down

0 comments on commit 44f6c1f

Please sign in to comment.