netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: ynl newbie question
       [not found] <MN0PR18MB5847A875201DF2889543A61DD3F1A@MN0PR18MB5847.namprd18.prod.outlook.com>
@ 2025-10-24 15:09 ` Jakub Kicinski
  2025-10-25 13:10   ` Ratheesh Kannoth
  0 siblings, 1 reply; 4+ messages in thread
From: Jakub Kicinski @ 2025-10-24 15:09 UTC (permalink / raw)
  To: Ratheesh Kannoth; +Cc: Netdev

On Fri, 24 Oct 2025 13:39:57 +0000 Ratheesh Kannoth wrote:
> HI List,
> 
> Followed.
> https://docs.kernel.org/userspace-api/netlink/intro-specs.html
> 
> But I get following error.
> 
> root@rkannoth-OptiPlex-7090:~/linux# ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/ethtool.yaml       --do rings-get       --json '{"header":{"dev-index": 18}}'
>   File "./tools/net/ynl/pyynl/cli.py", line 19
>     schema_dir = os.path.abspath(f"{script_dir}/{relative_schema_dir}")
>                                                                      ^
> 
> Should I install anything ? there is no "/usr/share/ynl" directory
> (code cloned  from  https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git)

I think you trimmed the stack trace a little too much?

But my guess if you're having issues with the schema is Python support
for jsonschema.

BTW if you're using Fedora ynl is part of kernel-tools.
Not sure if it propagated to RHEL/CentOS yet.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re:  Re: ynl newbie question
  2025-10-24 15:09 ` ynl newbie question Jakub Kicinski
@ 2025-10-25 13:10   ` Ratheesh Kannoth
  2025-10-27 10:31     ` Donald Hunter
  0 siblings, 1 reply; 4+ messages in thread
From: Ratheesh Kannoth @ 2025-10-25 13:10 UTC (permalink / raw)
  To: Jakub Kicinski; +Cc: Netdev

From: Jakub Kicinski <kuba@kernel.org> 
Subject: [EXTERNAL] Re: ynl newbie question

>I think you trimmed the stack trace a little too much?

Below is the full output.

#########################################
root@localhost:~/linux# ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/ethtool.yaml       --do rings-get       --json '{"header":{"dev-index": 18}}'
  File "./tools/net/ynl/pyynl/cli.py", line 23
    raise Exception(f"Schema directory {schema_dir} does not exist")
                                                                  ^
SyntaxError: invalid syntax
#################################


>But my guess if you're having issues with the schema is Python support
>for jsonschema.
I agree. But not getting any clue from the output error.

I see this issue in a  rootfs which is created out of  ubunutu xenial.  I have installed jsonschema here.
I don’t think it is an issue with ubuntu as I could execute command on my workstation (Which is running ubuntu noble, see output).

#################
rkannoth@rkannoth-OptiPlex-7090:/mnt$ sudo ./ubuntu-rootfs/root/linux/./tools/net/ynl/pyynl/cli.py --spec ./ubuntu-rootfs/root/linux/Documentation/netlink/specs/ethtool.yaml       --do rings-get       --json '{"header":{"dev-index":
 18}}'
Netlink error: No such device
nl_len = 76 (60) nl_flags = 0x300 nl_type = 2
        error: -19
        extack: {'msg': 'no device matches ifindex', 'bad-attr': '.header.dev-index'}

#################

-Ratheesh




^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: ynl newbie question
  2025-10-25 13:10   ` Ratheesh Kannoth
@ 2025-10-27 10:31     ` Donald Hunter
  2025-10-27 15:04       ` [EXTERNAL] " Ratheesh Kannoth
  0 siblings, 1 reply; 4+ messages in thread
From: Donald Hunter @ 2025-10-27 10:31 UTC (permalink / raw)
  To: Ratheesh Kannoth; +Cc: Jakub Kicinski, Netdev

Ratheesh Kannoth <rkannoth@marvell.com> writes:

> From: Jakub Kicinski <kuba@kernel.org> 
> Subject: [EXTERNAL] Re: ynl newbie question
>
>>I think you trimmed the stack trace a little too much?
>
> Below is the full output.
>
> #########################################
> root@localhost:~/linux# ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/ethtool.yaml       --do rings-get       --json '{"header":{"dev-index": 18}}'
>   File "./tools/net/ynl/pyynl/cli.py", line 23
>     raise Exception(f"Schema directory {schema_dir} does not exist")
>                                                                   ^
> SyntaxError: invalid syntax
> #################################

Is that an old python that doesn't have f-string support, or something?
Can you tell us the python version you are using?

^ permalink raw reply	[flat|nested] 4+ messages in thread

* RE: [EXTERNAL] Re: ynl newbie question
  2025-10-27 10:31     ` Donald Hunter
@ 2025-10-27 15:04       ` Ratheesh Kannoth
  0 siblings, 0 replies; 4+ messages in thread
From: Ratheesh Kannoth @ 2025-10-27 15:04 UTC (permalink / raw)
  To: Donald Hunter; +Cc: Jakub Kicinski, Netdev

From: Donald Hunter <donald.hunter@gmail.com> 
Subject: [EXTERNAL] Re: ynl newbie question

>
>> Below is the full output.
>>
> >#########################################
> >root@localhost:~/linux# ./tools/net/ynl/pyynl/cli.py --spec Documentation/netlink/specs/ethtool.yaml       --do rings-get       --json '{"header":{"dev-index": 18}}'
> >  File "./tools/net/ynl/pyynl/cli.py", line 23
> >    raise Exception(f"Schema directory {schema_dir} does not exist")
> >                                                                 ^
> > SyntaxError: invalid syntax
> > #################################

>Is that an old python that doesn't have f-string support, or something?
>Can you tell us the python version you are using?
Bingo !.  upgraded python and it works. Thanks a ton.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-10-27 15:04 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <MN0PR18MB5847A875201DF2889543A61DD3F1A@MN0PR18MB5847.namprd18.prod.outlook.com>
2025-10-24 15:09 ` ynl newbie question Jakub Kicinski
2025-10-25 13:10   ` Ratheesh Kannoth
2025-10-27 10:31     ` Donald Hunter
2025-10-27 15:04       ` [EXTERNAL] " Ratheesh Kannoth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).