mirror of
git://git.proxmox.com/git/pve-network.git
synced 2025-01-03 05:17:58 +03:00
evpn: extract read_local_frr_config
to allow mocking local fs access Signed-off-by: Stefan Lendl <s.lendl@proxmox.com> Reviewed-by: Max Carrara <m.carrara@proxmox.com> Tested-by: Max Carrara <m.carrara@proxmox.com> Tested-By: Stefan Hanreich <s.hanreich@proxmox.com>
This commit is contained in:
parent
d06ee817a7
commit
96d7d81d6c
@ -487,6 +487,12 @@ sub generate_frr_list {
|
||||
}
|
||||
}
|
||||
|
||||
sub read_local_frr_config {
|
||||
if (-e "/etc/frr/frr.conf.local") {
|
||||
return file_get_contents("/etc/frr/frr.conf.local");
|
||||
}
|
||||
};
|
||||
|
||||
sub generate_controller_rawconfig {
|
||||
my ($class, $plugin_config, $config) = @_;
|
||||
|
||||
@ -500,8 +506,8 @@ sub generate_controller_rawconfig {
|
||||
push @{$final_config}, "service integrated-vtysh-config";
|
||||
push @{$final_config}, "!";
|
||||
|
||||
if (-e "/etc/frr/frr.conf.local") {
|
||||
my $local_conf = file_get_contents("/etc/frr/frr.conf.local");
|
||||
my $local_conf = read_local_frr_config();
|
||||
if ($local_conf) {
|
||||
parse_merge_frr_local_config($config, $local_conf);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user