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
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