Skip to content

Commit

Permalink
ignroe if output is empty
Browse files Browse the repository at this point in the history
Signed-off-by: xuliping <xuliping@microsoft.com>
  • Loading branch information
lipxu committed Jan 19, 2024
1 parent 7032017 commit b5b188f
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/sonic-bgpcfgd/bgpmon/bgpmon.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,9 @@ def get_all_neigh_states(self):
if rc:
syslog.syslog(syslog.LOG_ERR, "*ERROR* Failed with rc:{} when execute: {}".format(rc, cmd))
return
if len(output) == 0:
syslog.syslog(syslog.LOG_WARNING, "*WARNING* output none when execute: {}".format(cmd))
return

peer_info = json.loads(output)
# cmd ran successfully, safe to Clean the "new" set/dict for new snapshot
Expand Down

0 comments on commit b5b188f

Please sign in to comment.