You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here is the simple example/use case to illustrate my issue.
My config.ini plugin file is :
[switch_rules:python]
switch_rules.rule = fooa
Now for some reasons (in production environnement), I don't to use rule anymore but rule2.
To do that, I created a foo.ini file beside my foo3-xxxxx.plugin in the /etc/metwork.config.d/mfdata/plugins directory :
[switch_rules:python]
switch_rules.rule2 = fooa
In fact, I see the rule and rule2 function will be called and rule is not replaced by rule2 : ./tmp/config_auto/plugin_switch_rules.ini is :
# <CONTRIBUTION OF foo3 PLUGIN>
[switch_rules_foo:python]
/home/dearith10/metwork/mfdata/var/plugins/foo:switch_rules.rule = foo/fooa
/home/dearith10/metwork/mfdata/var/plugins/foo:switch_rules.rule2 = foo/fooa
# </CONTRIBUTION OF foo3 PLUGIN>
I'm aware that all switch rules (regexp, python , etc...) defined in config.ini are aggregated in switch. That's Ok.
But also the switch rules defined in foo.ini in the /etc/metwork.config.d/mfdata/plugins directory.
Could your confirm this is the expected behavior ?
My workaround is as follow:
In the config.ini : don't define any switch rule, just define them in the foo.ini (when deploying my plugin in production env.).
Thanks for your answer.
The text was updated successfully, but these errors were encountered:
My use case doesn't concern 'dev' or 'prod' environnement. All is 'prod' environnement. We use the same plugin source to create 2 (or more) instances of the same plugin (by 'repackaging' the plugin) with different configuration including switch rules.
So we will use the workaround : in the config.ini : don't define any switch rule, just define them in the <plugin_name>.ini (in the /etc/metwork.config.d/mfdata/plugins when deploying the plugin in a production env.).
Hi,
I'm facing a issue about override mechanism for switch rules.
I'm trying to explain with a simple example/use case.
I build a plugin
foo
with a step namefooa
.I created a python
switch_rules
script with 2 functions :rule
andrule2
because sometimes, depending on a context I want to applyrule
, sometimesrule2
.(My real use case is : a same plugin with 2 different configurations (sections [switch rule] and [custom]), so 2 instances of the same plugin by applying the Mework concepts :
https://metwork-framework.org/pub/metwork/releases/docs/release_1.0/mfdata/350-plugin_guide/#25-advanced-installing-several-times-the-same-plugin and
https://metwork-framework.org/pub/metwork/releases/docs/release_1.0/mfdata/350-plugin_guide/#26-advanced-repackaging-a-plugin)
Here is the simple example/use case to illustrate my issue.
My config.ini plugin file is :
Now for some reasons (in production environnement), I don't to use
rule
anymore butrule2
.To do that, I created a
foo.ini
file beside myfoo3-xxxxx.plugin
in the/etc/metwork.config.d/mfdata/plugins
directory :In fact, I see the
rule
andrule2
function will be called andrule
is not replaced byrule2
: ./tmp/config_auto/plugin_switch_rules.ini is :I'm aware that all switch rules (regexp, python , etc...) defined in config.ini are aggregated in switch. That's Ok.
But also the switch rules defined in
foo.ini
in the/etc/metwork.config.d/mfdata/plugins
directory.Could your confirm this is the expected behavior ?
My workaround is as follow:
In the config.ini : don't define any switch rule, just define them in the
foo.ini
(when deploying my plugin in production env.).Thanks for your answer.
The text was updated successfully, but these errors were encountered: