Comments (2)
Hi Tim,
Sorry -- I've been travelling for the last couple of days.
There is a _yang_type
element in YANGDynType
already - which stores what the leaf was defined as in the model. This would let you get the boolean vs. empty. There are nuances here, such that this may not work in all cases - for example, in the case that you have a typedef
that then is a boolean
or empty
underneath, then this would not be exposed.
The best fix for this (it doesn't matter in other serialisations), would be to add something to YANGBool
that is taken by the __init__
there to store whether it is being initialised as an empty or boolean leaf. This is then resilient to typedef features.
Would you be interested in contributing the XML serialisation code back into the project? :-)
Thanks,
r.
from pyangbind.
Yes, _yang_type
gives me what I need. It's not present in the version I'm using in production at the moment, and I forgot to check the most recent version.
In principle, I'd be happy to contribute the XML serialisation code. It probably doesn't cover all the cases at the moment as I've only tested with my own use cases, but hopefully it's a basis to start from. I'll have to check with my employer about the copyright situation, but I don't anticipate that will be a problem.
from pyangbind.
Related Issues (20)
- How to inspect yang model HOT 2
- pyangbind is not taking care of "when" statement in yang definitions. HOT 2
- Problem with list's key made of multiple leaf identifiers HOT 3
- Is pyangbind still maintained? HOT 3
- RuntimeError when importing an older revision of a YANG file HOT 1
- Failure on OpenConfig BFD Model HOT 3
- Fix binary type representation HOT 2
- Integration and Sample UnitTests using BGP are broken
- __add_metadata is not adding the @metadata object to JSON or XML HOT 2
- 0.8.3 - TypeError: cannot pickle 'lxml.etree.XMLSchema' object HOT 8
- Support `bits` type HOT 1
- pyangbind fails processing typedef union with default value
- pyangbind-0.8.4 installation failed HOT 2
- Can not be directly used in ncclient? HOT 2
- TypeError: unhandled keyword with children case HOT 3
- How to filter by leaf? HOT 3
- Process for moving a list element HOT 2
- When we generate python code from Yang module, missing attributes in class HOT 6
- Presence container support HOT 15
- Primary key of a list cannot be of type string with a specific pattern HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyangbind.