ConfD User Community

How can i get the opaque string inside validation callback?


#1

Hi,

I am using the python api and when my validation callback is triggered i want to access the opaque string i have passed with the tailf:opaque statement in the yang model. The problem is that i cannot find a way to do that when using the transaction context. I keep getting AttributeError when trying to access the '_confd.TransCtxRef '. What is the name of the attribute i must use? I have tried v_opaque, validate_opaque and callpoint_opaque. The user guide does not refer how to do that when using the python api.

Thanks.


#2

$ find $CONFD_DIR/src/confd/pyapi -type f |xargs grep “vcb_opaque”
src/confd/pyapi/src/_dp.c: PyObject *callback = (PyObject *) tctx->vcb_opaque;

The ConfD Python API use the vcb_opaque internally to implement the Python API, hence the vcb_opaque is not available from the Python API.


#3

I’m afraid I don’t know the answer to the original question, but it is not about vcb_opaque - in the C API, the string from the tailf:opaque substatement to tailf:validate is provided via the validate_opaque element of the transaction context (vcb_opaque comes from the callback registration.)