summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/io.py11
-rw-r--r--python/vyos/vpp/config_verify.py11
2 files changed, 19 insertions, 3 deletions
diff --git a/python/vyos/utils/io.py b/python/vyos/utils/io.py
index 0883376d1..3efb55ddc 100644
--- a/python/vyos/utils/io.py
+++ b/python/vyos/utils/io.py
@@ -111,3 +111,14 @@ def select_entry(l: list, list_msg: str = '', prompt_msg: str = '',
select = ask_input(prompt_msg, default=default_entry, numeric_only=True,
valid_responses=valid_entry)
return next(filter(lambda x: x[0] == select, en))[1]
+
+def catch_broken_pipe(func):
+ import os
+ import sys
+ def wrapped(*args, **kwargs):
+ try:
+ func(*args, **kwargs)
+ except (BrokenPipeError, KeyboardInterrupt):
+ # Flush output to /dev/null and bail out.
+ os.dup2(os.open(os.devnull, os.O_WRONLY), sys.stdout.fileno()) # pylint: disable = no-member
+ return wrapped
diff --git a/python/vyos/vpp/config_verify.py b/python/vyos/vpp/config_verify.py
index d051ef359..823443be5 100644
--- a/python/vyos/vpp/config_verify.py
+++ b/python/vyos/vpp/config_verify.py
@@ -169,9 +169,14 @@ def verify_dev_driver(driver_type: str, driver: str) -> bool:
if driver_type == 'dpdk':
if driver in drivers_dpdk:
return True
- elif driver_type == 'xdp':
- if driver in drivers_xdp:
- return True
+ # XDP support is intentionally disabled (T8202).
+ # XDP is no longer configurable via the CLI.
+ # This logic is kept commented out to make it easy
+ # to reintroduce XDP if there is a clear need in the future.
+ #
+ # elif driver_type == 'xdp':
+ # if driver in drivers_xdp:
+ # return True
else:
raise ConfigError(f'"Driver type {driver_type} is wrong')