Skip to content

Script neuron does not accept script with arguments #680

@gl-bars

Description

@gl-bars

Documentation has an example of running script with argument:

- script:
  path: "/path/to/script.sh {{ my_var }}"

but it actually fails:

  File "kalliope/core/NeuronLauncher.py", line 62, in start_neuron
    instantiated_neuron = NeuronLauncher.launch_neuron(neuron)
  File "kalliope/core/NeuronLauncher.py", line 41, in launch_neuron
    return Utils.get_dynamic_class_instantiation(package_name="neurons",
  File "kalliope/core/Utils/Utils.py", line 150, in get_dynamic_class_instantiation
    return klass(**parameters)
  File "kalliope/neurons/script/script.py", line 37, in __init__
    if self._is_parameters_ok():
  File "kalliope/neurons/script/script.py", line 64, in _is_parameters_ok
    raise InvalidParameterException("Script not found or is not a file.")
kalliope.core.NeuronModule.InvalidParameterException: Script not found or is not a file.

This happens because script.py runs os.path.isfile check on the whole command line.
Should it probably use shlex.split to separate the command from arguments?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions