Skip to content

Missing required parameter in function call to ucscmethodfactory.config_resolve_classes in ucschandle.query_classids #38

@erics465

Description

@erics465
  • ucscsdk version: 0.9.0.1
  • Python version: 3.7.3
  • Operating System: Debian 10

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:

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.

What I did to fix this issue

A very small change is able to fix this problem. There are two options.

  1. Either the implementation of ucschandle.query_classids needs to pass the parameter in_return_count_only (with value None) when calling ucscmethodfactory.config_resolve_classes.
  2. Or ucscmethodfactory.config_resolve_classes could set a default value of None for the parameter in_return_count_only, which would be similar to how it is handled in ucscmethodfactory.config_resolve_class.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions