[pmg-devel] applied: [PATCH pmg-api 1/2] PMG::Config: sort mynetworks in get_template_vars

Thomas Lamprecht t.lamprecht at proxmox.com
Fri Apr 12 09:59:53 CEST 2019


On 4/11/19 6:48 PM, Stoiko Ivanov wrote:
> fix #2172
> 
> The mynetworks template_var is written to postfix/main.cf, causing a
> postfix restart on every change. Since mynetworks is a hash the order of the
> networks potentially changes with every invocation. This shows quite readily in
> clustered setups where pmgmirror writes the configs and checks for changes once
> every 2 minutes.
> 
> Signed-off-by: Stoiko Ivanov <s.ivanov at proxmox.com>
> ---

applied, with a rewritten commit subject (IMO it's better to have human readable
things, not the module names which one can derives from looking at git --stat or
the diff itself, my changes are surely not 100% ideal either, but I simply treid
to say what the general indent of this patch was (keeping the config more stable)

anyway, thanks!

>  PMG/Config.pm | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/PMG/Config.pm b/PMG/Config.pm
> index 9f1c001..6aa7d06 100755
> --- a/PMG/Config.pm
> +++ b/PMG/Config.pm
> @@ -1192,7 +1192,7 @@ sub get_template_vars {
>      }
>  
>      my $netlist = PVE::INotify::read_file('mynetworks');
> -    foreach my $cidr (keys %$netlist) {
> +    foreach my $cidr (sort keys %$netlist) {
>  	if ($cidr =~ m/^($IPV6RE)\/(\d+)$/) {
>  	    push @$mynetworks, "[$1]/$2";
>  	} else {
> 




More information about the pmg-devel mailing list