Page MenuHomeVyOS Platform

interrupting rollback with Ctrl-C displays an exception trace
Closed, ResolvedPublic

Description

vyos@test# rollback 0
Proceed with reboot ? [Y/n] ^CTraceback (most recent call last):
  File "/usr/bin/config-mgmt", line 33, in <module>
    sys.exit(load_entry_point('vyos==1.3.0', 'console_scripts', 'config-mgmt')())
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/config_mgmt.py", line 751, in run
    res, rc = func(**args)
              ^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/config_mgmt.py", line 250, in rollback
    if not no_prompt and not ask_yes_no(prompt_str, default=True):
                             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3/dist-packages/vyos/utils/io.py", line 64, in ask_yes_no
    c = input().lower()
        ^^^^^^^
KeyboardInterrupt

The root cause is that ask_yes_no() handled only EOF erorrs, but not keyboard interrupts.

Details

Version
1.4.0-epa1
Is it a breaking change?
Perfectly compatible
Issue type
Bug (incorrect behavior)