Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[bgpcfgd] improve the log when delete a loopback interface #11152

Merged
merged 2 commits into from
Jul 29, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/sonic-bgpcfgd/bgpcfgd/managers_setsrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ def set_handler(self, key, data):
def del_handler(self, key):
""" Implementation of 'DEL' command for this class """
self.directory.remove(self.db_name, self.table_name, key)
log_warn("Delete command is not supported for 'zebra set src' templates")
log_warn("Delete key '%s' is not supported for 'zebra set src' templates" % str(key))
5 changes: 3 additions & 2 deletions src/sonic-bgpcfgd/tests/test_setsrc.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ def test_set_handler_invalid_ip(mocked_log_err):
@patch('bgpcfgd.managers_setsrc.log_warn')
def test_del_handler(mocked_log_warn):
m = constructor()
m.del_handler("Loopback0|10.1.0.32/32")
mocked_log_warn.assert_called_with("Delete command is not supported for 'zebra set src' templates")
del_key = "Loopback0|10.1.0.32/32"
m.del_handler(del_key)
mocked_log_warn.assert_called_with("Delete key '%s' is not supported for 'zebra set src' templates" % del_key)