[pve-devel] [PATCH pve-network 17/17] frr: fix reloading frr configuration

Stefan Hanreich s.hanreich at proxmox.com
Wed Apr 2 12:42:13 CEST 2025



On 4/2/25 12:37, Fabian Grünbichler wrote:
> On March 28, 2025 6:13 pm, Gabriel Goller wrote:
>> From: Stefan Hanreich <s.hanreich at proxmox.com>
>>
>> Reloading the FRR configuration failed, because outfunc was defined as
>> an empty hash, but Tools.pm requires it to be a CODE reference, so the
>> following error has been thrown on FRR reload:
>>
>>   Not a CODE reference at /usr/share/perl5/PVE/Tools.pm line 577.
>>
>> Fix this by not providing an outfunc at all (it was empty anyway) and
>> for future debugging / error reporting actually include the error in
>> the task log.
>>
>> Signed-off-by: Stefan Hanreich <s.hanreich at proxmox.com>
>> Signed-off-by: Gabriel Goller <g.goller at proxmox.com>
>> ---
>>  src/PVE/Network/SDN/Frr.pm | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/src/PVE/Network/SDN/Frr.pm b/src/PVE/Network/SDN/Frr.pm
>> index 7922e27cbfc0..d38a4180ff96 100644
>> --- a/src/PVE/Network/SDN/Frr.pm
>> +++ b/src/PVE/Network/SDN/Frr.pm
>> @@ -68,10 +68,10 @@ sub reload {
>>  
>>      if (-e $conf_file && -e $bin_path) {
>>  	eval {
>> -	    run_command([$bin_path, '--stdout', '--reload', $conf_file], outfunc => {}, errfunc => $err);
>> +	    run_command([$bin_path, '--stdout', '--reload', $conf_file], errfunc => $err);
> 
> this actually changes the behaviour though - I assume previously we
> wanted output to be suppressed here? not specifying outfunc means output
> is printed to stdout, unless quiet is set..
> 

yes, we figured it'd be good to have the actual frr-reload output in the
task log. Would make sense to at least mention this in the commit message.

>>  	};
>>  	if ($@) {
>> -	    warn "frr reload command fail. Restarting frr.";
>> +	    warn "frr reload command fail: $@ Restarting frr.";
> 
> this should probably be two warnings now to remain readable?
> 

will adjust!




More information about the pve-devel mailing list