summaryrefslogtreecommitdiff
path: root/tools/net
diff options
context:
space:
mode:
authorDonald Hunter <donald.hunter@gmail.com>2025-01-11 15:48:03 +0000
committerJakub Kicinski <kuba@kernel.org>2025-01-13 19:06:10 -0800
commitb1b62d6d332e09a2125c830c809c2622164ec35b (patch)
treebe11a08dbef4a7c2b80fa1165f21079976ad690b /tools/net
parent2ff80cefb77b70aa860ecf3c69f50e3f4cce439b (diff)
tools/net/ynl: ethtool: support spec load from install location
Replace hard-coded paths for spec and schema with lookup functions so that ethtool.py will work in-tree or when installed. Signed-off-by: Donald Hunter <donald.hunter@gmail.com> Link: https://patch.msgid.link/20250111154803.7496-2-donald.hunter@gmail.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'tools/net')
-rwxr-xr-xtools/net/ynl/pyynl/ethtool.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/tools/net/ynl/pyynl/ethtool.py b/tools/net/ynl/pyynl/ethtool.py
index ebb0a11f67bf..af7fddd7b085 100755
--- a/tools/net/ynl/pyynl/ethtool.py
+++ b/tools/net/ynl/pyynl/ethtool.py
@@ -11,6 +11,7 @@ import os
sys.path.append(pathlib.Path(__file__).resolve().parent.as_posix())
from lib import YnlFamily
+from cli import schema_dir, spec_dir
def args_to_req(ynl, op_name, args, req):
"""
@@ -156,10 +157,8 @@ def main():
args = parser.parse_args()
script_abs_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
- spec = os.path.join(script_abs_dir,
- '../../../Documentation/netlink/specs/ethtool.yaml')
- schema = os.path.join(script_abs_dir,
- '../../../Documentation/netlink/genetlink-legacy.yaml')
+ spec = os.path.join(spec_dir(), 'ethtool.yaml')
+ schema = os.path.join(schema_dir(), 'genetlink-legacy.yaml')
ynl = YnlFamily(spec, schema)