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

**kwargs computer match search not working #104

Open
mat2159279 opened this issue Aug 27, 2020 · 0 comments
Open

**kwargs computer match search not working #104

mat2159279 opened this issue Aug 27, 2020 · 0 comments

Comments

@mat2159279
Copy link

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.

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

No branches or pull requests

1 participant