forked from Mirror/pve-network
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 {
|
sub generate_controller_rawconfig {
|
||||||
my ($class, $plugin_config, $config) = @_;
|
my ($class, $plugin_config, $config) = @_;
|
||||||
|
|
||||||
|
@ -500,8 +506,8 @@ sub generate_controller_rawconfig {
|
||||||
push @{$final_config}, "service integrated-vtysh-config";
|
push @{$final_config}, "service integrated-vtysh-config";
|
||||||
push @{$final_config}, "!";
|
push @{$final_config}, "!";
|
||||||
|
|
||||||
if (-e "/etc/frr/frr.conf.local") {
|
my $local_conf = read_local_frr_config();
|
||||||
my $local_conf = file_get_contents("/etc/frr/frr.conf.local");
|
if ($local_conf) {
|
||||||
parse_merge_frr_local_config($config, $local_conf);
|
parse_merge_frr_local_config($config, $local_conf);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue