Open adivardh-cisco opened 1 week ago
2024-09-27T13:39:30: %AETEST-ERROR: Caught an exception while executing section configure_policy:
2024-09-27T13:39:30: %AETEST-ERROR: Traceback (most recent call last):
2024-09-27T13:39:30: %AETEST-ERROR: File "/nobackup/adivardh/teacat_practice/user_missing.py", line 59, in configure_policy
2024-09-27T13:39:30: %AETEST-ERROR: uut.api.configure_common_criteria_policy(policy)
2024-09-27T13:39:30: %AETEST-ERROR: File "/nobackup/adivardh/pyats/lib/python3.8/site-packages/genie/conf/base/api.py", line 206, in wrapper_match
2024-09-27T13:39:30: %AETEST-ERROR: func_result = func(*args, **kwargs)
2024-09-27T13:39:30: %AETEST-ERROR: File "/nobackup/adivardh/pyats/lib/python3.8/site-packages/genie/libs/sdk/apis/iosxe/aaa/configure.py", line 924, in configure_common_criteria_policy
2024-09-27T13:39:30: %AETEST-ERROR: if int(lower_case) > 0:
2024-09-27T13:39:30: %AETEST-ERROR: TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
Hello @adivardh-cisco,
Thank you for providing the fix for this issue. It seems you will have to add unittest for this. So, kindly follow this documentation: https://pubhub.devnetcloud.com/media/pyats-development-guide/docs/writeapi/writeapi.html#unit-testing. Also, if needed, refer to this PR: https://github.com/CiscoTestAutomation/genielibs/pull/171
Thank you.
Hi @SohanTirpude
I have added a test and attached the logs, do let me know if anything else is needed.
The API end point for configuring aaa common criteria policy i.e : configure_common_criteria_policy has optional arguments defined, operations on these optional args throws runtime errors when we don't provide these parameters because the defaults are None.
File: genielibs/pkgs/sdk-pkg/src/genie/libs/sdk/apis/iosxe/aaa/configure.py
Eg: