Skip to content

Conversation

@szaydel
Copy link

@szaydel szaydel commented Aug 30, 2021

It looks like right now when a confirmation is interrupted via CTRL-C, it results in a crash that looks like the following, as a result of not handling a KeyboardInterrupt exception raised by readline.

$ corelight-client smartpcap storage shutdown

== Confirmation required ==

This will shutdown Smart PCAP external storage, which requires sensor reboot to resume the capture function.

== To proceed, enter 'YES': ^CTraceback (most recent call last):
  File "/usr/bin/corelight-client", line 197, in <module>
    client.resource.process(session, resource)
  File "/usr/local/python38/lib/python3.8/site-packages/client/resource.py", line 250, in process
    _processResponse(session, resource, response, schema, cache, data)
  File "/usr/local/python38/lib/python3.8/site-packages/client/resource.py", line 334, in _processResponse
    if sys.stdin.readline() != "YES\n":
KeyboardInterrupt

With this change it feels a bit more pleasant:

$ corelight-client smartpcap storage shutdown

== Confirmation required ==

This will shutdown Smart PCAP external storage, which requires sensor reboot to resume the capture function.

== To proceed, enter 'YES': ^C
== Aborted

@szaydel
Copy link
Author

szaydel commented May 21, 2024

Wow, this took a while @perkinjo . I forgot all about this PR. :)

Thank you, Sam.

@chandan-cl chandan-cl merged commit 5026a04 into corelight:master Aug 14, 2025
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