[pve-devel] [PATCH pve-network] don't regenerate frr config if no router is defined

Alexandre Derumier aderumier at odiso.com
Wed Sep 4 07:49:31 CEST 2019


Signed-off-by: Alexandre Derumier <aderumier at odiso.com>
---
 PVE/Network/SDN.pm     | 2 ++
 test/generateconfig.pl | 8 +++++---
 2 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/PVE/Network/SDN.pm b/PVE/Network/SDN.pm
index 1e89d97..1d84a32 100644
--- a/PVE/Network/SDN.pm
+++ b/PVE/Network/SDN.pm
@@ -195,6 +195,8 @@ sub generate_frr_config {
 	}
     }
 
+    return undef if !$frr_cfg;
+
     #generate configuration
     my $config = {};
 
diff --git a/test/generateconfig.pl b/test/generateconfig.pl
index 04e930b..dda9b8e 100644
--- a/test/generateconfig.pl
+++ b/test/generateconfig.pl
@@ -15,6 +15,8 @@ print "\n";
 
 
 my $frr_config = PVE::Network::SDN::generate_frr_config();
-PVE::Network::SDN::write_frr_config($frr_config);
-print "/etc/frr/frr.conf\n";
-print $frr_config;
+if ($frr_config) {
+    PVE::Network::SDN::write_frr_config($frr_config);
+    print "/etc/frr/frr.conf\n";
+    print $frr_config;
+}
-- 
2.20.1




More information about the pve-devel mailing list