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
After addition of the following PR in sonic-utilities sonic-net/sonic-utilities#3521pfc config commands fail with the following error KeyError: 'UTILITIES_UNIT_TESTING' due to the UTILITIES_UNIT_TESTING environment variable not being configured. This variable is being accessed in the dump_config_to_json function as shown here
Steps to reproduce the issue:
Deploy latest master image with updated sonic-utilities
Execute pfc config command (Ex: pfc config assymmetric on Ethernet64)
Describe the results you received:
root@sonic:~# pfc config asymmetric on Ethernet64
Traceback (most recent call last):
File "/usr/local/bin/pfc", line 8, in <module>
sys.exit(cli())
^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.11/dist-packages/pfc/main.py", line 167, in configAsym
Pfc(namespace).configPfcAsym(interface, status)
File "/usr/local/lib/python3.11/dist-packages/utilities_common/multi_asic.py", line 156, in wrapped_run_on_all_asics
func(self, *args, **kwargs)
File "/usr/local/lib/python3.11/dist-packages/pfc/main.py", line 47, in configPfcAsym
self.dump_config_to_json(PORT_TABLE_NAME, self.multi_asic.current_namespace)
File "/usr/local/lib/python3.11/dist-packages/pfc/main.py", line 31, in dump_config_to_json
if os.environ["UTILITIES_UNIT_TESTING"] != "2":
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^
File "<frozen os>", line 679, in __getitem__
KeyError: 'UTILITIES_UNIT_TESTING'
Describe the results you expected:
No traceback should appear
Additional information you deem important (e.g. issue happens only occasionally):
Issue can be solved by handling the call in a try except block as shown here and here or use the get method
The text was updated successfully, but these errors were encountered:
Description
After addition of the following PR in sonic-utilities sonic-net/sonic-utilities#3521
pfc config
commands fail with the following errorKeyError: 'UTILITIES_UNIT_TESTING'
due to theUTILITIES_UNIT_TESTING
environment variable not being configured. This variable is being accessed in thedump_config_to_json
function as shown hereSteps to reproduce the issue:
pfc config assymmetric on Ethernet64
)Describe the results you received:
Describe the results you expected:
No traceback should appear
Additional information you deem important (e.g. issue happens only occasionally):
Issue can be solved by handling the call in a try except block as shown here and here or use the
get
methodThe text was updated successfully, but these errors were encountered: