Skip to content

Commit

Permalink
[intfstat] fix --delete fail when counters dump does not exist (sonic…
Browse files Browse the repository at this point in the history
…-net#752)

Signed-off-by: Mykola Faryma <mykolaf@mellanox.com>
  • Loading branch information
mykolaf authored and liat-grozovik committed Dec 24, 2019
1 parent 72112b0 commit 6d0dee0
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions scripts/intfstat
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,10 @@ def main():
cnstat_fqn_file = cnstat_dir + "/" + cnstat_file

if delete_all_stats:
# There is nothing to delete
if not os.path.isdir(cnstat_dir):
sys.exit(0)

for file in os.listdir(cnstat_dir):
os.remove(cnstat_dir + "/" + file)

Expand Down

0 comments on commit 6d0dee0

Please sign in to comment.