diff options
Diffstat (limited to 'tools')
| -rw-r--r-- | tools/emacs.dir-locals.el | 8 | ||||
| -rwxr-xr-x | tools/frr-reload.py | 8 |
2 files changed, 15 insertions, 1 deletions
diff --git a/tools/emacs.dir-locals.el b/tools/emacs.dir-locals.el new file mode 100644 index 0000000000..b2d7cf376d --- /dev/null +++ b/tools/emacs.dir-locals.el @@ -0,0 +1,8 @@ +;;; Directory Local Variables +;;; For more information see (info "(emacs) Directory Variables") +;;; Match project coding conventions + +((c-mode . ((indent-tabs-mode . t) + (show-trailing-whitespace . t) + (c-basic-offset . 8))) + (json-mode . ((js-indent-level 4)))) diff --git a/tools/frr-reload.py b/tools/frr-reload.py index 490e519ae9..0e0aec9839 100755 --- a/tools/frr-reload.py +++ b/tools/frr-reload.py @@ -788,6 +788,8 @@ def bgp_delete_nbr_remote_as_line(lines_to_add): # remote-as config. pg_dict = dict() + found_pg_cmd = False + # Find all peer-group commands; create dict of each peer-group # to store assoicated neighbor as value for ctx_keys, line in lines_to_add: @@ -809,6 +811,10 @@ def bgp_delete_nbr_remote_as_line(lines_to_add): } found_pg_cmd = True + # Do nothing if there is no any "peer-group" + if found_pg_cmd is False: + return + # Find peer-group with remote-as command, also search neighbor # associated to peer-group and store into peer-group dict for ctx_keys, line in lines_to_add: @@ -850,7 +856,7 @@ def bgp_delete_nbr_remote_as_line(lines_to_add): for pg in pg_dict[ctx_keys[0]]: if pg_dict[ctx_keys[0]][pg]["remoteas"] == True: for nbr in pg_dict[ctx_keys[0]][pg]["nbr"]: - if re_nbr_rmtas.group(1) in nbr: + if re_nbr_rmtas.group(1) == nbr: lines_to_del_from_add.append((ctx_keys, line)) for ctx_keys, line in lines_to_del_from_add: |
