netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* ynl with nftables.yaml
@ 2025-10-30  3:58 Ratheesh Kannoth
  2025-10-30 12:25 ` Donald Hunter
  0 siblings, 1 reply; 3+ messages in thread
From: Ratheesh Kannoth @ 2025-10-30  3:58 UTC (permalink / raw)
  To: netdev@vger.kernel.org; +Cc: donald.hunter@gmail.com

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'
########################




root@localhost:~/linux# pip show jsonschema
WARNING: The directory '/root/.cache/pip' or its parent directory is not owned or is not writable by the current user. The cache has been disabled. Check the permissions and owner of that directory. If executing pip with sudo, you should use sudo's -H flag.
Name: jsonschema
Version: 4.25.1
Summary: An implementation of JSON Schema validation for Python
Home-page: https://github.com/python-jsonschema/jsonschema
Author:
Author-email: Julian Berman <Julian+jsonschema@GrayVines.com>
License-Expression: MIT
Location: /usr/local/lib/python3.13/site-packages
Requires: attrs, jsonschema-specifications, referencing, rpds-py
Required-by:


root@localhost:~/linux# python3 -V
Python 3.13.9






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

* Re: ynl with nftables.yaml
  2025-10-30  3:58 ynl with nftables.yaml Ratheesh Kannoth
@ 2025-10-30 12:25 ` Donald Hunter
  2025-11-04  9:58   ` Ratheesh Kannoth
  0 siblings, 1 reply; 3+ messages in thread
From: Donald Hunter @ 2025-10-30 12:25 UTC (permalink / raw)
  To: Ratheesh Kannoth; +Cc: netdev@vger.kernel.org

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

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

* RE:  Re: ynl with nftables.yaml
  2025-10-30 12:25 ` Donald Hunter
@ 2025-11-04  9:58   ` Ratheesh Kannoth
  0 siblings, 0 replies; 3+ messages in thread
From: Ratheesh Kannoth @ 2025-11-04  9:58 UTC (permalink / raw)
  To: Donald Hunter; +Cc: netdev@vger.kernel.org

From: Donald Hunter <donald.hunter@gmail.com> 
Subject: [EXTERNAL] Re: ynl with nftables.yaml

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

After modification, command just hangs. No logs.  How to debug ?

-Ratheesh 

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

end of thread, other threads:[~2025-11-04  9:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-30  3:58 ynl with nftables.yaml Ratheesh Kannoth
2025-10-30 12:25 ` Donald Hunter
2025-11-04  9:58   ` 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).