univ-of-utah-marriott-library-apple / python-jamf

`python-jamf` is a library for connecting to a Jamf Server. It maps Jamf Pro records to a Record class. It is the basis for the `jctl` tool to automate patch management & packages and many other items.
MIT License
56 stars 17 forks source link

JamfRecordNotFound class missing attribute #85

Open bonallure opened 3 months ago

bonallure commented 3 months ago

Hello, it looks like the JamfRecordNotFound Error class is missing the attribute response. This causes it to not be properly returned when a record is not found, producing a type error instead.

raise exceptions.JamfRecordNotFound(response, "Not Found")
      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TypeError: Error.init() takes from 1 to 2 positional arguments but 3 were given

magnusviri commented 3 months ago

Hi, I searched for this text and it looks like it's part of the api.py file in _submit_request(), is that right? We have deprecated this file and that's probably why we didn't catch this bug. We aren't actively testing this file. If you're using it, please switch to the much more capable jps-api-wrapper.