summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorChristian Breunig <christian@breunig.cc>2024-07-30 15:50:45 +0200
committerMergify <37929162+mergify[bot]@users.noreply.github.com>2024-07-30 13:53:08 +0000
commit1ce6c77eb37c9519c8e970eafc210c4f6533f55b (patch)
treefbd68dc5c960dfcec4724cee9d971585f5c7f1fd /python
parent9d8609c97650c0a65856bdfe705b740070de9f1a (diff)
downloadvyos-1x-1ce6c77eb37c9519c8e970eafc210c4f6533f55b.tar.gz
vyos-1x-1ce6c77eb37c9519c8e970eafc210c4f6533f55b.zip
system: op-mode: T3334: replace some print() statements with Warning()mergify/bp/circinus/pr-3698
Make it more obvious for the user aber the severity of his action. (cherry picked from commit b3b31153963cc4338e8229f9f94b339682dd73a0)
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/serial.py15
1 files changed, 8 insertions, 7 deletions
diff --git a/python/vyos/utils/serial.py b/python/vyos/utils/serial.py
index 7a662bf96..b646f881e 100644
--- a/python/vyos/utils/serial.py
+++ b/python/vyos/utils/serial.py
@@ -90,17 +90,18 @@ def restart_login_consoles(prompt_user=False, quiet=True, devices: List[str]=[])
if connected:
if not quiet:
- print('There are user sessions connected via serial console that will be terminated\n' \
- 'when serial console settings are changed.\n') # extra newline is deliberate.
+ Warning('There are user sessions connected via serial console that '\
+ 'will be terminated when serial console settings are changed!')
if not prompt_user:
# This flag is used by conf_mode/system_console.py to reset things, if there's
- # a problem, the user should issue a manual restart for serial-getty.
- print('Please ensure all settings are committed and saved before issuing a\n' \
- '"restart serial console" command to apply new configuration.')
+ # a problem, the user should issue a manual restart for serial-getty.
+ Warning('Please ensure all settings are committed and saved before issuing a ' \
+ '"restart serial console" command to apply new configuration!')
if not prompt_user:
return False
- if not ask_yes_no('Any uncommitted changes from these sessions will be lost and in-progress actions\n' \
- 'may be left in an inconsistent state. Continue?'):
+ if not ask_yes_no('Any uncommitted changes from these sessions will be lost\n' \
+ 'and in-progress actions may be left in an inconsistent state.\n'\
+ '\nContinue?'):
return False
for unit in units: