dainok / netdoc

Automatic Network Documentation plugin for NetBox
GNU General Public License v3.0
89 stars 13 forks source link

Cisco IOS: Issue parsing vlans on Catalyst C3750E, IOS version 15.2(4) #52

Closed svestenik closed 1 year ago

svestenik commented 1 year ago

Ingest script errors out while ingesting vlans:

An exception occurred: `ValidationError: 'name' is a required property

Failed validating 'required' in schema: {'properties': {'name': {'type': 'string'}, 'status': {'enum': ['active', 'reserved', 'deprecated'], 'type': 'string'}, 'vid': {'type': 'integer'}}, 'required': ['vid', 'name', 'status'], 'type': 'object'}

On instance: {'status': 'active', 'vid': 1}`

Traceback (most recent call last):
  File "/opt/netbox/netbox/extras/scripts.py", line 476, in _run_script
    script.output = script.run(data=data, commit=commit)
  File "/opt/netbox/netbox/scripts/NetDoc.py", line 290, in run
    log_ingest(log)
  File "/opt/netbox/venv/lib/python3.9/site-packages/netdoc/utils.py", line 504, in log_ingest
    module.ingest(log)
  File "/opt/netbox/venv/lib/python3.9/site-packages/netdoc/ingestors/netmiko_cisco_ios_show_vlan.py", line 26, in ingest
    vlan_o = vlan.create(**data)
  File "/opt/netbox/venv/lib/python3.9/site-packages/netdoc/schemas/vlan.py", line 52, in create
    validate(data, get_schema_create(), format_checker=FormatChecker())
  File "/opt/netbox/venv/lib/python3.9/site-packages/jsonschema/validators.py", line 934, in validate
    raise error
jsonschema.exceptions.ValidationError: 'name' is a required property

Failed validating 'required' in schema:
    {'properties': {'name': {'type': 'string'},
                    'status': {'enum': ['active', 'reserved', 'deprecated'],
                               'type': 'string'},
                    'vid': {'type': 'integer'}},
     'required': ['vid', 'name', 'status'],
     'type': 'object'}

On instance:
    {'status': 'active', 'vid': 1}

Raw log file attached:

13194.json.txt

dainok commented 1 year ago

NTC templates are changing a lot: NTC team is normalizing fields. So until the situation is stable again, you can experiment issues.

https://github.com/dainok/netdoc/pull/53 fixes many issues. I suggest to use latest NetDoc and NTC templates from this morning. Let me know if works better.

dainok commented 1 year ago

I reviewed all templates (except IOS and Comware), test 0.10.27. Let me know if you still have issues.