netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Donald Hunter <donald.hunter@gmail.com>
To: Ratheesh Kannoth <rkannoth@marvell.com>
Cc: "netdev@vger.kernel.org" <netdev@vger.kernel.org>
Subject: Re: ynl with nftables.yaml
Date: Thu, 30 Oct 2025 12:25:17 +0000	[thread overview]
Message-ID: <m2o6popoeq.fsf@gmail.com> (raw)
In-Reply-To: <MN0PR18MB58472AF35605FF6FC96EE6DDD3FBA@MN0PR18MB5847.namprd18.prod.outlook.com>

Ratheesh Kannoth <rkannoth@marvell.com> writes:

> Hi List,
>
> When I get below error, when I execute the example command mentioned in https://lwn.net/Articles/970364/ .  
>
> ####################
> root@localhost:~/linux# ./tools/net/ynl/pyynl/cli.py  --spec Documentation/netlink/specs/nftables.yaml  --multi batch-begin '{"res-id": 10}'  --multi newtable '{"name": "test", "nfgen-family": 1}'  --multi newchain '{"name": "chain", "table": "test", "nfgen-family": 1}'  --multi batch-end '{"res-id": 10}'
> Traceback (most recent call last):
>   File "/root/linux/./tools/net/ynl/pyynl/cli.py", line 163, in <module>
>     main()
>     ~~~~^^
>   File "/root/linux/./tools/net/ynl/pyynl/cli.py", line 123, in main
>     ynl = YnlFamily(spec, args.schema, args.process_unknown,
>                     recv_size=args.dbg_small_recv)
>   File "/root/linux/tools/net/ynl/pyynl/lib/ynl.py", line 468, in __init__
>     super().__init__(def_path, schema)
>     ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
>   File "/root/linux/tools/net/ynl/pyynl/lib/nlspec.py", line 462, in __init__
>     jsonschema.validate(self.yaml, schema)
>     ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^
>   File "/usr/local/lib/python3.13/site-packages/jsonschema/validators.py", line 1332, in validate
>     raise error
> jsonschema.exceptions.ValidationError: 'set id' does not match '^[0-9a-z-]+$'
>
> Failed validating 'pattern' in schema['properties']['attribute-sets']['items']['properties']['attributes']['items']['properties']['name']:
>     {'type': 'string', 'pattern': '^[0-9a-z-]+$'}
>
> On instance['attribute-sets'][34]['attributes'][1]['name']:
>     'set id'

Yes, there is an invalid attribute name in nftables.yaml. The attribute should be
set-id

  reply	other threads:[~2025-10-30 12:25 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-10-30  3:58 ynl with nftables.yaml Ratheesh Kannoth
2025-10-30 12:25 ` Donald Hunter [this message]
2025-11-04  9:58   ` Ratheesh Kannoth

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m2o6popoeq.fsf@gmail.com \
    --to=donald.hunter@gmail.com \
    --cc=netdev@vger.kernel.org \
    --cc=rkannoth@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).