[pve-devel] [PATCH pve-manager] api2 : network : use vtysh for frr reload instead systemd

Alexandre DERUMIER aderumier at odiso.com
Fri Sep 13 12:28:22 CEST 2019


Hi,

can you add this patch ? (just to be sure to not lost it)
Thanks

Alexandre.

(BTW, I'm begin to work on gui for sdn, I'll try to send patch next week)


----- Mail original -----
De: "aderumier" <aderumier at odiso.com>
À: "pve-devel" <pve-devel at pve.proxmox.com>
Cc: "aderumier" <aderumier at odiso.com>
Envoyé: Lundi 9 Septembre 2019 10:22:28
Objet: [PATCH pve-manager] api2 : network : use vtysh for frr reload instead systemd

avoid extra dep on frr-pythontools and parse error messages 

Signed-off-by: Alexandre Derumier <aderumier at odiso.com> 
--- 
PVE/API2/Network.pm | 11 +++++++++-- 
1 file changed, 9 insertions(+), 2 deletions(-) 

diff --git a/PVE/API2/Network.pm b/PVE/API2/Network.pm 
index ac5571a7..fa605ba7 100644 
--- a/PVE/API2/Network.pm 
+++ b/PVE/API2/Network.pm 
@@ -578,8 +578,15 @@ __PACKAGE__->register_method({ 
}; 
PVE::Tools::run_command(['ifreload', '-a'], errfunc => $err); 

- if ($frr_config && -e "/usr/lib/frr/frr-reload.py") { 
- PVE::Tools::run_command(['systemctl', 'reload', 'frr']); 
+ my $err_frr = sub { 
+ my $line = shift; 
+ if ($line =~ /^line (\S+)/) { 
+ print "$line \n"; 
+ } 
+ }; 
+ 
+ if ($frr_config && -e "/usr/bin/vtysh") { 
+ PVE::Tools::run_command(['/usr/bin/vtysh', '-m', '-f', '/etc/frr/frr.conf'], outfunc => {}, errfunc => $err_frr); 
} 
}; 
return $rpcenv->fork_worker('srvreload', 'networking', $authuser, $worker); 
-- 
2.20.1 




More information about the pve-devel mailing list