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

[portstat] Fixed delete when no data saved #744

Closed
wants to merge 1 commit into from

Conversation

msosyak
Copy link

@msosyak msosyak commented Nov 19, 2019

- What I did
Added logic to avoid exception on delete when no data saved

- How I did it
Added isdir check before delete logic

- How to verify it
run portstat -D twice

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

admin@dut:~$ portstat -D
admin@dut:~$ portstat -D
Traceback (most recent call last):
  File "/usr/bin/portstat", line 372, in <module>
    main()
  File "/usr/bin/portstat", line 297, in main
    for file in os.listdir(cnstat_dir):
OSError: [Errno 2] No such file or directory: '/tmp/portstat-1000'
admin@dut:~$

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

admin@dut:~$ portstat -D
admin@dut:~$ portstat -D
admin@dut:~$ 

akokhan
akokhan previously approved these changes Nov 19, 2019
vsenchyshyn
vsenchyshyn previously approved these changes Nov 19, 2019
@msosyak msosyak changed the title [porstat] Fixed delete when no data saved [portstat] Fixed delete when no data saved Nov 19, 2019
@msosyak
Copy link
Author

msosyak commented Nov 22, 2019

retest this please

@msosyak
Copy link
Author

msosyak commented Nov 28, 2019

retest this please

8 similar comments
@msosyak
Copy link
Author

msosyak commented Dec 2, 2019

retest this please

@msosyak
Copy link
Author

msosyak commented Dec 6, 2019

retest this please

@msosyak
Copy link
Author

msosyak commented Dec 9, 2019

retest this please

@msosyak
Copy link
Author

msosyak commented Dec 18, 2019

retest this please

@msosyak
Copy link
Author

msosyak commented Dec 24, 2019

retest this please

@msosyak
Copy link
Author

msosyak commented Jan 2, 2020

retest this please

@msosyak
Copy link
Author

msosyak commented Jan 10, 2020

retest this please

@msosyak
Copy link
Author

msosyak commented Jan 20, 2020

retest this please

@msosyak
Copy link
Author

msosyak commented Feb 4, 2020

retest this please

@msosyak msosyak closed this Jan 26, 2023
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.

3 participants