Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
erics465 opened this issue Aug 15, 2019 · 0 comments · May be fixed by #39

Comments

@erics465
Copy link

  • 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant