Skip to content
This repository was archived by the owner on May 28, 2025. It is now read-only.
This repository was archived by the owner on May 28, 2025. It is now read-only.

**kwargs computer match search not working  #104

@mat2159279

Description

@mat2159279

according to the documentation adding a * to a computer search will preform a match search

"– str: Search for an object by name. Some objects allow ‘match’ searches, using ‘*’ as the wildcard operator."

The computer name that Im searching for is MC305239-LT-42CTS so in my code as a match search Im searching for MC305239*
expected url: https://my-jamf-site.jamfcloud.com:8443/JSSResource/computers/match/MC305239*

computer = j.Computer('MC305239*')
print(computer)

which returns

Traceback (most recent call last):
  File "python-jss.py", line 12, in <module>
    print(computer)
  File "/Users/mat2159279/.pyenv/versions/3.8.5/lib/python3.8/site-packages/jss/queryset.py", line 104, in __str__
    table = [
  File "/Users/mat2159279/.pyenv/versions/3.8.5/lib/python3.8/site-packages/jss/queryset.py", line 105, in <listcomp>
    fmt.format(data=item._basic_identity, cached=str_cached(item)) for
TypeError: unsupported format string passed to NoneType.__format__

If I remove the MC from the front of the computer name it returns a blank table

Empty QuerySet
---------------------
| id | name| cached |
---------------------
---------------------

At that point I should be pacing another * in front of the name
expected url: https://my-jamf-site.jamfcloud.com:8443/JSSResource/computers/match/*305239*
But if I do place another * in front I get

Traceback (most recent call last):
  File "python-jss.py", line 12, in <module>
    print(computer)
  File "/Users/mat2159279/.pyenv/versions/3.8.5/lib/python3.8/site-packages/jss/queryset.py", line 104, in __str__
    table = [
  File "/Users/mat2159279/.pyenv/versions/3.8.5/lib/python3.8/site-packages/jss/queryset.py", line 105, in <listcomp>
    fmt.format(data=item._basic_identity, cached=str_cached(item)) for
TypeError: unsupported format string passed to NoneType.__format__

The same as above using the MC in front.

If i purposefully enter in a name that I know will not return a value I also get the blank table.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions