macadmins / macadmins/jamf-pro-sdk-python

[Bug] Bizarre 409 error when updating a static group using a string value for the computer ID.

Aperta
#29 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

bug
Lingua principale
Python
Stelle
69
Fork
16
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia con client.classic_api.update_static_computer_group_membership_by_id, usando la riproduzione con computers_to_add=["1"] come prima verifica. Confronta il comportamento per un ID del computer di tipo stringa e di tipo intero, quindi aggiungi una copertura di regressione e verifica che il computer venga aggiunto senza l’errore 409.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
python
Ambito
api
Tipo di issue
Bug
Difficoltà
2/5
Tempo stimato
1-3 ore
Stato di attività
Ferma
Chiarezza
Specificata chiaramente
Idoneità per principianti
52/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.