CiscoDevNet / yang-explorer

An open-source Yang Browser and RPC Builder Application
Apache License 2.0
438 stars 177 forks source link

Error uploading YANG model from ENCS-5400 (NFVIS Version: 3.5.1-FC4) #61

Open adaltrin opened 7 years ago

adaltrin commented 7 years ago

Using YangExplorer 0.7.0 Successfully added device profile, connected to the device and listed the available YANG models via "Manage Models" --> Device. However, when pressed "Sync", selecting one or multiple models (for instance, esc_opdata), it resulted on an Http Error "Something went wrong, retured errored response!!"

Here is the log...

INFO:explorer.utils.schema:Downloading ['esc_opdata@2016-02-01'] INFO:explorer.utils.schema:Downloading set(['esc_opdata_networks', 'esc_opdata_images', 'esc_opdata_system_config', 'esc_opdata_flavors', 'esc_opdata_devstats', 'esc_opdata_tenant']) INFO:explorer.utils.schema:Downloading set(['esc_opdata_networks', 'esc_opdata_state_machines', 'esc_opdata_flavor_state_machine', 'esc_types', 'esc_opdata_volumes', 'esc_opdata_interface', 'ietf-yang-types', 'esc_opdata_image_state_machine']) ERROR:root:Could not parse modulename, uploaded file may be corrupted !! INFO:explorer.utils.schema:Downloading set(['ietf-inet-types', 'ietf-yang-types', 'esc_types']) ERROR:root:Could not parse modulename, uploaded file may be corrupted !! ERROR:root:Could not parse modulename, uploaded file may be corrupted !! [14/Apr/2017 18:14:02] ERROR [django.request] Internal Server Error: /explorer/schema Traceback (most recent call last): File "/home/daltrini/yang-explorer/v/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, *callback_args, *callback_kwargs) File "/home/daltrini/yang-explorer/server/explorer/views.py", line 303, in schema_handler return add_schema(request, req) File "/home/daltrini/yang-explorer/server/explorer/utils/schema.py", line 213, in add_schema modules = download_yang(request, req) File "/home/daltrini/yang-explorer/server/explorer/utils/schema.py", line 167, in download_yang new_fname = os.path.join(session_dir, parser.get_filename()) File "/home/daltrini/yang-explorer/server/explorer/utils/yang.py", line 78, in get_filename return self.module + '.yang' TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' ERROR:django.request:Internal Server Error: /explorer/schema Traceback (most recent call last): File "/home/daltrini/yang-explorer/v/local/lib/python2.7/site-packages/django/core/handlers/base.py", line 132, in get_response response = wrapped_callback(request, callback_args, **callback_kwargs) File "/home/daltrini/yang-explorer/server/explorer/views.py", line 303, in schema_handler return add_schema(request, req) File "/home/daltrini/yang-explorer/server/explorer/utils/schema.py", line 213, in add_schema modules = download_yang(request, req) File "/home/daltrini/yang-explorer/server/explorer/utils/schema.py", line 167, in download_yang new_fname = os.path.join(session_dir, parser.get_filename()) File "/home/daltrini/yang-explorer/server/explorer/utils/yang.py", line 78, in get_filename return self.module + '.yang' TypeError: unsupported operand type(s) for +: 'NoneType' and 'str' [14/Apr/2017 18:14:02]"GET /explorer/schema?&payload=%3Cpayload%20version%3D%223%22%20protocol%3D%22netconf%22%3E%0A%20%20%3Cmetadata%3E%0A%20%20%20%20%3Cdevice%2Dauth%20profile%3D%22%22%20platform%3D%22other%22%20host%3D%22%22%20port%3D%22%22%20user%3D%22%22%20passwd%3D%22%22%2F%3E%0A%20%20%20%20%3Cnetconf%2Dauth%20host%3D%2210%2E88%2E93%2E60%22%20port%3D%22830%22%20user%3D%22admin%22%20passwd%3D%22Cisco123%2A%22%2F%3E%0A%20%20%3C%2Fmetadata%3E%0A%20%20%3Ckeyvalue%2F%3E%0A%20%20%3Cschemas%3E%0A%20%20%20%20%3Cschema%3Eesc%5Fopdata%402016%2D02%2D01%3C%2Fschema%3E%0A%20%20%3C%2Fschemas%3E%0A%3C%2Fpayload%3E&action=add%2Dschema HTTP/1.1" 500 93877

rustogi commented 7 years ago

@adaltrin Could you name esc_opdata as esc-opdata.yang and so on for all your esc models?

I am guessing the regex parser is choking on "_"