brysontyrrell / promoter

A Python module for migrating objects between two Jamf Pro servers via the REST API.
MIT License
9 stars 0 forks source link

Smart Computer Groups contained as criteria of other Smart Computer Groups can't be deleted - http 400 bad request #1

Open scheblein opened 7 years ago

scheblein commented 7 years ago

It throws this error when you have a smart Computer Group that's used as criteria in another smart Computer group.

DEBUG:root:DELETE: https://jssexample.jamfcloud.com/JSSResource/computergroups/id/20 DEBUG:requests.packages.urllib3.connectionpool:https://jssexample.jamfcloud.com:443 "DELETE /JSSResource/computergroups/id/20 HTTP/1.1" 400 848 Traceback (most recent call last): File "main.py", line 31, in main() File "main.py", line 27, in main promoter.clean_jss(target_jss) File "/Users/arschebl/Downloads/promoter-master/promoter.py", line 48, in clean_jss getattr(jss, resource)(i, delete=True) File "/Users/arschebl/Downloads/promoter-master/jsslib.py", line 248, in computer_groups list_value='computer_group', group_filter=group_filter) File "/Users/arschebl/Downloads/promoter-master/jsslib.py", line 220, in _group_object return self._delete(obj_url) File "/Users/arschebl/Downloads/promoter-master/jsslib.py", line 170, in _delete resp.raise_for_status() File "/Library/Python/2.7/site-packages/requests-2.13.0-py2.7.egg/requests/models.py", line 928, in raise_for_status raise HTTPError(http_error_msg, response=self) requests.exceptions.HTTPError: 400 Client Error: Bad Request for url: https://jssexample.jamfcloud.com/JSSResource/computergroups/id/20

brysontyrrell commented 7 years ago

I didn't write group-nesting dependencies into the manifests.

I'm going to flag this as a bug and incorporate it into the work I'm doing to add dependency support into the manifests.