quattor / configuration-modules-core

Node Configuration Manager Components for Everyone
www.quattor.org
Other
6 stars 54 forks source link

ncm-metaconfig 23.6: daemon name should be escaped/unescaped #1672

Open jouvin opened 5 months ago

jouvin commented 5 months ago

Currently, the daemon names in daemons resource are interpreted as plain string. It works for all standard services but not for template services with multiple instance where an instance name is named template_service@instance, as @ is an invalid character in a dict key. A workaround is probably possible using the actions but it would be good to support such service names which probably means that metaconfig should interpret the daemon names as escaped strings. It should not really pose backward compatibility problems as it is unlikely that a standard service name matches an escaped name.

jouvin commented 3 months ago

@stdweird @jrha I have seen no reply to my issue and it is a real issue for us as we are relying more and more on template units for things like uwsgi, gunicorn.... Do you agree that the change would be harmless/acceptable or did I miss something?

stdweird commented 3 months ago

more things that slipped my radar...

i agree, fix should be as simple as replacing https://github.com/quattor/CAF/blob/master/src/main/perl/ServiceActions.pm#L116 with

    foreach my $escdaemon (sort keys %{$pairs || {}}) {
        my $daemon = unescape($escdaemon);
        my $action = $pairs->{$daemon};

and importing the unescape from some CCM module

also updating the docs somewhere i guess