Skip to content

Commit

Permalink
tools/net/ynl: ethtool: support spec load from install location
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Donald Hunter authored and Jakub Kicinski committed Jan 14, 2025
1 parent 2ff80ce commit b1b62d6
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions tools/net/ynl/pyynl/ethtool.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

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):
"""
Expand Down Expand Up @@ -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)

Expand Down

0 comments on commit b1b62d6

Please sign in to comment.