summaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2026-02-04 11:32:47 +0300
committerOleksandr Kuchmystyi <o.kuchmystyi@vyos.io>2026-03-03 14:30:01 +0300
commit1359f690af841ea7c28028e907b1d5f15f3d90b8 (patch)
tree9a0c81474a6f8aa2c6272b6ff2a550ee3442f8ea /python
parent3e448bd51685688bdae6ec698a3923cfdeb83689 (diff)
downloadvyos-1x-1359f690af841ea7c28028e907b1d5f15f3d90b8.tar.gz
vyos-1x-1359f690af841ea7c28028e907b1d5f15f3d90b8.zip
tech-support: T8215: Extend tech-support archive and report generation
- Exclude .iso files from `/config` and `/home/*` to avoid large images - Exclude previous debug-archived from new archives - Include `/run` directory contents - Add kernel modules information (`lsmod`) - Add PCI details (`lspci -knnv`) - Include full `/config` directory - Add FRR memory usage (`vtysh "show memory"`) - Add VPP info (`vppctl`) - Add NUMA details (`numactl --hardware`, `numastat -cm`) Full list of commands here: https://vyos.dev/T8215
Diffstat (limited to 'python')
-rw-r--r--python/vyos/utils/file.py15
-rw-r--r--python/vyos/utils/process.py6
2 files changed, 21 insertions, 0 deletions
diff --git a/python/vyos/utils/file.py b/python/vyos/utils/file.py
index 6708ade2d..f230977a7 100644
--- a/python/vyos/utils/file.py
+++ b/python/vyos/utils/file.py
@@ -339,3 +339,18 @@ def file_compare(file1: str, file2: str) -> bool:
return False
return True
+
+
+def get_name_from_path(path) -> str:
+ """
+ Extracts the base name (without extension) from a file path.
+
+ Args:
+ path (str | pathlib.Path): The file path to extract the name from.
+
+ Returns:
+ str: The base name without file extension.
+ """
+ base = os.path.basename(path)
+ name, _ = base.split('.', maxsplit=1)
+ return name
diff --git a/python/vyos/utils/process.py b/python/vyos/utils/process.py
index 158371024..74546a172 100644
--- a/python/vyos/utils/process.py
+++ b/python/vyos/utils/process.py
@@ -321,3 +321,9 @@ def ip_cmd(args, json=True):
else:
res = cmd(f"ip {args}")
return res
+
+
+def wrap_op(cmd: str) -> str:
+ """Returns a command with the VyOS operational mode wrapper."""
+
+ return f'/opt/vyatta/bin/vyatta-op-cmd-wrapper {cmd}'