macadmins / macadmins/jamf-pro-sdk-python
[Bug] Bizarre 409 error when updating a static group using a string value for the computer ID.
Dieses Issue hat noch niemand übernommen.
- Vorherrschende Sprache
- Python
- Sterne
- 69
- Forks
- 16
- PR-Merge-Kennzahlen
- Keine gemergten PRs in 30 T.
Beschreibung
Steps to Reproduce
client.classic_api.update_static_computer_group_membership_by_id(1, computers_to_add=["1"])
Expected Result
The computer is added. The underlying code should be casting the string value to an integer. The Pydantic model exports the correct XML document if the provided value is a string or an integer.
Actual Result
Debug logging to the console:
[ERROR] HTTPError: 409 Client Error: for url: https//XXXXXXXXXX/JSSResource/computergroups/id/1
Error: Unable to match computer
I think this is an encoding issue with the XML and Jamf is throwing an incorrect error.
When looking up a computer using the Pro API that returns the id as a string value. Passing this directly to the static group update call surfaced the error.
System Information
jamf-pro-sdk 0.3a1
Jamf Pro 10.48.2
Beitragsleitfaden
Für dieses Repository ist kein Beitragsleitfaden indexiert
Erste Schritte
- Lies das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreib ins Issue, dass du es übernimmst — das erspart doppelte Arbeit.
- Forke das Repository und arbeite in einem Branch.
- Öffne einen Pull Request, der die Issue-Nummer nennt.
Rechercherichtung
Beginne mit client.classic_api.update_static_computer_group_membership_by_id und verwende dabei die Reproduktion mit computers_to_add=["1"] als erste Prüfung. Vergleiche das Verhalten für eine Computer-ID als String und als Integer, füge anschließend Regressionstestabdeckung hinzu und überprüfe, dass der Computer ohne den 409-Fehler hinzugefügt wird.
Vom Indexierungsmodell aus dem Issue-Text verfasst.
Bewertung
- Tech-Stack
- python
- Bereich
- api
- Issue-Typ
- Bug
- Schwierigkeit
- 2/5
- Geschätzter Aufwand
- 1-3 Stunden
- Aktivitätsstatus
- Veraltet
- Klarheit
- Klar beschrieben
- Anfängerfreundlichkeit
- 52/100