Skip to content

Commit b1b62d6

Browse files
donaldhkuba-moo
authored andcommitted
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 <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
1 parent 2ff80ce commit b1b62d6

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

tools/net/ynl/pyynl/ethtool.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111

1212
sys.path.append(pathlib.Path(__file__).resolve().parent.as_posix())
1313
from lib import YnlFamily
14+
from cli import schema_dir, spec_dir
1415

1516
def args_to_req(ynl, op_name, args, req):
1617
"""
@@ -156,10 +157,8 @@ def main():
156157
args = parser.parse_args()
157158

158159
script_abs_dir = os.path.dirname(os.path.abspath(sys.argv[0]))
159-
spec = os.path.join(script_abs_dir,
160-
'../../../Documentation/netlink/specs/ethtool.yaml')
161-
schema = os.path.join(script_abs_dir,
162-
'../../../Documentation/netlink/genetlink-legacy.yaml')
160+
spec = os.path.join(spec_dir(), 'ethtool.yaml')
161+
schema = os.path.join(schema_dir(), 'genetlink-legacy.yaml')
163162

164163
ynl = YnlFamily(spec, schema)
165164

0 commit comments

Comments
 (0)