Page MenuHomeVyOS Platform

ask_yes_no() doesn't handle EOFError
Closed, ResolvedPublic

Description

User prompts abort when the user enters the EOF character.

vyos@vyos:~$ poweroff
Are you sure you want to poweroff this system? [y/N] ^DTraceback (most recent call last):
  File "/usr/libexec/vyos/op_mode/powerctrl.py", line 174, in <module>
    main()
  File "/usr/libexec/vyos/op_mode/powerctrl.py", line 164, in main
    execute_shutdown(args.poweroff, reboot=False,ask=args.yes)
  File "/usr/libexec/vyos/op_mode/powerctrl.py", line 84, in execute_shutdown
    if not ask_yes_no("Are you sure you want to %s this system?" % action):
  File "/usr/lib/python3/dist-packages/vyos/util.py", line 185, in ask_yes_no
    c = input().lower().strip()
EOFError
vyos@vyos:~$

Details

Difficulty level
Unknown (require assessment)
Version
vyos-1.4-rolling-202101240218-amd64
Why the issue appeared?
Will be filled on close
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)