kalliope
kalliope copied to clipboard
Script neuron does not accept script with arguments
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?