Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve python member access of enums #437

Open
amorenoz opened this issue Oct 28, 2024 · 0 comments
Open

Improve python member access of enums #437

amorenoz opened this issue Oct 28, 2024 · 0 comments
Milestone

Comments

@amorenoz
Copy link
Contributor

Follow up after #426
Based on #426 (comment), look at what enums can be modified slightly in order to improve how they are accessed from python.

@amorenoz amorenoz added this to the v1.5 milestone Oct 28, 2024
@amorenoz amorenoz mentioned this issue Nov 11, 2024
atenart added a commit that referenced this issue Dec 2, 2024
Data inside complex enums can't be directly accessed in the Python
representation of the events. The only way was to use the dict
representation, which prevents from using the event fields directly.
This made the enum fields to stand out, including the whole OvS event.

Instead do a little dance with serde and allow in Python things like:

  print(e['skb'].ip.version.v6.flow_label)

This does not change the JSON representation.

Closes #437.

Suggested-by: Adrian Moreno <[email protected]>
Signed-off-by: Antoine Tenart <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant