I was querying some MOs based on their class ids. The important line of code looks like this:
pools = ucschandle.query_classids(class_ids=['macpoolPool', 'uuidpoolPool', 'fcpoolInitiators', 'ippoolPool'])
Traceback (most recent call last):
File "/usr/lib/python3.7/socketserver.py", line 650, in process_request_thread
self.finish_request(request, client_address)
File "/usr/lib/python3.7/socketserver.py", line 360, in finish_request
self.RequestHandlerClass(request, client_address, self)
File "/usr/lib/python3.7/socketserver.py", line 720, in __init__
self.handle()
File "/usr/lib/python3.7/http/server.py", line 426, in handle
self.handle_one_request()
File "/usr/lib/python3.7/http/server.py", line 414, in handle_one_request
method()
File "ucsc-exporter.py", line 75, in do_GET
output = encoder(registry)
File "/home/eric/.local/lib/python3.7/site-packages/prometheus_client/exposition.py", line 90, in generate_latest
for metric in registry.collect():
File "/home/eric/.local/lib/python3.7/site-packages/prometheus_client/registry.py", line 75, in collect
for metric in collector.collect():
File "/mnt/hgfs/ucsc-exporter/modules/main_collector.py", line 81, in collect
for metric in utilization_pool_collector.collect():
File "/mnt/hgfs/ucsc-exporter/modules/utilization_pools.py", line 111, in collect
pools = self.collect_pools()
File "/mnt/hgfs/ucsc-exporter/modules/utilization_pools.py", line 137, in collect_pools
pools = self.handle.query_classids(class_ids=['macpoolPool', 'uuidpoolPool', 'fcpoolInitiators', 'ippoolPool'])
File "/home/eric/.local/lib/python3.7/site-packages/ucscsdk/ucschandle.py", line 302, in query_classids
elem = config_resolve_classes(cookie=self.cookie, in_ids=class_id_set)
TypeError: config_resolve_classes() missing 1 required positional argument: 'in_return_count_only'
This seems like a standard python error message for a missing required argument, so I'm not including any further details about my scenario.
A very small change is able to fix this problem. There are two options.
Description
I was querying some MOs based on their class ids. The important line of code looks like this:
pools = ucschandle.query_classids(class_ids=['macpoolPool', 'uuidpoolPool', 'fcpoolInitiators', 'ippoolPool'])However, it didn't work and resulted in the following error message:
This seems like a standard python error message for a missing required argument, so I'm not including any further details about my scenario.
What I did to fix this issue
A very small change is able to fix this problem. There are two options.
ucschandle.query_classidsneeds to pass the parameterin_return_count_only(with valueNone) when callingucscmethodfactory.config_resolve_classes.ucscmethodfactory.config_resolve_classescould set a default value ofNonefor the parameterin_return_count_only, which would be similar to how it is handled inucscmethodfactory.config_resolve_class.