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

Step and _cmd_and_args parameter - command to be executed : what about 'null means no command to execute' ? #385

Open
dearith opened this issue Apr 6, 2021 · 6 comments

Comments

@dearith
Copy link
Contributor

dearith commented Apr 6, 2021

I'm trying to override _cmd_and_args in my <plugin_name>.ini config. file in /etc/metwork.config.d/mfdata/plugins directory.

My plugin contains several steps, and for some reason I don't want to execute some steps in a specific configuration.

Let's assume my plugin's name is foo with 2 steps : s1 and s2.

The config.ini file contains :

[step_s1]
_cmd_and_args={{MFDATA_CURRENT_PLUGIN_DIR}}/s1.py {STANDARD_STEP_ARGUMENTS}
...
[step_s2]
_cmd_and_args={{MFDATA_CURRENT_PLUGIN_DIR}}/s2.py {STANDARD_STEP_ARGUMENTS}
...

Let's assume, in production mode, I don't want to execute step_s1, so in the foo.ini in /etc/metwork.config.d/mfdata/plugins, I'm trying to disable the step_s1 by setting 'null', as mentionned as comment in config.ini file:

# Command (and args) to be executed
# Notes :
# - null means no command to execute
...
[step_s1]
_cmd_and_args=null
...

or

...
[step_s1]
_cmd_and_args=
...

But neither of the solutions works, and I get errors in the logs :

usage: plugin_wrapper [-h] [--cwd] [--empty] [--bash-cmds]
                      [--plugins-base-dir PLUGINS_BASE_DIR] [--ignore-cache]
                      PLUGIN_NAME_OR_PLUGIN_HOME COMMAND_AND_ARGS
plugin_wrapper: error: the following arguments are required: COMMAND_AND_ARGS

Is it a bug, or is there something that i didn't understand ?

@thefab
Copy link
Member

thefab commented Apr 19, 2021

probably a bug @dearith

but it should work without the line _cmd_and_args= at all in your step section

@thefab
Copy link
Member

thefab commented Apr 19, 2021

ok, you can't do that with configuration override, let's have a look

@thefab
Copy link
Member

thefab commented Apr 19, 2021

ok @dearith I think that the documentation is wrong
(I propose to remove the comment about null value)

for your use-case, you can overrides numprocesses to 0 (to avoid a process launch)

@thefab
Copy link
Member

thefab commented Apr 19, 2021

is this solution ok for you?

@dearith
Copy link
Contributor Author

dearith commented Apr 19, 2021

@thefab : Ok thanks. It seems a good solution. I will try it as soon as possible.

@dearith
Copy link
Contributor Author

dearith commented Apr 19, 2021

@thefab The solution to set numprocesses to 0 (to avoid a process launch) works. Thanks.

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

No branches or pull requests

2 participants