Skip to content

Commit dc01841

Browse files
keboliuraphaelt-nvidia
authored andcommitted
create sniffer folder if not exist (sonic-net#1659)
- What I did following the change in PR sonic-net/sonic-buildimage#7830, the folder needs to be created when the first time enables the sniffer function. - How I did it check whether the path to store the sniffer file is existing or not, if not, create it. - How to verify it run command "config platform mlnx sniffer sdk enable", can see sniffer function can be enabled successfully.
1 parent e1f200b commit dc01841

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

config/plugins/mlnx.py

+2
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@
4343

4444
# generate sniffer target file name include a time stamp.
4545
def sniffer_filename_generate(path, filename_prefix, filename_ext):
46+
if not os.path.exists(path):
47+
os.makedirs(path)
4648
time_stamp = time.strftime("%Y%m%d%H%M%S")
4749
filename = path + filename_prefix + time_stamp + filename_ext
4850
return filename

0 commit comments

Comments
 (0)