]> git.proxmox.com Git - mirror_frr.git/commitdiff
tools: frr-reload.py ignore multiple whitespaces
authorDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 10 Nov 2017 17:19:08 +0000 (17:19 +0000)
committerDaniel Walton <dwalton@cumulusnetworks.com>
Fri, 10 Nov 2017 17:19:08 +0000 (17:19 +0000)
Signed-off-by: Daniel Walton <dwalton@cumulusnetworks.com>
Without this fix frr-reload would do a del/add even if the only
difference were bogus whitespaces.

root@cel-redxp-10[nclu]# /usr/lib/frr/frr-reload.py --test
/etc/frr/frr.conf

Lines To Delete
===============

router bgp 100
 no bgp router-id 1.1.1.1

Lines To Add
============

router bgp 100
 bgp   router-id 1.1.1.1
root@cel-redxp-10[nclu]#

tools/frr-reload.py

index e19eeb04eea305d96b0ea11ff603afd050844bcc..8e218c0fc0e98124a0b1ea5418b2bf540e5ec362 100755 (executable)
@@ -118,6 +118,10 @@ class Config(object):
 
         for line in file_output.split('\n'):
             line = line.strip()
+
+            # Compress duplicate whitespaces
+            line = ' '.join(line.split())
+
             if ":" in line:
                 qv6_line = get_normalized_ipv6_line(line)
                 self.lines.append(qv6_line)