-
Notifications
You must be signed in to change notification settings - Fork 22
Computers Report fails with homebysix-patch-1 branch #45
Comments
Thanks @jwrn3, I hadn't tested that endpoint. |
As a quick proof of concept I came up with the following: Change the sort to use the key function:
The key function
This sorts the model histogram purely on the model identifier e.g. iMac14,1. I've done a few tests on py2.7 and 3.x and it sorts as expected. Nothing more than a proof of concept though! |
Thanks a lot for this work! I put in the code and it worked well in my tests with both py2 and 3. |
I see to still have TypeErrors when using the latest release from this repo. Unrelated?
|
I'm getting this error too @krispayne. Did you ever find a solution for that? |
never mind, figured it out and will share for anyone else that might have this issue: if you have a computer/device enrollment that doesn't have a histogram/model name then this will fail. Easy way to tell is by searching all of your computers at once (blank search) and sort by Model. Anything that's blank will need to be fixed or deleted, and then the script will run fine. |
Autopkg v2.0.1RC2
python-jss v2.1
JSSImporter v1.1.0
When invoking Spruce either via
/Library/AutoPkg/Python3/Python.framework/Versions/Current/bin/python3 ./spruce.py --computers
or/Library/AutoPkg/Python3/Python.framework/Versions/Current/bin/python3 ./spruce.py
the report fails with the following error:I have no mobile devices in this JSS so cannot test --mobile_devices but all other reports succeed.
If I drop the .decode I get further but then hit the following error:
After doing a little digging it looks like the sort() function is rather different in Py3 so a lot of the code in model_identifier_cmp() needs reworking. Additionally cmp() isn't available in python3 I'm not sure how viable it is to ensure compatibility with both py2 & py3.
I'll try and kick the issue around a little.
The text was updated successfully, but these errors were encountered: