04-17-2024 07:39 AM
Hello Cisco Community,
I've encountered what appears to be a bug in the DataCallbacks class implementation, specifically within the register method that is responsible for ensuring a data handler implements required methods. I would appreciate some guidance on whether this is indeed an issue, and if so, how it might be addressed.
Problem Description: The register method is designed to check that a handler object has implemented three methods: get_object, get_next, and count. However, the method only checks for the presence of get_object for all checks, ignoring get_next and count. Here's the problematic part of the code:
missing = []
for name in ('get_object', 'find_next', 'count'):
if not _have_callable(handler, 'get_object'):
missing.append(name)
Issues:
Expected Behavior: The method should correctly iterate through each required method name and check if the handler implements each one. The correct implementation might look like this:
missing = []
for name in ('get_object', 'get_next', 'count'):
if not _have_callable(handler, name):
missing.append(name)
Questions:
Thank you for looking into this matter. I am eager to hear back from the community or the Cisco team regarding this potential issue.
04-17-2024 09:38 PM
Hi ndimtri,
Nice find, I agree with you that it should be 'get_next' there.
There's no support for "experimental", otherwise I'd asked you to create a support ticket. But since there's no support I'll see if I can help you out with a fix.
BR,
Johan
04-18-2024 04:11 PM
Thank you.
Discover and save your favorite ideas. Come back to expert answers, step-by-step guides, recent topics, and more.
New here? Get started with these tips. How to use Community New member guide