Skip to content

Don't return error when execute "portstat -d" #1139

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Don't return error when execute "portstat -d" #1139

wants to merge 1 commit into from

Conversation

chiourung
Copy link

If execute "portstat -d" without execute "portstat" first,
then this command would fail due to "No such file or directory"

- What I did
Don't return error when there is no directory or file.

- How to verify it
Boot the DUT and execute "portstat -d"

- Previous command output
root@as5812-54x:/home/admin# portstat -d
Traceback (most recent call last):
File "/usr/bin/portstat", line 411, in
main()
File "/usr/bin/portstat", line 355, in main
if os.listdir(cnstat_dir) == []:
OSError: [Errno 2] No such file or directory: '/tmp/portstat-0'

Signed-off-by: chiourung_huang [email protected]

- What I did

- How I did it

- How to verify it

- Previous command output (if the output of a command-line utility has changed)

- New command output (if the output of a command-line utility has changed)

If execute "portstat -d" without execute "portstat" first,
then this command would fail due to "No such file or directory"

Before fix:
root@as5812-54x:/home/admin# portstat -d
Traceback (most recent call last):
  File "/usr/bin/portstat", line 411, in <module>
    main()
  File "/usr/bin/portstat", line 355, in main
    if os.listdir(cnstat_dir) == []:
OSError: [Errno 2] No such file or directory: '/tmp/portstat-0'

Signed-off-by: chiourung_huang <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant