Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Script neuron does not accept script with arguments #680

Open
gl-bars opened this issue Oct 24, 2022 · 0 comments
Open

Script neuron does not accept script with arguments #680

gl-bars opened this issue Oct 24, 2022 · 0 comments

Comments

@gl-bars
Copy link

gl-bars commented Oct 24, 2022

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant