Closed Dulin0411 closed 11 months ago
Hi,
I found the xml created by pyangbind can not uesd in ncclient directly. The xml pyangbing created is as follow `
`
The xml ncclient can edit-config directly is as follow `
The code I used is as follow, if I used in wrong way?
from pyangbind.lib.serialise import pybindIETFXMLEncoder from ietf_interfaces import ietf_interfaces configs = ietf_interfaces() ret = configs.interfaces.interface.add('Twe1/0/1') ret.enabled = 'false' config = str(pybindIETFXMLEncoder.serialise(configs)) print(config)
Have you tried with config = str(pybindIETFXMLEncoder.serialise(configs.interfaces))
config = str(pybindIETFXMLEncoder.serialise(configs.interfaces))
My idea is to tell pyangbind to generate the output starting at the element.
Thanks for your suggestion,It‘s worked.
Hi,
I found the xml created by pyangbind can not uesd in ncclient directly. The xml pyangbing created is as follow `
`
The xml ncclient can edit-config directly is as follow `
`
The code I used is as follow, if I used in wrong way?
from pyangbind.lib.serialise import pybindIETFXMLEncoder from ietf_interfaces import ietf_interfaces configs = ietf_interfaces() ret = configs.interfaces.interface.add('Twe1/0/1') ret.enabled = 'false' config = str(pybindIETFXMLEncoder.serialise(configs)) print(config)