codeout / junoser

PEG parser for JUNOS configuration.
MIT License
69 stars 11 forks source link

Documentation on updating the schema #16

Closed vincentbernat closed 4 years ago

vincentbernat commented 4 years ago

Hey!

Could you provide some instructions on how to update the schema? I have retrieved a schema using Netconf:

from ncclient import manager
c = manager.connect(host="X.X.X.X", port=830, username="vincent", timeout=1800, device_params={'name': 'junos'}, hostkey_verify=False)
rpc = """
<get-xnm-information>
     <type>xml-schema</type>
     <namespace>junos-configuration</namespace>
</get-xnm-information>"""
result = c.rpc(rpc)
open('schema.txt', 'w').write(str(result))

I have modified the schema to include the appropriate namespace. Then, I have renamed it to tmp/junos-system-17.2.xsd. But then, running rake build:config, I get various errors:

ERROR: unknown element: annotation

or if I remove annotations:

ERROR: unknown element: minLength

So, I must do something wrong. Should the schema be downloaded?