You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sonic-cli command 'show interface Ethernet' always gets exception for ipv6 disabled subinterface.
sonic# show interface Ethernet
Traceback (most recent call last):
File "/usr/sbin/cli/sonic-cli-if.py", line 119, in <module>
run(func, sys.argv[2:])
File "/usr/sbin/cli/sonic-cli-if.py", line 113, in run
return getattr(Handlers, func)(*args)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/sbin/cli/sonic-cli-if.py", line 97, in get_openconfig_interfaces_interfaces
show_cli_output(template, resp.content)
File "/usr/sbin/cli/scripts/render_cli.py", line 164, in show_cli_output
t_str = (j2_env.get_template(template_file).render(json_output=response, **kwargs))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/jinja2/environment.py", line 1295, in render
self.environment.handle_exception()
File "/usr/local/lib/python3.11/dist-packages/jinja2/environment.py", line 942, in handle_exception
raise rewrite_traceback_stack(source=source)
File "/usr/sbin/cli/render-templates/show_interface.j2", line 80, in top-level template code
{% set ip_list = subif["openconfig-if-ip:ipv6"]["addresses"]["address"] %}
^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/jinja2/environment.py", line 471, in getitem
return obj[argument]
~~~^^^^^^^^^^
jinja2.exceptions.UndefinedError: 'collections.OrderedDict object' has no attribute 'addresses'
As indicated from the stack trace, I found the line 80 of CLI/render/templates/show_interface.j2 is: {% set ip_list = subif["openconfig-if-ip:ipv6"]["addresses"]["address"] %} -> it dones't check if addresses field exist in its parent json object.
I also queried the interfaces config from HTTPS endpoints curl https://localhost/restconf/data/openconfig-interfaces:interfaces --insecure:
Activity